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 2010/06/21 09:10:53 UTC

svn commit: r956473 - in /myfaces/tobago/branches/tobago-1.0.x/example/test/src/main: java/org/apache/myfaces/tobago/example/test/TreeController.java webapp/WEB-INF/faces-config.xml webapp/tc/tree/ webapp/tc/tree/tree-select.xhtml

Author: lofwyr
Date: Mon Jun 21 07:10:53 2010
New Revision: 956473

URL: http://svn.apache.org/viewvc?rev=956473&view=rev
Log:
tree sample

Added:
    myfaces/tobago/branches/tobago-1.0.x/example/test/src/main/java/org/apache/myfaces/tobago/example/test/TreeController.java
    myfaces/tobago/branches/tobago-1.0.x/example/test/src/main/webapp/tc/tree/
    myfaces/tobago/branches/tobago-1.0.x/example/test/src/main/webapp/tc/tree/tree-select.xhtml
Modified:
    myfaces/tobago/branches/tobago-1.0.x/example/test/src/main/webapp/WEB-INF/faces-config.xml

Added: myfaces/tobago/branches/tobago-1.0.x/example/test/src/main/java/org/apache/myfaces/tobago/example/test/TreeController.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.0.x/example/test/src/main/java/org/apache/myfaces/tobago/example/test/TreeController.java?rev=956473&view=auto
==============================================================================
--- myfaces/tobago/branches/tobago-1.0.x/example/test/src/main/java/org/apache/myfaces/tobago/example/test/TreeController.java (added)
+++ myfaces/tobago/branches/tobago-1.0.x/example/test/src/main/java/org/apache/myfaces/tobago/example/test/TreeController.java Mon Jun 21 07:10:53 2010
@@ -0,0 +1,46 @@
+package org.apache.myfaces.tobago.example.test;
+
+import org.apache.myfaces.tobago.example.data.CategoryTree;
+import org.apache.myfaces.tobago.model.TreeState;
+
+import javax.swing.tree.DefaultMutableTreeNode;
+
+/*
+ * 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.
+ */
+
+public class TreeController {
+
+  private DefaultMutableTreeNode tree;
+
+  private TreeState state;
+
+  public TreeController() {
+    this.tree = CategoryTree.createSample();
+  }
+
+  public DefaultMutableTreeNode getTree() {
+    return tree;
+  }
+
+  public TreeState getState() {
+    return state;
+  }
+
+  public void setState(TreeState state) {
+    this.state = state;
+  }
+}

Modified: myfaces/tobago/branches/tobago-1.0.x/example/test/src/main/webapp/WEB-INF/faces-config.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.0.x/example/test/src/main/webapp/WEB-INF/faces-config.xml?rev=956473&r1=956472&r2=956473&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.0.x/example/test/src/main/webapp/WEB-INF/faces-config.xml (original)
+++ myfaces/tobago/branches/tobago-1.0.x/example/test/src/main/webapp/WEB-INF/faces-config.xml Mon Jun 21 07:10:53 2010
@@ -47,6 +47,12 @@
     <managed-bean-scope>session</managed-bean-scope>
   </managed-bean>
   
+  <managed-bean>
+    <managed-bean-name>tree</managed-bean-name>
+    <managed-bean-class>org.apache.myfaces.tobago.example.test.TreeController</managed-bean-class>
+    <managed-bean-scope>session</managed-bean-scope>
+  </managed-bean>
+
   <lifecycle>
     <phase-listener>
       org.apache.myfaces.tobago.example.test.DebugModePhaseListener

Added: myfaces/tobago/branches/tobago-1.0.x/example/test/src/main/webapp/tc/tree/tree-select.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.0.x/example/test/src/main/webapp/tc/tree/tree-select.xhtml?rev=956473&view=auto
==============================================================================
--- myfaces/tobago/branches/tobago-1.0.x/example/test/src/main/webapp/tc/tree/tree-select.xhtml (added)
+++ myfaces/tobago/branches/tobago-1.0.x/example/test/src/main/webapp/tc/tree/tree-select.xhtml Mon Jun 21 07:10:53 2010
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.
+-->
+
+<f:view
+    xmlns:jsp="http://java.sun.com/JSP/Page"
+    xmlns:tc="http://myfaces.apache.org/tobago/component"
+    xmlns:tx="http://myfaces.apache.org/tobago/extension"
+    xmlns:ui="http://java.sun.com/jsf/facelets"
+    xmlns:h="http://java.sun.com/jsf/html"
+    xmlns:f="http://java.sun.com/jsf/core">
+  <tc:page width="600px" height="300px">
+    <f:facet name="layout">
+      <tc:gridLayout/>
+    </f:facet>
+
+    <tc:tree value="#{tree.tree}" state="#{tree.state}" id="tree" selectable="single">
+    </tc:tree>
+
+  </tc:page>
+</f:view>