You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2016/04/11 08:52:28 UTC

svn commit: r1738521 - in /myfaces/tobago/branches/tobago-3.0.x/tobago-example: tobago-example-data/src/main/java/org/apache/myfaces/tobago/example/data/ tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/ tobago-example-demo/src/...

Author: lofwyr
Date: Mon Apr 11 06:52:28 2016
New Revision: 1738521

URL: http://svn.apache.org/viewvc?rev=1738521&view=rev
Log:
TOBAGO-1544: Revise Demo Application for Tobago 3.0
[developed by hnoeth]

Added:
    myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/TreeEditorController.java
Removed:
    myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/TreeEditor.java
Modified:
    myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-data/src/main/java/org/apache/myfaces/tobago/example/data/SolarObject.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/ProgressController.java
    myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/010-input/20-suggest/suggest.xhtml
    myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/090-tree/02-editor/tree-editor.xhtml
    myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/tobago-resource/html/standard/standard/property/overview.properties.xml

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-data/src/main/java/org/apache/myfaces/tobago/example/data/SolarObject.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-data/src/main/java/org/apache/myfaces/tobago/example/data/SolarObject.java?rev=1738521&r1=1738520&r2=1738521&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-data/src/main/java/org/apache/myfaces/tobago/example/data/SolarObject.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-data/src/main/java/org/apache/myfaces/tobago/example/data/SolarObject.java Mon Apr 11 06:52:28 2016
@@ -249,25 +249,25 @@ public class SolarObject {
       new SolarObject("Europa", "II", "Jupiter", 671, 3.55, 0.47, 0.01, "Galileo", 1610),
       new SolarObject("Ganymede", "III", "Jupiter", 1070, 7.15, 0.19, 0.00, "Galileo", 1610),
       new SolarObject("Callisto", "IV", "Jupiter", 1883, 16.69, 0.28, 0.01, "Galileo", 1610),
-      new SolarObject("Themisto", "XVIII", "Jupiter", 7507, 0.0, null, null, "Sheppard", 2000),
+      new SolarObject("Themisto", "XVIII", "Jupiter", 7507, 130.02, null, null, "Sheppard", 2000),
       new SolarObject("Leda", "XIII", "Jupiter", 11094, 238.72, 27.00, 0.15, "Kowal", 1974),
       new SolarObject("Himalia", "VI", "Jupiter", 11480, 250.57, 28.00, 0.16, "Perrine", 1904),
       new SolarObject("Lysithea", "X", "Jupiter", 11720, 259.22, 29.00, 0.11, "Nicholson", 1938),
       new SolarObject("Elara", "VII", "Jupiter", 11737, 259.65, 28.00, 0.21, "Perrine", 1905),
-      new SolarObject("Ananke", "XII", "Jupiter", 21200, -631.0, 147.00, 0.17, "Nicholson", 1951),
-      new SolarObject("Carme", "XI", "Jupiter", 22600, -692.0, 163.00, 0.21, "Nicholson", 1938),
-      new SolarObject("Pasiphae", "VIII", "Jupiter", 23500, -735.0, 147.00, 0.38, "Melotte", 1908),
-      new SolarObject("Sinope", "IX", "Jupiter", 23700, -758.0, 153.00, 0.28, "Nicholson", 1914),
-      new SolarObject("Iocaste", "XXIV", "Jupiter", 20216, 0.0, null, null, "Sheppard", 2000),
-      new SolarObject("Harpalyke", "XXII", "Jupiter", 21132, 0.0, null, null, "Sheppard", 2000),
-      new SolarObject("Praxidike", "XXVII", "Jupiter", 20964, 0.0, null, null, "Sheppard", 2000),
-      new SolarObject("Taygete", "XX", "Jupiter", 23312, 0.0, null, null, "Sheppard", 2000),
-      new SolarObject("Chaldene", "XXI", "Jupiter", 23387, 0.0, null, null, "Sheppard", 2000),
-      new SolarObject("Kalyke", "XXIII", "Jupiter", 23745, 0.0, null, null, "Sheppard", 2000),
-      new SolarObject("Callirrhoe", "XVII", "Jupiter", 24100, 0.0, null, null, "Sheppard", 2000),
-      new SolarObject("Megaclite", "XIX", "Jupiter", 23911, 0.0, null, null, "Sheppard", 2000),
-      new SolarObject("Isonoe", "XXVI", "Jupiter", 23078, 0.0, null, null, "Sheppard", 2000),
-      new SolarObject("Erinome", "XXV", "Jupiter", 23168, 0.0, null, null, "Sheppard", 2000),
+      new SolarObject("Ananke", "XII", "Jupiter", 21200, -629.770, 147.00, 0.17, "Nicholson", 1951),
+      new SolarObject("Carme", "XI", "Jupiter", 22600, -702.30, 163.00, 0.21, "Nicholson", 1938),
+      new SolarObject("Pasiphae", "VIII", "Jupiter", 23500, -708.0, 147.00, 0.38, "Melotte", 1908),
+      new SolarObject("Sinope", "IX", "Jupiter", 23700, -758.9, 153.00, 0.28, "Nicholson", 1914),
+      new SolarObject("Iocaste", "XXIV", "Jupiter", 20216, 631.5, null, null, "Sheppard", 2000),
+      new SolarObject("Harpalyke", "XXII", "Jupiter", 21132, 623.3, null, null, "Sheppard", 2000),
+      new SolarObject("Praxidike", "XXVII", "Jupiter", 20964, 625.3, null, null, "Sheppard", 2000),
+      new SolarObject("Taygete", "XX", "Jupiter", 23312, 732.2, null, null, "Sheppard", 2000),
+      new SolarObject("Chaldene", "XXI", "Jupiter", 23387, 723.8, null, null, "Sheppard", 2000),
+      new SolarObject("Kalyke", "XXIII", "Jupiter", 23745, 743.0, null, null, "Sheppard", 2000),
+      new SolarObject("Callirrhoe", "XVII", "Jupiter", 24100, 758.8, null, null, "Sheppard", 2000),
+      new SolarObject("Megaclite", "XIX", "Jupiter", 23911, 752.8, null, null, "Sheppard", 2000),
+      new SolarObject("Isonoe", "XXVI", "Jupiter", 23078, 725.5, null, null, "Sheppard", 2000),
+      new SolarObject("Erinome", "XXV", "Jupiter", 23168, 728.3, null, null, "Sheppard", 2000),
       new SolarObject("Pan", "XVIII", "Saturn", 134, 0.58, 0.00, 0.00, "Showalter", 1990),
       new SolarObject("Atlas", "XV", "Saturn", 138, 0.60, 0.00, 0.00, "Terrile", 1980),
       new SolarObject("Prometheus", "XVI", "Saturn", 139, 0.61, 0.00, 0.00, "Collins", 1980),
@@ -302,11 +302,11 @@ public class SolarObject {
       new SolarObject("Umbriel", "II", "Uranus", 266, 4.14, 0.00, 0.00, "Lassell", 1851),
       new SolarObject("Titania", "III", "Uranus", 436, 8.71, 0.00, 0.00, "Herschel", 1787),
       new SolarObject("Oberon", "IV", "Uranus", 583, 13.46, 0.00, 0.00, "Herschel", 1787),
-      new SolarObject("Caliban", "XVI", "Uranus", 7169, -580., 140., 0.08, "Gladman", 1997),
-      new SolarObject("Stephano", "XX", "Uranus", 7948, -674., 143., 0.24, "Gladman", 1999),
-      new SolarObject("Sycorax", "XVII", "Uranus", 12213, -1289., 153., 0.51, "Nicholson", 1997),
-      new SolarObject("Prospero", "XVIII", "Uranus", 16568, -2019., 152., 0.44, "Holman", 1999),
-      new SolarObject("Setebos", "XIX", "Uranus", 17681, -2239., 158., 0.57, "Kavelaars", 1999),
+      new SolarObject("Caliban", "XVI", "Uranus", 7169, -579.39, 140., 0.08, "Gladman", 1997),
+      new SolarObject("Stephano", "XX", "Uranus", 7948, -677.48, 143., 0.24, "Gladman", 1999),
+      new SolarObject("Sycorax", "XVII", "Uranus", 12213, -1283.48, 153., 0.51, "Nicholson", 1997),
+      new SolarObject("Prospero", "XVIII", "Uranus", 16568, -1962.95, 152., 0.44, "Holman", 1999),
+      new SolarObject("Setebos", "XIX", "Uranus", 17681, -2196.35, 158., 0.57, "Kavelaars", 1999),
       new SolarObject("Naiad", "III", "Neptune", 48, 0.29, 0.00, 0.00, "Voyager 2", 1989),
       new SolarObject("Thalassa", "IV", "Neptune", 50, 0.31, 4.50, 0.00, "Voyager 2", 1989),
       new SolarObject("Despina", "V", "Neptune", 53, 0.33, 0.00, 0.00, "Voyager 2", 1989),

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/ProgressController.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/ProgressController.java?rev=1738521&r1=1738520&r2=1738521&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/ProgressController.java (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/ProgressController.java Mon Apr 11 06:52:28 2016
@@ -22,14 +22,14 @@ package org.apache.myfaces.tobago.exampl
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import javax.enterprise.context.RequestScoped;
+import javax.enterprise.context.SessionScoped;
 import javax.inject.Named;
 import javax.swing.DefaultBoundedRangeModel;
 import java.io.Serializable;
 import java.text.SimpleDateFormat;
 import java.util.Date;
 
-@RequestScoped
+@SessionScoped
 @Named
 public class ProgressController implements Serializable {
 

Added: myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/TreeEditorController.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/TreeEditorController.java?rev=1738521&view=auto
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/TreeEditorController.java (added)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/TreeEditorController.java Mon Apr 11 06:52:28 2016
@@ -0,0 +1,208 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.myfaces.tobago.example.demo;
+
+import org.apache.myfaces.tobago.example.data.CategoryTree;
+import org.apache.myfaces.tobago.example.data.Node;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.enterprise.context.SessionScoped;
+import javax.faces.application.FacesMessage;
+import javax.faces.context.FacesContext;
+import javax.inject.Named;
+import javax.swing.tree.DefaultMutableTreeNode;
+import java.io.Serializable;
+import java.util.Enumeration;
+
+@SessionScoped
+@Named
+public class TreeEditorController implements Serializable {
+
+  private static final Logger LOG = LoggerFactory.getLogger(TreeEditorController.class);
+
+  private DefaultMutableTreeNode categoryTree;
+  private String name;
+  private DefaultMutableTreeNode copyNode;
+  private DefaultMutableTreeNode cutNode;
+
+
+  public TreeEditorController() {
+    this.categoryTree = CategoryTree.createSample();
+  }
+
+  public DefaultMutableTreeNode getCategoryTree() {
+    return categoryTree;
+  }
+
+  public String getName() {
+    return "";
+  }
+
+  public void setName(String name) {
+    this.name = name;
+  }
+
+  public String create() {
+    final DefaultMutableTreeNode node = findFirstSelected();
+    if (node != null) {
+      node.insert(CategoryTree.createNode(name, "id" + System.identityHashCode(name)), 0);
+    }
+    return null;
+  }
+
+  public String delete() {
+    final DefaultMutableTreeNode node = findFirstSelected();
+    if (node != null) {
+      if (node.getParent() != null) {
+        node.removeFromParent();
+      } else {
+        FacesContext.getCurrentInstance().addMessage(null,
+                new FacesMessage(FacesMessage.SEVERITY_INFO, "Root node cannot be removed", null));
+      }
+    }
+    return null;
+  }
+
+  public String rename() {
+    final DefaultMutableTreeNode node = findFirstSelected();
+    if (node != null && node.getUserObject() instanceof Node) {
+      ((Node) node.getUserObject()).setName(name);
+    }
+    return null;
+  }
+
+  public String cut() {
+    copyNode = null;
+    cutNode = findFirstSelected();
+    return null;
+  }
+
+  public String copy() {
+    cutNode = null;
+    copyNode = cloneNode(findFirstSelected());
+    return null;
+  }
+
+  private DefaultMutableTreeNode cloneNode(DefaultMutableTreeNode node) {
+    String nodeName = ((Node) node.getUserObject()).getName();
+    DefaultMutableTreeNode resultNode = new DefaultMutableTreeNode(new Node(nodeName));
+
+    Enumeration children = node.children();
+    while (children.hasMoreElements()) {
+      final DefaultMutableTreeNode child = (DefaultMutableTreeNode) children.nextElement();
+      resultNode.insert(cloneNode(child), resultNode.getChildCount());
+    }
+
+    return resultNode;
+  }
+
+  public String paste() {
+    final DefaultMutableTreeNode node = findFirstSelected();
+    if (cutNode != null) {
+      if (isBaseNodeContainSelectedNode(cutNode, node)) {
+        FacesContext.getCurrentInstance().addMessage(null,
+                new FacesMessage(FacesMessage.SEVERITY_INFO, "Cannot past a cut node into itself.", null));
+      } else {
+        node.insert(cutNode, 0);
+        cutNode = null;
+      }
+    } else if (copyNode != null) {
+      node.insert(copyNode, 0);
+      copyNode = null;
+      deselectAllNodes(categoryTree);
+    }
+    return null;
+  }
+
+  private boolean isBaseNodeContainSelectedNode(DefaultMutableTreeNode base, DefaultMutableTreeNode selected) {
+    if (base.equals(selected)) {
+      return true;
+    }
+    Enumeration children = base.children();
+    while (children.hasMoreElements()) {
+      final DefaultMutableTreeNode baseChild = (DefaultMutableTreeNode) children.nextElement();
+
+      if (isBaseNodeContainSelectedNode(baseChild, selected)) {
+        return true;
+      }
+    }
+
+    return false;
+  }
+
+  private void deselectAllNodes(DefaultMutableTreeNode node) {
+    ((Node) node.getUserObject()).setSelected(false);
+
+    Enumeration children = node.children();
+    while (children.hasMoreElements()) {
+      final DefaultMutableTreeNode child = (DefaultMutableTreeNode) children.nextElement();
+      deselectAllNodes(child);
+    }
+  }
+
+  public String moveUp() {
+    final DefaultMutableTreeNode node = findFirstSelected();
+    if (node != null) {
+      DefaultMutableTreeNode previousSibling = node.getPreviousSibling();
+      if (previousSibling != null) {
+        DefaultMutableTreeNode parent = (DefaultMutableTreeNode) node.getParent();
+        parent.insert(node, parent.getIndex(previousSibling));
+      } else {
+        FacesContext.getCurrentInstance().addMessage(null,
+                new FacesMessage(FacesMessage.SEVERITY_INFO, "The node cannot moved up further.", null));
+      }
+    }
+    return null;
+  }
+
+  public String moveDown() {
+    final DefaultMutableTreeNode node = findFirstSelected();
+    if (node != null) {
+      DefaultMutableTreeNode nextSibling = node.getNextSibling();
+      if (nextSibling != null) {
+        DefaultMutableTreeNode parent = (DefaultMutableTreeNode) node.getParent();
+        parent.insert(node, parent.getIndex(nextSibling));
+      } else {
+        FacesContext.getCurrentInstance().addMessage(null,
+                new FacesMessage(FacesMessage.SEVERITY_INFO, "The node cannot moved down further.", null));
+      }
+    }
+    return null;
+  }
+
+  public String reset() {
+    categoryTree = CategoryTree.createSample();
+    cutNode = null;
+    copyNode = null;
+    return null;
+  }
+
+  private DefaultMutableTreeNode findFirstSelected() {
+    final Enumeration enumeration = categoryTree.depthFirstEnumeration();
+    while (enumeration.hasMoreElements()) {
+      final DefaultMutableTreeNode node = (DefaultMutableTreeNode) enumeration.nextElement();
+      if (((Node) node.getUserObject()).isSelected()) {
+        return node;
+      }
+    }
+    return null;
+  }
+}

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/010-input/20-suggest/suggest.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/010-input/20-suggest/suggest.xhtml?rev=1738521&r1=1738520&r2=1738521&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/010-input/20-suggest/suggest.xhtml (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/010-input/20-suggest/suggest.xhtml Mon Apr 11 06:52:28 2016
@@ -18,12 +18,53 @@
 -->
 
 <ui:composition template="/main.xhtml"
+                xmlns="http://www.w3.org/1999/xhtml"
                 xmlns:tc="http://myfaces.apache.org/tobago/component"
-                xmlns:ui="http://java.sun.com/jsf/facelets"
-                xmlns:f="http://java.sun.com/jsf/core">
-    <ui:param name="title" value="#{overviewBundle.suggest} &lt;tc:suggest&gt;"/>
-    <p>The suggest-tag is used within the <code>&lt;tc:in&gt;</code> tag.</p>
-    <tc:in id="i1" label="Language" placeholder="Select Language" value="#{overviewController.suggestInput}">
-        <tc:suggest id="s1" suggestMethod="#{overviewController.getInputSuggestItems}" delay="300" minimumCharacters="1" maximumItems="10"/>
+                xmlns:ui="http://java.sun.com/jsf/facelets">
+  <ui:param name="title" value="#{overviewBundle.suggest} &lt;tc:suggest&gt;"/>
+  <p>A <code class="language-markup">&lt;tc:suggest/></code> tag can be added to an inputfield to make
+    suggestions based on the already entered text.</p>
+  <p>Tag Library Documentation:
+    <tc:link label="&lt;tc:suggest/>" image="image/feather-leaf.png"
+             link="#{overviewBundle.tagDocUrl}/suggest.html"/>
+    |
+    <tc:link label="&lt;tc:in/>" image="image/feather-leaf.png" link="#{overviewBundle.tagDocUrl}/in.html"/></p>
+
+  <tc:section label="Basics">
+    <p>Select a language, after you type a character in the textfield, a list of suggestions is shown.</p>
+        <pre><code class="language-markup">&lt;tc:in id="i1" label="Language" value="\#{suggestController.suggestInput}">
+    &lt;tc:suggest suggestMethod="\#{suggestController.getInputSuggestItems}"/>
+&lt;/tc:in></code></pre>
+    <tc:in id="i1" label="Language" value="#{suggestController.suggestInput}">
+      <tc:suggest suggestMethod="#{suggestController.getInputSuggestItems}"/>
+    </tc:in>
+  </tc:section>
+
+  <tc:section label="Advanced">
+    <p>This example differs in a few points from the one in the 'Basics' section.
+      There are only two suggestions shown to the user, because the
+      <code>maximumItems</code> attribute is set to '2'.
+      Also you need to type two characters before suggestions are made,
+      because of the <code>minimumCharacters</code> attribute which has the value '2'.
+      And by setting the <code>delay</code> to '2000', the user have to wait two seconds,
+      before the suggestionlist is show.</p>
+        <pre><code class="language-markup">&lt;tc:suggest suggestMethod="\#{suggestController.getInputSuggestItems}"
+  maximumItems="2" minimumCharacters="2" delay="2000"/></code></pre>
+    <tc:in id="i2" label="Language" value="#{suggestController.suggestInput}">
+      <tc:suggest suggestMethod="#{suggestController.getInputSuggestItems}"
+                  maximumItems="2" minimumCharacters="2" delay="2000"/>
+    </tc:in>
+  </tc:section>
+
+  <tc:section label="Client sided">
+    <p>For optimization, the filtering can be done by the client.
+      For that, <code>update</code> must be 'false' and <code>minimumCharacters</code> have to be '0'.
+      If client sided filtering is activated, the <code>filter</code> attribute has an effect.</p>
+    <pre><code class="language-markup">&lt;tc:suggest suggestMethod="\#{suggestController.getCountryLanguageList}"
+  update="false" minimumCharacters="0" filter="prefix"/></code></pre>
+    <tc:in id="i3" label="Language" value="#{suggestController.suggestInput}">
+      <tc:suggest suggestMethod="#{suggestController.getCountryLanguageList}"
+                  update="false" minimumCharacters="0" filter="prefix"/>
     </tc:in>
+  </tc:section>
 </ui:composition>

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/090-tree/02-editor/tree-editor.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/090-tree/02-editor/tree-editor.xhtml?rev=1738521&r1=1738520&r2=1738521&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/090-tree/02-editor/tree-editor.xhtml (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/content/20-component/090-tree/02-editor/tree-editor.xhtml Mon Apr 11 06:52:28 2016
@@ -18,51 +18,66 @@
 -->
 
 <ui:composition template="/main.xhtml"
+                xmlns="http://www.w3.org/1999/xhtml"
                 xmlns:tc="http://myfaces.apache.org/tobago/component"
-                xmlns:ui="http://java.sun.com/jsf/facelets">
-
-  <ui:param name="title" value="Tree - Editor"/>
-
-  This is a sample for an editable tree. (Not all functions are implemented).
-  Try to select a node an click "New" or "Delete")
+                xmlns:ui="http://java.sun.com/jsf/facelets"
+                xmlns:f="http://java.sun.com/jsf/core">
+  <ui:param name="title" value="#{overviewBundle.tree_editor}"/>
+  <p>This is an example, to show how to edit a tree.</p>
+
+  <tc:button label="New">
+    <f:facet name="popup">
+      <tc:popup id="createPopup">
+        <tc:box label="New">
+          <tc:in label="New Name" value="#{treeEditorController.name}"/>
+          <tc:button label="OK" action="#{treeEditorController.create}">
+            <tc:attribute name="popupClose" value="afterSubmit"/>
+          </tc:button>
+          <tc:button label="Cancel">
+            <tc:attribute name="popupClose" value="immediate"/>
+          </tc:button>
+        </tc:box>
+      </tc:popup>
+    </f:facet>
+  </tc:button>
+  <tc:button label="Rename">
+    <f:facet name="popup">
+      <tc:popup id="renamePopup">
+        <tc:box label="Rename">
+          <tc:in label="New Name" value="#{treeEditorController.name}"/>
+          <tc:button label="OK" action="#{treeEditorController.rename}">
+            <tc:attribute name="popupClose" value="afterSubmit"/>
+          </tc:button>
+          <tc:button label="Cancel">
+            <tc:attribute name="popupClose" value="immediate"/>
+          </tc:button>
+        </tc:box>
+      </tc:popup>
+    </f:facet>
+  </tc:button>
 
+  <p>Currently, the buttons 'New' and 'Rename' doesn't work in the toolbar. Use the alternative buttons above.</p>
   <tc:toolBar>
-    <tc:toolBarCommand label="New" action="#{treeEditor.create}" image="fa-file-o"/>
-    <tc:toolBarCommand label="Delete" action="#{treeEditor.delete}" image="fa-trash-o"/>
-    <tc:toolBarCommand label="Edit" omit="true" image="fa-edit">
-      <tc:dataAttribute name="alert-text" value="Not implemented yet"/>
-    </tc:toolBarCommand>
-    <tc:toolBarCommand label="Cut" omit="true" image="fa-cut">
-      <tc:dataAttribute name="alert-text" value="Not implemented yet"/>
-    </tc:toolBarCommand>
-    <tc:toolBarCommand label="Copy" omit="true" image="fa-copy">
+    <tc:toolBarCommand label="New" omit="true" image="fa-file-o">
       <tc:dataAttribute name="alert-text" value="Not implemented yet"/>
     </tc:toolBarCommand>
-    <tc:toolBarCommand label="Paste" omit="true" image="fa-paste">
-      <tc:dataAttribute name="alert-text" value="Not implemented yet"/>
-    </tc:toolBarCommand>
-    <tc:toolBarCommand label="Up" omit="true" image="fa-level-up">
-      <tc:dataAttribute name="alert-text" value="Not implemented yet"/>
-    </tc:toolBarCommand>
-    <tc:toolBarCommand label="Down" omit="true" image="fa-level-down">
+    <tc:toolBarCommand label="Delete" image="fa-trash-o" action="#{treeEditorController.delete}"/>
+    <tc:toolBarCommand label="Rename" omit="true" image="fa-edit">
       <tc:dataAttribute name="alert-text" value="Not implemented yet"/>
     </tc:toolBarCommand>
+    <tc:toolBarCommand label="Cut" action="#{treeEditorController.cut}" image="fa-cut"/>
+    <tc:toolBarCommand label="Copy" action="#{treeEditorController.copy}" image="fa-copy"/>
+    <tc:toolBarCommand label="Paste" action="#{treeEditorController.paste}" image="fa-paste"/>
+    <tc:toolBarCommand label="Up" action="#{treeEditorController.moveUp}" image="fa-level-up"/>
+    <tc:toolBarCommand label="Down" action="#{treeEditorController.moveDown}" image="fa-level-down"/>
+    <tc:toolBarCommand label="Reset" action="#{treeEditorController.reset}" image="fa-undo"/>
   </tc:toolBar>
 
-  <tc:tree id="tree"
-           showRootJunction="true"
-           showRoot="true"
-           value="#{treeEditor.categoryTree}"
-           var="node"
-           selectable="single">
-    <tc:treeNode id="template"
-                 markup="#{node.userObject.markup}"
-                 tip="#{node.userObject.tip}"
-                 disabled="#{node.userObject.disabled}">
+  <tc:tree value="#{treeEditorController.categoryTree}" var="node"
+           showRoot="true" showRootJunction="true" selectable="single">
+    <tc:treeNode>
       <tc:treeIndent showJunctions="true"/>
-      <tc:treeIcon value="image/feather.png"/>
-      <tc:treeSelect value="#{node.userObject.selected}" label="#{node.userObject.name}"/>
+      <tc:treeSelect label="#{node.userObject.name}" value="#{node.userObject.selected}"/>
     </tc:treeNode>
   </tc:tree>
-
 </ui:composition>

Modified: myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/tobago-resource/html/standard/standard/property/overview.properties.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/tobago-resource/html/standard/standard/property/overview.properties.xml?rev=1738521&r1=1738520&r2=1738521&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/tobago-resource/html/standard/standard/property/overview.properties.xml (original)
+++ myfaces/tobago/branches/tobago-3.0.x/tobago-example/tobago-example-demo/src/main/webapp/tobago-resource/html/standard/standard/property/overview.properties.xml Mon Apr 11 06:52:28 2016
@@ -72,15 +72,17 @@
   <entry key="tab_client">Client sided</entry>
   <entry key="tab_ajax">Ajax</entry>
   <entry key="tab_server">Server sided</entry>
+  <entry key="sheet">Sheet Control</entry>
+  <entry key="sheet_master_detail">Column Event</entry>
   <entry key="tree">Tree Control</entry>
   <entry key="tree_command_types">Command</entry>
   <entry key="tree_select">Select</entry>
+  <entry key="tree_editor">Tree Editor</entry>
   <entry key="tree_menu">Tree Menu</entry>
   <entry key="tree_listbox">Tree List</entry>
   <entry key="upload">File Upload</entry>
 
 
-  <entry key="sheet">Sheet Control</entry>
   <entry key="tree-editor">Editor</entry>
   <entry key="tree-command-types">Command Types</entry>
   <entry key="validation">Validation</entry>