X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=server%2Forg.argeo.slc.ria%2Fsrc%2Fargeo-ria-lib%2Fjcr%2Fclass%2Forg%2Fargeo%2Fjcr%2Fria%2Fviews%2FXmlNodeEditor.js;fp=server%2Forg.argeo.slc.ria%2Fsrc%2Fargeo-ria-lib%2Fjcr%2Fclass%2Forg%2Fargeo%2Fjcr%2Fria%2Fviews%2FXmlNodeEditor.js;h=2493edda84cab20e1664f7f734f05f250cd56f6a;hb=76ce032d334bca776cc0004287092bd9766a4a0f;hp=0000000000000000000000000000000000000000;hpb=6926b1fc72b36a5d8ec188a4981665fb7554a7d9;p=gpl%2Fargeo-slc.git diff --git a/server/org.argeo.slc.ria/src/argeo-ria-lib/jcr/class/org/argeo/jcr/ria/views/XmlNodeEditor.js b/server/org.argeo.slc.ria/src/argeo-ria-lib/jcr/class/org/argeo/jcr/ria/views/XmlNodeEditor.js new file mode 100644 index 000000000..2493edda8 --- /dev/null +++ b/server/org.argeo.slc.ria/src/argeo-ria-lib/jcr/class/org/argeo/jcr/ria/views/XmlNodeEditor.js @@ -0,0 +1,72 @@ +qx.Class.define("org.argeo.jcr.ria.views.XmlNodeEditor", { + extend : qx.ui.embed.Html, + implement : [org.argeo.ria.components.IView], + + properties : { + /** + * The commands definition Map that will be automatically added and wired to the menubar and toolbar. + * See {@link org.argeo.ria.event.CommandsManager#definitions} for the keys to use for defining commands. + */ + commands : { + init : {} + }, + viewSelection : { + nullable:false, + check:"org.argeo.ria.components.ViewSelection" + }, + instanceId : { + init:"XmlEditor", + event : "changeInstanceId" + }, + instanceLabel : { + init:"Xml Editor", + event : "changeInstanceLabel" + } + }, + + construct : function(){ + this.base(arguments); + }, + + members : { + /** + * The implementation should contain the GUI initialisation. + * This is the role of the manager to actually add the graphical component to the pane, + * so it's not necessary to do it here. + * @param viewPane {org.argeo.ria.components.ViewPane} The pane manager + * @param data {Mixed} Any object or data passed by the initiator of the view + * @return {Boolean} + */ + init : function(viewPane, data){ + this.setViewSelection(new org.argeo.ria.components.ViewSelection(viewPane.getViewId())); + this.setHtml("Hello!"); + }, + /** + * The implementation should contain the real data loading (i.o. query...) + * @return {Boolean} + */ + load : function(rootNode){ + rootNode.load(); + rootNode.addListener("changeLoadState", function(){ + var xmlString = rootNode.toXmlString(true); + this.setHtml(qx.xml.String.escape(xmlString)); + }, this); + }, + /** + * Whether this component is already contained in a scroller (return false) or not (return true). + * @return {Boolean} + */ + addScroll : function(){ + return true; + }, + /** + * Called at destruction time + * Perform all the clean operations (stopping polling queries, etc.) + */ + close : function(){ + + } + } + + +}); \ No newline at end of file