3 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
4 <title>qooxdoo » Demo</title>
5 <link type="text/css" rel="stylesheet" href="../../resource/css/layout.css"/>
7 <link type="text/css" rel="stylesheet" href="../../resource/css/layout_ie.css"/>
9 <script type="text/javascript" src="../../script/qx.js"></script>
12 <script type="text/javascript" src="../../script/layout.js"></script>
14 <div id="demoDescription">
15 <p>Shows a tree and allows playing with the settings of the Tree
16 properties <i>hideNode</i> and <i>rootOpenClose</i>. Also demonstrates
17 manipulating display (or not) of tree lines at specific indentation
18 levels, using the <i>excludeSpecificTreeLines</i> property.</p>
22 <script type="text/javascript">
23 qx.core.Init.getInstance().defineMain(function()
25 var trs = qx.ui.treefullcontrol.TreeRowStructure.getInstance().standard("Root");
26 var t = new qx.ui.treefullcontrol.Tree(trs);
30 setBackgroundColor(255);
31 setBorder(qx.renderer.border.BorderPresets.getInstance().inset);
32 setOverflow("scrollY");
41 qx.ui.core.ClientDocument.getInstance().add(t);
42 // One icon for selected and one for unselected states
43 trs = qx.ui.treefullcontrol.TreeRowStructure.getInstance().standard("Desktop", "icon/16/desktop.png", "icon/16/dictionary.png");
44 var te1 = new qx.ui.treefullcontrol.TreeFolder(trs);
49 trs = qx.ui.treefullcontrol.TreeRowStructure.getInstance().standard("Files");
50 var te1_1 = new qx.ui.treefullcontrol.TreeFolder(trs);
51 trs = qx.ui.treefullcontrol.TreeRowStructure.getInstance().standard("Workspace");
52 var te1_2 = new qx.ui.treefullcontrol.TreeFolder(trs);
53 trs = qx.ui.treefullcontrol.TreeRowStructure.getInstance().standard("Network");
54 var te1_3 = new qx.ui.treefullcontrol.TreeFolder(trs);
55 trs = qx.ui.treefullcontrol.TreeRowStructure.getInstance().standard("Trash");
56 var te1_4 = new qx.ui.treefullcontrol.TreeFolder(trs);
58 te1.add(te1_1, te1_2, te1_3, te1_4);
60 // One icon specified, and used for both selected unselected states
61 trs = qx.ui.treefullcontrol.TreeRowStructure.getInstance().standard("Windows (C:)", "icon/16/harddrive.png");
62 var te1_2_1 = new qx.ui.treefullcontrol.TreeFile(trs);
63 trs = qx.ui.treefullcontrol.TreeRowStructure.getInstance().standard("Documents (D:)", "icon/16/harddrive.png");
64 var te1_2_2 = new qx.ui.treefullcontrol.TreeFile(trs);
66 te1_2.add(te1_2_1, te1_2_2);
71 trs = qx.ui.treefullcontrol.TreeRowStructure.getInstance().standard("Inbox");
72 var te2 = new qx.ui.treefullcontrol.TreeFolder(trs);
75 trs = qx.ui.treefullcontrol.TreeRowStructure.getInstance().standard("Presets");
76 var te2_1 = new qx.ui.treefullcontrol.TreeFolder(trs);
77 trs = qx.ui.treefullcontrol.TreeRowStructure.getInstance().standard("Sent");
78 var te2_2 = new qx.ui.treefullcontrol.TreeFolder(trs);
79 trs = qx.ui.treefullcontrol.TreeRowStructure.getInstance().standard("Trash", "icon/16/trash.png");
80 var te2_3 = new qx.ui.treefullcontrol.TreeFolder(trs);
81 trs = qx.ui.treefullcontrol.TreeRowStructure.getInstance().standard("Data");
82 var te2_4 = new qx.ui.treefullcontrol.TreeFolder(trs);
83 trs = qx.ui.treefullcontrol.TreeRowStructure.getInstance().standard("Edit");
84 var te2_5 = new qx.ui.treefullcontrol.TreeFolder(trs);
88 trs = qx.ui.treefullcontrol.TreeRowStructure.getInstance().standard("Chat");
89 var te2_5_1 = new qx.ui.treefullcontrol.TreeFolder(trs);
90 trs = qx.ui.treefullcontrol.TreeRowStructure.getInstance().standard("Pustefix");
91 var te2_5_2 = new qx.ui.treefullcontrol.TreeFolder(trs);
92 trs = qx.ui.treefullcontrol.TreeRowStructure.getInstance().standard("TINC");
93 var te2_5_3 = new qx.ui.treefullcontrol.TreeFolder(trs);
95 trs = qx.ui.treefullcontrol.TreeRowStructure.getInstance().standard("Announce");
96 var te2_5_3_1 = new qx.ui.treefullcontrol.TreeFolder(trs);
97 trs = qx.ui.treefullcontrol.TreeRowStructure.getInstance().standard("Devel");
98 var te2_5_3_2 = new qx.ui.treefullcontrol.TreeFolder(trs);
100 te2_5_3.add(te2_5_3_1, te2_5_3_2);
102 te2_5.add(te2_5_1, te2_5_2, te2_5_3);
104 trs = qx.ui.treefullcontrol.TreeRowStructure.getInstance().standard("Lists");
105 var te2_6 = new qx.ui.treefullcontrol.TreeFolder(trs);
107 trs = qx.ui.treefullcontrol.TreeRowStructure.getInstance().standard("Relations");
108 var te2_6_1 = new qx.ui.treefullcontrol.TreeFolder(trs);
109 trs = qx.ui.treefullcontrol.TreeRowStructure.getInstance().standard("Company");
110 var te2_6_2 = new qx.ui.treefullcontrol.TreeFolder(trs);
111 trs = qx.ui.treefullcontrol.TreeRowStructure.getInstance().standard("Questions");
112 var te2_6_3 = new qx.ui.treefullcontrol.TreeFolder(trs);
113 trs = qx.ui.treefullcontrol.TreeRowStructure.getInstance().standard("Internal");
114 var te2_6_4 = new qx.ui.treefullcontrol.TreeFolder(trs);
115 trs = qx.ui.treefullcontrol.TreeRowStructure.getInstance().standard("Products");
116 var te2_6_5 = new qx.ui.treefullcontrol.TreeFolder(trs);
117 trs = qx.ui.treefullcontrol.TreeRowStructure.getInstance().standard("Press");
118 var te2_6_6 = new qx.ui.treefullcontrol.TreeFolder(trs);
119 trs = qx.ui.treefullcontrol.TreeRowStructure.getInstance().standard("Development");
120 var te2_6_7 = new qx.ui.treefullcontrol.TreeFolder(trs);
121 trs = qx.ui.treefullcontrol.TreeRowStructure.getInstance().standard("Competition");
122 var te2_6_8 = new qx.ui.treefullcontrol.TreeFolder(trs);
124 te2_6.add(te2_6_1, te2_6_2, te2_6_3, te2_6_4, te2_6_5, te2_6_6, te2_6_7, te2_6_8);
126 trs = qx.ui.treefullcontrol.TreeRowStructure.getInstance().standard("Personal");
127 var te2_7 = new qx.ui.treefullcontrol.TreeFolder(trs);
129 trs = qx.ui.treefullcontrol.TreeRowStructure.getInstance().standard("Bugs");
130 var te2_7_1 = new qx.ui.treefullcontrol.TreeFolder(trs);
131 trs = qx.ui.treefullcontrol.TreeRowStructure.getInstance().standard("Family");
132 var te2_7_2 = new qx.ui.treefullcontrol.TreeFolder(trs);
133 trs = qx.ui.treefullcontrol.TreeRowStructure.getInstance().standard("Projects");
134 var te2_7_3 = new qx.ui.treefullcontrol.TreeFolder(trs);
135 trs = qx.ui.treefullcontrol.TreeRowStructure.getInstance().standard("Holiday");
136 var te2_7_4 = new qx.ui.treefullcontrol.TreeFolder(trs);
138 te2_7.add(te2_7_1, te2_7_2, te2_7_3, te2_7_4);
140 trs = qx.ui.treefullcontrol.TreeRowStructure.getInstance().standard("Big");
141 var te2_8 = new qx.ui.treefullcontrol.TreeFolder(trs);
143 for (var i=0;i<50; i++) {
144 trs = qx.ui.treefullcontrol.TreeRowStructure.getInstance().standard("Item " + i);
145 te2_8.add(new qx.ui.treefullcontrol.TreeFolder(trs));
148 trs = qx.ui.treefullcontrol.TreeRowStructure.getInstance().standard("Spam");
149 var te2_9 = new qx.ui.treefullcontrol.TreeFolder(trs);
152 te2.add(te2_1, te2_2, te2_3, te2_4, te2_5, te2_6, te2_7, te2_8, te2_9);
155 qx.ui.core.ClientDocument.getInstance().add(t);
162 var commandFrame = new qx.ui.groupbox.GroupBox("Control");
173 qx.ui.core.ClientDocument.getInstance().add(commandFrame);
178 var tCurrentLabel = new qx.ui.basic.Atom("Current Folder: ");
186 commandFrame.add(tCurrentLabel);
190 var tCurrentInput = new qx.ui.form.TextField;
201 commandFrame.add(tCurrentInput);
203 t.getManager().addEventListener("changeSelection", function(e) {
204 tCurrentInput.setValue(e.getData()[0]._labelObject.getHtml());
209 var tDoubleClick = new qx.ui.form.CheckBox("Use double click?");
216 commandFrame.add(tDoubleClick);
218 tDoubleClick.addEventListener("changeChecked", function(e) { t.setUseDoubleClick(e.getData()); });
223 var tTreeLines = new qx.ui.form.CheckBox("Use tree lines?");
231 commandFrame.add(tTreeLines);
233 tTreeLines.addEventListener("changeChecked", function(e) { t.setUseTreeLines(e.getData()); });
236 var tHideNode = new qx.ui.form.CheckBox("Hide the root node?");
244 commandFrame.add(tHideNode);
246 tHideNode.addEventListener("changeChecked", function(e) { t.setHideNode(e.getData()); });
248 var tIncludeRootOpenClose =
249 new qx.ui.form.CheckBox("Include root open/close button?");
251 with(tIncludeRootOpenClose) {
257 commandFrame.add(tIncludeRootOpenClose);
259 tIncludeRootOpenClose.addEventListener("changeChecked", function(e) { t.setRootOpenClose(e.getData()); });
262 new qx.ui.form.CheckBox("Exclude tree lines at level 0?");
264 with(tExcludeTreeLines0) {
270 commandFrame.add(tExcludeTreeLines0);
272 tExcludeTreeLines0.addEventListener(
276 var excl = t.getExcludeSpecificTreeLines();
282 t.setExcludeSpecificTreeLines(excl);
286 new qx.ui.form.CheckBox("Exclude tree lines at level 1?");
288 with(tExcludeTreeLines1) {
294 commandFrame.add(tExcludeTreeLines1);
296 tExcludeTreeLines1.addEventListener(
300 var excl = t.getExcludeSpecificTreeLines();
306 t.setExcludeSpecificTreeLines(excl);
310 new qx.ui.form.CheckBox("Exclude tree lines at level 2?");
312 with(tExcludeTreeLines2) {
318 commandFrame.add(tExcludeTreeLines2);
320 tExcludeTreeLines2.addEventListener(
324 var excl = t.getExcludeSpecificTreeLines();
330 t.setExcludeSpecificTreeLines(excl);
334 new qx.ui.form.CheckBox("Exclude tree lines at level 3?");
336 with(tExcludeTreeLines3) {
342 commandFrame.add(tExcludeTreeLines3);
344 tExcludeTreeLines3.addEventListener(
348 var excl = t.getExcludeSpecificTreeLines();
354 t.setExcludeSpecificTreeLines(excl);
358 new qx.ui.form.CheckBox("Exclude tree lines at level 4?");
360 with(tExcludeTreeLines4) {
366 commandFrame.add(tExcludeTreeLines4);
368 tExcludeTreeLines4.addEventListener(
372 var excl = t.getExcludeSpecificTreeLines();
378 t.setExcludeSpecificTreeLines(excl);