]> git.argeo.org Git - gpl/argeo-slc.git/blob - server/org.argeo.slc.ria/src/argeo-ria-lib/jcr/class/org/argeo/jcr/ria/views/XmlNodeEditor.js
First draft for Jcr nodes data model.
[gpl/argeo-slc.git] / server / org.argeo.slc.ria / src / argeo-ria-lib / jcr / class / org / argeo / jcr / ria / views / XmlNodeEditor.js
1 qx.Class.define("org.argeo.jcr.ria.views.XmlNodeEditor", {
2 extend : qx.ui.embed.Html,
3 implement : [org.argeo.ria.components.IView],
4
5 properties : {
6 /**
7 * The commands definition Map that will be automatically added and wired to the menubar and toolbar.
8 * See {@link org.argeo.ria.event.CommandsManager#definitions} for the keys to use for defining commands.
9 */
10 commands : {
11 init : {}
12 },
13 viewSelection : {
14 nullable:false,
15 check:"org.argeo.ria.components.ViewSelection"
16 },
17 instanceId : {
18 init:"XmlEditor",
19 event : "changeInstanceId"
20 },
21 instanceLabel : {
22 init:"Xml Editor",
23 event : "changeInstanceLabel"
24 }
25 },
26
27 construct : function(){
28 this.base(arguments);
29 },
30
31 members : {
32 /**
33 * The implementation should contain the GUI initialisation.
34 * This is the role of the manager to actually add the graphical component to the pane,
35 * so it's not necessary to do it here.
36 * @param viewPane {org.argeo.ria.components.ViewPane} The pane manager
37 * @param data {Mixed} Any object or data passed by the initiator of the view
38 * @return {Boolean}
39 */
40 init : function(viewPane, data){
41 this.setViewSelection(new org.argeo.ria.components.ViewSelection(viewPane.getViewId()));
42 this.setHtml("Hello!");
43 },
44 /**
45 * The implementation should contain the real data loading (i.o. query...)
46 * @return {Boolean}
47 */
48 load : function(rootNode){
49 rootNode.load();
50 rootNode.addListener("changeLoadState", function(){
51 var xmlString = rootNode.toXmlString(true);
52 this.setHtml(qx.xml.String.escape(xmlString));
53 }, this);
54 },
55 /**
56 * Whether this component is already contained in a scroller (return false) or not (return true).
57 * @return {Boolean}
58 */
59 addScroll : function(){
60 return true;
61 },
62 /**
63 * Called at destruction time
64 * Perform all the clean operations (stopping polling queries, etc.)
65 */
66 close : function(){
67
68 }
69 }
70
71
72 });