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 2014/07/09 14:38:23 UTC

svn commit: r1609135 - /myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/NavigationTree.java

Author: lofwyr
Date: Wed Jul  9 12:38:22 2014
New Revision: 1609135

URL: http://svn.apache.org/r1609135
Log:
demo: fix intro page

Modified:
    myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/NavigationTree.java

Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/NavigationTree.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/NavigationTree.java?rev=1609135&r1=1609134&r2=1609135&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/NavigationTree.java (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/NavigationTree.java Wed Jul  9 12:38:22 2014
@@ -63,7 +63,7 @@ public class NavigationTree implements S
 //  private ServletContext servletContext;
 
   public NavigationTree() {
-    LOG.info("<init>");
+    LOG.info("<init> " + this);
   }
 
   @PostConstruct
@@ -76,6 +76,11 @@ public class NavigationTree implements S
     list.add("/content/root-dummy.xhtml"); // helps to build the tree, this is not an existing file
     final List<NavigationNode> nodes = new ArrayList<NavigationNode>();
     for (final String path : list) {
+
+      if (path.contains("/x-") || ! path.contains(".xhtml")) {
+        // ignoring excluded files
+        continue;
+      }
       try {
         nodes.add(new NavigationNode(path, this));
       } catch (final IllegalStateException e) {
@@ -119,11 +124,6 @@ public class NavigationTree implements S
           continue;
         }
 
-        if (path.contains("/x-")) {
-          // ignoring excluded files
-          continue;
-        }
-
         result.add(path);
 
       }
@@ -154,7 +154,11 @@ public class NavigationTree implements S
   }
 
   public void gotoNode(final NavigationNode node) {
-    events.fire(node);
+    if (node != null) {
+      events.fire(node);
+    } else {
+      events.fire(root);
+    }
   }
 
   public String viewSource() {