myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mat...@apache.org
Subject cvs commit: incubator-myfaces/conf faces-config.xml
Date Fri, 11 Mar 2005 08:38:46 GMT
matzew      2005/03/11 00:38:46

  Modified:    tlds     myfaces_ext.tld
               webapps/examples/src/org/apache/myfaces/examples/tree
                        TreeBacker.java
               conf     faces-config.xml
  Log:
  Patch for tree2 form Sean Schofield
  
  Revision  Changes    Path
  1.175     +56 -0     incubator-myfaces/tlds/myfaces_ext.tld
  
  Index: myfaces_ext.tld
  ===================================================================
  RCS file: /home/cvs/incubator-myfaces/tlds/myfaces_ext.tld,v
  retrieving revision 1.174
  retrieving revision 1.175
  diff -u -r1.174 -r1.175
  --- myfaces_ext.tld	9 Mar 2005 04:07:22 -0000	1.174
  +++ myfaces_ext.tld	11 Mar 2005 08:38:45 -0000	1.175
  @@ -1790,6 +1790,62 @@
           &alt_location_attributes;
       </tag>
   
  +   <!-- treeTable -->
  +    <tag>
  +        <name>treeTable</name>
  +        <tag-class>org.apache.myfaces.custom.tree2.TreeTableTag</tag-class>
  +        <body-content>JSP</body-content>
  +        <attribute>
  +            <name>id</name>
  +            <required>false</required>
  +            <rtexprvalue>false</rtexprvalue>
  +        </attribute>
  +        <attribute>
  +            <name>value</name>
  +            <required>true</required>
  +            <rtexprvalue>false</rtexprvalue>
  +        </attribute>
  +        <attribute>
  +            <name>var</name>
  +            <required>false</required>
  +            <rtexprvalue>false</rtexprvalue>
  +        </attribute>
  +        <attribute>
  +            <name>varNodeToggler</name>
  +            <required>false</required>
  +            <rtexprvalue>false</rtexprvalue>
  +        </attribute>
  +        <attribute>
  +            <name>showNav</name>
  +            <required>false</required>
  +            <rtexprvalue>false</rtexprvalue>
  +            <description>
  +                Show the "plus" and "minus" navigation icons (default is true.) Value is
ignored if
  +                clientSideToggle is true.
  +            </description>
  +        </attribute>
  +        <attribute>
  +            <name>showLines</name>
  +            <required>false</required>
  +            <rtexprvalue>false</rtexprvalue>
  +            <description>Show the connecting lines (default is true.)</description>
  +        </attribute>
  +        <attribute>
  +            <name>clientSideToggle</name>
  +            <required>false</required>
  +            <rtexprvalue>false</rtexprvalue>
  +            <description>Perform client-side toggling of expand/collapse state via
