X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=org.argeo.slc.webapp%2Fsrc%2Fmain%2Fwebapp%2Fsource%2Fclass%2Forg%2Fargeo%2Fria%2Fcomponents%2FModal.js;h=2c8aef04d6f6ce9b7338f9402fa2cae82809e07d;hb=225469d907b6ecc03fd500cd0db950f92fea8534;hp=6906599434bb14086dd73644d4ecdf19c5998746;hpb=8f4e4722a346442a8ed1ca84efa24b60bfaf3d19;p=gpl%2Fargeo-slc.git diff --git a/org.argeo.slc.webapp/src/main/webapp/source/class/org/argeo/ria/components/Modal.js b/org.argeo.slc.webapp/src/main/webapp/source/class/org/argeo/ria/components/Modal.js index 690659943..2c8aef04d 100644 --- a/org.argeo.slc.webapp/src/main/webapp/source/class/org/argeo/ria/components/Modal.js +++ b/org.argeo.slc.webapp/src/main/webapp/source/class/org/argeo/ria/components/Modal.js @@ -1,16 +1,18 @@ -/* ************************************************************************ - - Copyright: 2008 Argeo - - License: - - Authors: Charles du Jeu - -************************************************************************ */ +/** + * Generic modal popup window. + * It is layed out with a dock layout. When adding components to it, they are added as "center". + * @author Charles du Jeu + */ qx.Class.define("org.argeo.ria.components.Modal", { extend : qx.ui.window.Window, + /** + * + * @param caption {String} Title of the window + * @param icon {String} Icon of the window + * @param text {String} Default content of the window. + */ construct : function(caption, icon, text){ this.base(arguments); this.set({ @@ -34,12 +36,23 @@ qx.Class.define("org.argeo.ria.components.Modal", }, members : { + /** + * Display text inside the popup + * @param text {String} A string content for the popup + */ addLabel:function(text){ this.add(new qx.ui.basic.Label(text), {edge:'center', width:'100%'}); }, + /** + * Display a component (panel) in the center of the popup + * @param panel {qx.ui.core.Widget} A gui component (will be set at width 100%). + */ addContent: function(panel){ this.add(panel, {edge:'center', width:'100%'}); }, + /** + * Automatically attach to the application root, then show. + */ attachAndShow:function(){ org.argeo.ria.components.ViewsManager.getInstance().getApplicationRoot().add(this); this.show();