org.argeo.ria.components.ViewsManager.getInstance().getApplicationRoot().add(this); \r
this.show();\r
},\r
+ /**\r
+ * Adds a close button bottom-center aligned to the popup\r
+ */\r
addCloseButton : function(){\r
this.closeButton = new qx.ui.form.Button("Close");\r
this.closeButton.addListener("execute", this._closeAndDestroy, this);\r
this.add(this.closeButton, {edge:'south'}); \r
},\r
+ /**\r
+ * Adds two buttons bottom-center aligned (Ok and Cancel). \r
+ * Ok button has no listener by default, Cancel will close and destroy the popup.\r
+ */\r
addOkCancel : function(){\r
var buttonPane = new qx.ui.container.Composite(new qx.ui.layout.HBox(5, 'right'));\r
buttonPane.setAlignX("center");\r
buttonPane.add(this.cancelButton);\r
buttonPane.add(this.okButton);\r
},\r
+ /**\r
+ * Adds a prompt form to the popup : a question, followed by a text input.\r
+ * @param questionString {String} The question to ask to the user \r
+ * @param validationCallback {Function} Callback to apply : takes the text input value as unique argument.\r
+ * @param callbackContext {Object} Context for the callback, optional.\r
+ */\r
makePromptForm:function(questionString, validationCallback, callbackContext){\r
this.add(new qx.ui.basic.Label(questionString), {edge:'north'});\r
var textField = new qx.ui.form.TextField();\r
if(valid) this._closeAndDestroy();\r
}, this);\r
},\r
+ /**\r
+ * Close this modal window and destroy it.\r
+ */\r
_closeAndDestroy : function(){\r
this.hide();\r
this.destroy(); \r