javascript (default is true.)</description>
  +        </attribute>
  +        <attribute>
  +            <name>showRootNode</name>
  +            <required>false</required>
  +            <rtexprvalue>false</rtexprvalue>
  +            <description>Include the root node when rendering the tree (default is
true.)</description>
  +        </attribute>        
  +        &html_table_attributes;
  +        &alt_location_attributes;
  +    </tag>
  +
       <!-- panelStack -->
       <tag>
           <name>panelStack</name>
  
  
  
  1.2       +89 -22    incubator-myfaces/webapps/examples/src/org/apache/myfaces/examples/tree/TreeBacker.java
  
  Index: TreeBacker.java
  ===================================================================
  RCS file: /home/cvs/incubator-myfaces/webapps/examples/src/org/apache/myfaces/examples/tree/TreeBacker.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TreeBacker.java	15 Feb 2005 22:23:18 -0000	1.1
  +++ TreeBacker.java	11 Mar 2005 08:38:45 -0000	1.2
  @@ -1,12 +1,12 @@
   /*
    * Copyright 2005 The Apache Software Foundation.
  - * 
  + *
    * Licensed 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.
  @@ -17,43 +17,44 @@
   
   import org.apache.myfaces.custom.tree2.TreeNode;
   import org.apache.myfaces.custom.tree2.TreeNodeBase;
  +import java.util.List;
   
   /**
    * Backer bean for use in example.  Basically makes a TreeNode available.
  - * 
  + *
    * @author Sean Schofield
    * @version $Revision$ $Date$
    */
  -public class TreeBacker 
  +public class TreeBacker
   {
  -    public TreeNode treeData = new TreeNodeBase("foo-folder", "Inbox", true);
  -
  -    public TreeBacker() 
  +    public TreeNode getTreeData()
       {
  +        TreeNode treeData = new TreeNodeBase("foo-folder", "Inbox", true);
  +
           // construct a set of fake data (normally your data would come from a database)
   
           // populate Frank's portion of the tree
           TreeNodeBase personNode = new TreeNodeBase("person", "Frank Foo", true);
  -        personNode.getChildren().add(new TreeNodeBase("foo-folder", "Requires Foo", true));
       
  +        personNode.getChildren().add(new TreeNodeBase("foo-folder", "Requires Foo", true));
           TreeNodeBase folderNode = new TreeNodeBase("foo-folder", "Requires Foo Reviewer",
true);
           folderNode.getChildren().add(new TreeNodeBase("document", "X050001", false));
           folderNode.getChildren().add(new TreeNodeBase("document", "X050002", false));
           folderNode.getChildren().add(new TreeNodeBase("document", "X050003", false));
           personNode.getChildren().add(folderNode);
  -        personNode.getChildren().add(new TreeNodeBase("foo-folder", "Requires Foo Recommendation",
true));        
  +        personNode.getChildren().add(new TreeNodeBase("foo-folder", "Requires Foo Recommendation",
true));
           folderNode = new TreeNodeBase("foo-folder", "Requires Foo Approval", true);
           folderNode.getChildren().add(new TreeNodeBase("document", "J050001", false));
           folderNode.getChildren().add(new TreeNodeBase("document", "J050002", false));
  -        folderNode.getChildren().add(new TreeNodeBase("document", "J050003", false)); 
      
  +        folderNode.getChildren().add(new TreeNodeBase("document", "J050003", false));
           folderNode.getChildren().add(new TreeNodeBase("document", "E050011", false));
           folderNode.getChildren().add(new TreeNodeBase("document", "R050002", false));
  -        folderNode.getChildren().add(new TreeNodeBase("document", "C050003", false)); 
              
  +        folderNode.getChildren().add(new TreeNodeBase("document", "C050003", false));
           personNode.getChildren().add(folderNode);
           folderNode = new TreeNodeBase("bar-folder", "Requires Bar Processing", true);
  -        folderNode.getChildren().add(new TreeNodeBase("document", "X050003", false)); 
      
  +        folderNode.getChildren().add(new TreeNodeBase("document", "X050003", false));
           folderNode.getChildren().add(new TreeNodeBase("document", "X050011", false));
           folderNode.getChildren().add(new TreeNodeBase("document", "F050002", false));
  -        folderNode.getChildren().add(new TreeNodeBase("document", "G050003", false)); 
              
  +        folderNode.getChildren().add(new TreeNodeBase("document", "G050003", false));
           personNode.getChildren().add(folderNode);
           folderNode = new TreeNodeBase("bar-folder", "Requires Bar Approval", true);
           folderNode.getChildren().add(new TreeNodeBase("document", "J050006", false));
  @@ -64,7 +65,7 @@
   
           // populate Betty's portion of the tree
           personNode = new TreeNodeBase("person", "Betty Bar", true);
  -        personNode.getChildren().add(new TreeNodeBase("foo-folder", "Requires Foo", true));
       
  +        personNode.getChildren().add(new TreeNodeBase("foo-folder", "Requires Foo", true));
           folderNode = new TreeNodeBase("foo-folder", "Requires Foo Reviewer", true);
           folderNode.getChildren().add(new TreeNodeBase("document", "X012000", false));
           folderNode.getChildren().add(new TreeNodeBase("document", "X013000", false));
  @@ -73,28 +74,94 @@
           folderNode = new TreeNodeBase("foo-folder", "Requires Foo Recommendation", true);
           folderNode.getChildren().add(new TreeNodeBase("document", "J010026", false));
           folderNode.getChildren().add(new TreeNodeBase("document", "J020002", false));
  -        folderNode.getChildren().add(new TreeNodeBase("document", "J030103", false)); 
      
  +        folderNode.getChildren().add(new TreeNodeBase("document", "J030103", false));
           folderNode.getChildren().add(new TreeNodeBase("document", "E030214", false));
           folderNode.getChildren().add(new TreeNodeBase("document", "R020444", false));
  -        folderNode.getChildren().add(new TreeNodeBase("document", "C010000", false)); 
              
  +        folderNode.getChildren().add(new TreeNodeBase("document", "C010000", false));
           personNode.getChildren().add(folderNode);
  -        personNode.getChildren().add(new TreeNodeBase("foo-folder", "Requires Foo Approval",
true));        
  +        personNode.getChildren().add(new TreeNodeBase("foo-folder", "Requires Foo Approval",
true));
           folderNode = new TreeNodeBase("bar-folder", "Requires Bar Processing", true);
  -        folderNode.getChildren().add(new TreeNodeBase("document", "T052003", false)); 
      
  +        folderNode.getChildren().add(new TreeNodeBase("document", "T052003", false));
           folderNode.getChildren().add(new TreeNodeBase("document", "T020011", false));
           personNode.getChildren().add(folderNode);
           folderNode = new TreeNodeBase("bar-folder", "Requires Bar Approval", true);
           folderNode.getChildren().add(new TreeNodeBase("document", "J010002", false));
           folderNode.getChildren().add(new TreeNodeBase("document", "J030047", false));
           folderNode.getChildren().add(new TreeNodeBase("document", "F030112", false));
  -        personNode.getChildren().add(folderNode);        
  +        personNode.getChildren().add(folderNode);
   
           treeData.getChildren().add(personNode);
  +
  +        return treeData;
       }
   
  -    public TreeNode getTreeData()
  +    public TreeNode getSimpleTreeData()
       {
  +        TreeNode treeData = new TreeNodeBase("branch", "Inbox", true);
  +
  +        // construct a set of fake data (normally your data would come from a database)
  +
  +        // populate Frank's portion of the tree
  +        TreeNodeBase branchNode = new TreeNodeBase("branch", "Frank Foo", true);
  +        branchNode.getChildren().add(new TreeNodeBase("branch", "Requires Foo", true));
  +        TreeNodeBase folderNode = new TreeNodeBase("branch", "Requires Foo Reviewer", true);
  +        folderNode.getChildren().add(new TreeNodeBase("leaf", "X050001", false));
  +        folderNode.getChildren().add(new TreeNodeBase("leaf", "X050002", false));
  +        folderNode.getChildren().add(new TreeNodeBase("leaf", "X050003", false));
  +        branchNode.getChildren().add(folderNode);
  +        branchNode.getChildren().add(new TreeNodeBase("branch", "Requires Foo Recommendation",
true));
  +        folderNode = new TreeNodeBase("branch", "Requires Foo Approval", true);
  +        folderNode.getChildren().add(new TreeNodeBase("leaf", "J050001", false));
  +        folderNode.getChildren().add(new TreeNodeBase("leaf", "J050002", false));
  +        folderNode.getChildren().add(new TreeNodeBase("leaf", "J050003", false));
  +        folderNode.getChildren().add(new TreeNodeBase("leaf", "E050011", false));
  +        folderNode.getChildren().add(new TreeNodeBase("leaf", "R050002", false));
  +        folderNode.getChildren().add(new TreeNodeBase("leaf", "C050003", false));
  +        branchNode.getChildren().add(folderNode);
  +        folderNode = new TreeNodeBase("branch", "Requires Bar Processing", true);
  +        folderNode.getChildren().add(new TreeNodeBase("leaf", "X050003", false));
  +        folderNode.getChildren().add(new TreeNodeBase("leaf", "X050011", false));
  +        folderNode.getChildren().add(new TreeNodeBase("leaf", "F050002", false));
  +        folderNode.getChildren().add(new TreeNodeBase("leaf", "G050003", false));
  +        branchNode.getChildren().add(folderNode);
  +        folderNode = new TreeNodeBase("branch", "Requires Bar Approval", true);
  +        folderNode.getChildren().add(new TreeNodeBase("leaf", "J050006", false));
  +        folderNode.getChildren().add(new TreeNodeBase("leaf", "J050007", false));
  +        branchNode.getChildren().add(folderNode);
  +
  +        treeData.getChildren().add(branchNode);
  +
  +        // populate Betty's portion of the tree
  +        branchNode = new TreeNodeBase("branch", "Betty Bar", true);
  +        branchNode.getChildren().add(new TreeNodeBase("branch", "Requires Foo", true));
  +        folderNode = new TreeNodeBase("branch", "Requires Foo Reviewer", true);
  +        folderNode.getChildren().add(new TreeNodeBase("leaf", "X012000", false));
  +        folderNode.getChildren().add(new TreeNodeBase("leaf", "X013000", false));
  +        folderNode.getChildren().add(new TreeNodeBase("leaf", "X014000", false));
  +        branchNode.getChildren().add(folderNode);
  +        folderNode = new TreeNodeBase("branch", "Requires Foo Recommendation", true);
  +        folderNode.getChildren().add(new TreeNodeBase("leaf", "J010026", false));
  +        folderNode.getChildren().add(new TreeNodeBase("leaf", "J020002", false));
  +        folderNode.getChildren().add(new TreeNodeBase("leaf", "J030103", false));
  +        folderNode.getChildren().add(new TreeNodeBase("leaf", "E030214", false));
  +        folderNode.getChildren().add(new TreeNodeBase("leaf", "R020444", false));
  +        folderNode.getChildren().add(new TreeNodeBase("leaf", "C010000", false));
  +        branchNode.getChildren().add(folderNode);
  +        branchNode.getChildren().add(new TreeNodeBase("branch", "Requires Foo Approval",
true));
  +        folderNode = new TreeNodeBase("branch", "Requires Bar Processing", true);
  +        folderNode.getChildren().add(new TreeNodeBase("leaf", "T052003", false));
  +        folderNode.getChildren().add(new TreeNodeBase("leaf", "T020011", false));
  +        branchNode.getChildren().add(folderNode);
  +        folderNode = new TreeNodeBase("branch", "Requires Bar Approval", true);
  +        folderNode.getChildren().add(new TreeNodeBase("leaf", "J010002", false));
  +        folderNode.getChildren().add(new TreeNodeBase("leaf", "J030047", false));
  +        folderNode.getChildren().add(new TreeNodeBase("leaf", "F030112", false));
  +        branchNode.getChildren().add(folderNode);
  +
  +        treeData.getChildren().add(branchNode);
  +
           return treeData;
  +
       }
   }
   
  
  
  
  1.112     +7 -1      incubator-myfaces/conf/faces-config.xml
  
  Index: faces-config.xml
  ===================================================================
  RCS file: /home/cvs/incubator-myfaces/conf/faces-config.xml,v
  retrieving revision 1.111
  retrieving revision 1.112
  diff -u -r1.111 -r1.112
  --- faces-config.xml	26 Feb 2005 00:27:15 -0000	1.111
  +++ faces-config.xml	11 Mar 2005 08:38:45 -0000	1.112
  @@ -546,6 +546,12 @@
             <renderer-type>org.apache.myfaces.HtmlTree2</renderer-type>
             <renderer-class>org.apache.myfaces.custom.tree2.HtmlTreeRenderer</renderer-class>
          </renderer>
  +       
  +       <renderer>
  +          <component-family>org.apache.myfaces.HtmlTree2</component-family>
  +          <renderer-type>org.apache.myfaces.HtmlTreeTable</renderer-type>
  +          <renderer-class>org.apache.myfaces.custom.tree2.HtmlTreeTableRenderer</renderer-class>
  +       </renderer>       
   
          <renderer>
             <component-family>org.apache.myfaces.HtmlTree</component-family>
  @@ -610,4 +616,4 @@
   		<validator-id>org.apache.myfaces.validator.RegExpr</validator-id>
   		<validator-class>org.apache.myfaces.custom.regexprvalidator.RegExprValidator</validator-class>
   	</validator>
  -</faces-config>
  \ No newline at end of file
  +</faces-config>
  
  
  

Mime
View raw message