]>
git.argeo.org Git - gpl/argeo-slc.git/blob - org.argeo.slc.webapp/src/main/webapp/source/class/org/argeo/ria/components/Modal.js
2c8aef04d6f6ce9b7338f9402fa2cae82809e07d
2 * Generic modal popup window.
3 * It is layed out with a dock layout. When adding components to it, they are added as "center".
4 * @author Charles du Jeu
6 qx
.Class
.define("org.argeo.ria.components.Modal",
8 extend
: qx
.ui
.window
.Window
,
12 * @param caption {String} Title of the window
13 * @param icon {String} Icon of the window
14 * @param text {String} Default content of the window.
16 construct : function(caption
, icon
, text
){
24 this.setLayout(new qx
.ui
.layout
.Dock());
25 var closeButton
= new qx
.ui
.form
.Button("Close");
26 closeButton
.addListener("execute", function(e
){
30 this.add(closeButton
, {edge
:'south'});
40 * Display text inside the popup
41 * @param text {String} A string content for the popup
43 addLabel:function(text
){
44 this.add(new qx
.ui
.basic
.Label(text
), {edge
:'center', width
:'100%'});
47 * Display a component (panel) in the center of the popup
48 * @param panel {qx.ui.core.Widget} A gui component (will be set at width 100%).
50 addContent: function(panel
){
51 this.add(panel
, {edge
:'center', width
:'100%'});
54 * Automatically attach to the application root, then show.
56 attachAndShow:function(){
57 org
.argeo
.ria
.components
.ViewsManager
.getInstance().getApplicationRoot().add(this);