diff options
Diffstat (limited to 'swat.obsolete/apps/qooxdoo-examples/test/Tree_2.html')
-rw-r--r-- | swat.obsolete/apps/qooxdoo-examples/test/Tree_2.html | 294 |
1 files changed, 294 insertions, 0 deletions
diff --git a/swat.obsolete/apps/qooxdoo-examples/test/Tree_2.html b/swat.obsolete/apps/qooxdoo-examples/test/Tree_2.html new file mode 100644 index 0000000000..8775c9a9c1 --- /dev/null +++ b/swat.obsolete/apps/qooxdoo-examples/test/Tree_2.html @@ -0,0 +1,294 @@ +<html> +<head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + <title>qooxdoo » Demo</title> + <link type="text/css" rel="stylesheet" href="../../resource/css/layout.css"/> + <!--[if IE]> + <link type="text/css" rel="stylesheet" href="../../resource/css/layout_ie.css"/> + <![endif]--> + <script type="text/javascript" src="../../script/qx.js"></script> +</head> +<body> + <script type="text/javascript" src="../../script/layout.js"></script> + + <div id="demoDescription"> + <p>This example is bigger than the previous one.</p> + </div> + + <div id="control" style="display:none"> + <p> + <strong>Create</strong>: + <br/> + Push into: + <a href="javascript://" onclick="void(root.add(new qx.ui.tree.TreeFile('Foo Bar')))">Root</a> + <a href="javascript://" onclick="void(inbox.add(new qx.ui.tree.TreeFile('Foo Bar')))">Inbox</a> + <a href="javascript://" onclick="void(workspace.add(new qx.ui.tree.TreeFile('Foo Bar')))">Workspace</a> + <a href="javascript://" onclick="void(desktop.add(new qx.ui.tree.TreeFile('Foo Bar')))">Desktop</a> + <a href="javascript://" onclick="void(edit.add(new qx.ui.tree.TreeFile('Foo Bar')))">Edit</a> + <a href="javascript://" onclick="void(spam.add(new qx.ui.tree.TreeFile('Foo Bar')))">Spam</a> + </p> + + <hr/> + + <p> + <strong>Inbox</strong>: + <a href="javascript://" onclick="void(inbox.getParent().remove(inbox))">Delete</a> + <br/> + Push into: + <a href="javascript://" onclick="void(root.add(inbox))">Root</a> + <a href="javascript://" onclick="void(workspace.add(inbox))">Workspace</a> + <a href="javascript://" onclick="void(desktop.add(inbox))">Desktop</a> + <a href="javascript://" onclick="void(edit.add(inbox))">Edit</a> + <a href="javascript://" onclick="void(spam.add(inbox))">Spam</a> + </p> + + <p> + <strong>Workspace</strong>: + <a href="javascript://" onclick="void(workspace.getParent().remove(workspace))">Delete</a> + <br/> + Push into: + <a href="javascript://" onclick="void(root.add(workspace))">Root</a> + <a href="javascript://" onclick="void(inbox.add(workspace))">Inbox</a> + <a href="javascript://" onclick="void(desktop.add(workspace))">Desktop</a> + <a href="javascript://" onclick="void(edit.add(workspace))">Edit</a> + <a href="javascript://" onclick="void(spam.add(workspace))">Spam</a> + <br/> + Push into before: + <a href="javascript://" onclick="void(root.addBefore(workspace, desktop))">Root (before:Desktop)</a> + <a href="javascript://" onclick="void(root.addBefore(workspace, inbox))">Root (before:Inbox)</a> + <a href="javascript://" onclick="void(inbox.addBefore(workspace, spam))">Inbox (before:Spam)</a> + <a href="javascript://" onclick="void(inbox.addBefore(workspace, edit))">Inbox (before:Edit)</a> + <br/> + Push into after: + <a href="javascript://" onclick="void(root.addAfter(workspace, desktop))">Root (after:Desktop)</a> + <a href="javascript://" onclick="void(root.addAfter(workspace, inbox))">Root (after:Inbox)</a> + <a href="javascript://" onclick="void(inbox.addAfter(workspace, spam))">Inbox (after:Spam)</a> + <a href="javascript://" onclick="void(inbox.addAfter(workspace, edit))">Inbox (after:Edit)</a> + <br/> + Add at: + <a href="javascript://" onclick="void(root.addAt(workspace, 0))">Root (at:0)</a> + <a href="javascript://" onclick="void(root.addAt(workspace, 1))">Root (at:1)</a> + <a href="javascript://" onclick="void(root.addAt(workspace, 2))">Root (at:2)</a> + <a href="javascript://" onclick="void(inbox.addAt(workspace, 0))">Inbox (at:0)</a> + <a href="javascript://" onclick="void(inbox.addAt(workspace, 3))">Inbox (at:3)</a> + <a href="javascript://" onclick="void(inbox.addAt(workspace, 5))">Inbox (at:5)</a> + </p> + </div> + + <script type="text/javascript"> + var desktop, workspace, root, inbox, edit, spam; + + qx.core.Init.getInstance().defineMain(function() + { + var t = new qx.ui.tree.Tree("Root"); + + with(t) + { + setBackgroundColor(255); + setBorder(qx.renderer.border.BorderPresets.getInstance().inset); + setOverflow("scrollY"); + + setHeight(null); + setTop(48); + setLeft(20); + setWidth(200); + setBottom(48); + }; + + root = t; + + qx.ui.core.ClientDocument.getInstance().add(t); + + var te1 = new qx.ui.tree.TreeFolder("Desktop"); + t.add(te1); + + desktop = te1; + + var te1_1 = new qx.ui.tree.TreeFolder("Files"); + var te1_2 = new qx.ui.tree.TreeFolder("Workspace"); + var te1_3 = new qx.ui.tree.TreeFolder("Network"); + var te1_4 = new qx.ui.tree.TreeFolder("Trash"); + + te1.add(te1_1, te1_2, te1_3, te1_4); + + + var te1_2_1 = new qx.ui.tree.TreeFile("Windows (C:)"); + var te1_2_2 = new qx.ui.tree.TreeFile("Documents (D:)"); + + te1_2.add(te1_2_1, te1_2_2); + + workspace = te1_2; + + + var te2 = new qx.ui.tree.TreeFolder("Inbox"); + inbox = te2; + + var te2_1 = new qx.ui.tree.TreeFolder("Presets"); + var te2_2 = new qx.ui.tree.TreeFolder("Sent"); + var te2_3 = new qx.ui.tree.TreeFolder("Trash"); + var te2_4 = new qx.ui.tree.TreeFolder("Data"); + var te2_5 = new qx.ui.tree.TreeFolder("Edit"); + + edit = te2_5; + + var te2_5_1 = new qx.ui.tree.TreeFolder("Chat"); + var te2_5_2 = new qx.ui.tree.TreeFolder("Pustefix"); + var te2_5_3 = new qx.ui.tree.TreeFolder("TINC"); + + var te2_5_3_1 = new qx.ui.tree.TreeFolder("Announce"); + var te2_5_3_2 = new qx.ui.tree.TreeFolder("Devel"); + + te2_5_3.add(te2_5_3_1, te2_5_3_2); + + te2_5.add(te2_5_1, te2_5_2, te2_5_3); + + var te2_6 = new qx.ui.tree.TreeFolder("Lists"); + + var te2_6_1 = new qx.ui.tree.TreeFolder("Relations"); + var te2_6_2 = new qx.ui.tree.TreeFolder("Company"); + var te2_6_3 = new qx.ui.tree.TreeFolder("Questions"); + var te2_6_4 = new qx.ui.tree.TreeFolder("Internal"); + var te2_6_5 = new qx.ui.tree.TreeFolder("Products"); + var te2_6_6 = new qx.ui.tree.TreeFolder("Press"); + var te2_6_7 = new qx.ui.tree.TreeFolder("Development"); + var te2_6_8 = new qx.ui.tree.TreeFolder("Competition"); + + 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); + + var te2_7 = new qx.ui.tree.TreeFolder("Personal"); + + var te2_7_1 = new qx.ui.tree.TreeFolder("Bugs"); + var te2_7_2 = new qx.ui.tree.TreeFolder("Family"); + var te2_7_3 = new qx.ui.tree.TreeFolder("Projects"); + var te2_7_4 = new qx.ui.tree.TreeFolder("Holiday"); + + te2_7.add(te2_7_1, te2_7_2, te2_7_3, te2_7_4); + + var te2_8 = new qx.ui.tree.TreeFolder("Big"); + + for (var i=0;i<10; i++) { + te2_8.add(new qx.ui.tree.TreeFolder("Item " + i)); + }; + + var te2_9 = new qx.ui.tree.TreeFolder("Spam"); + spam = te2_9; + + te2.add(te2_1, te2_2, te2_3, te2_4, te2_5, te2_6, te2_7, te2_8, te2_9); + + t.add(te2); + qx.ui.core.ClientDocument.getInstance().add(t); + + + + + + + var commandFrame = new qx.ui.groupbox.GroupBox("Control"); + + with(commandFrame) + { + setTop(48); + setLeft(250); + + setWidth("auto"); + setHeight("auto"); + }; + + qx.ui.core.ClientDocument.getInstance().add(commandFrame); + + + + + var tCurrentLabel = new qx.ui.basic.Atom("Current Folder: "); + + with(tCurrentLabel) + { + setLeft(0); + setTop(0); + }; + + commandFrame.add(tCurrentLabel); + + + + var tCurrentInput = new qx.ui.form.TextField; + + with(tCurrentInput) + { + setLeft(0); + setRight(0); + setTop(20); + + setReadOnly(true); + }; + + commandFrame.add(tCurrentInput); + + t.getManager().addEventListener("changeSelection", function(e) { + tCurrentInput.setValue(e.getData()[0]._labelObject.getHtml()); + }); + + + + var tDoubleClick = new qx.ui.form.CheckBox("Use double click?"); + + with(tDoubleClick) { + setTop(60); + setLeft(0); + }; + + commandFrame.add(tDoubleClick); + + tDoubleClick.addEventListener("changeChecked", function(e) { t.setUseDoubleClick(e.getData()); }); + + + + + + var tTreeLines = new qx.ui.form.CheckBox("Use tree lines?"); + + with(tTreeLines) { + setTop(80); + setLeft(0); + setChecked(true); + }; + + commandFrame.add(tTreeLines); + + tTreeLines.addEventListener("changeChecked", function(e) { t.setUseTreeLines(e.getData()); }); + + + + + + + + + + + var ct1 = new qx.ui.basic.Label(document.getElementById("control").innerHTML); + + with(ct1) + { + setWidth(300); + setRight(335); + + setHeight(null); + setTop(48); + setBottom(48); + + setOverflow("hidden"); + setStyleProperty("whiteSpace", "normal"); + + setBackgroundColor("white"); + setBorder(qx.renderer.border.BorderPresets.getInstance().groove); + setPadding(10); + }; + + qx.ui.core.ClientDocument.getInstance().add(ct1); + + + }); + </script> +</body> +</html> |