Author: fmeschbe
Date: Wed Jun 18 06:34:39 2008
New Revision: 669167

URL: http://svn.apache.org/viewvc?rev=669167&view=rev
Log:
Render the current page inverse and create a link on it if displaying
a subpage of the current page

Modified:
    
felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/AbstractWebConsolePlugin.java

Modified: 
felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/AbstractWebConsolePlugin.java
URL: 
http://svn.apache.org/viewvc/felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/AbstractWebConsolePlugin.java?rev=669167&r1=669166&r2=669167&view=diff
==============================================================================
--- 
felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/AbstractWebConsolePlugin.java
 (original)
+++ 
felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/AbstractWebConsolePlugin.java
 Wed Jun 18 06:34:39 2008
@@ -189,12 +189,15 @@
     protected void renderTopNavigation( HttpServletRequest request, 
PrintWriter pw )
     {
         // assume pathInfo to not be null, else this would not be called
+        boolean linkToCurrent = true;
         String current = request.getPathInfo();
         int slash = current.indexOf( "/", 1 );
-        if ( slash > 1 )
+        if ( slash < 0 )
         {
-            current = current.substring( 1, slash );
+            slash = current.length();
+            linkToCurrent = false;
         }
+        current = current.substring( 1, slash );
 
         boolean disabled = false;
         String appRoot = ( String ) request.getAttribute( 
OsgiManager.ATTR_APP_ROOT );
@@ -213,8 +216,16 @@
                 }
                 else if ( disabled || current.equals( labelMapEntry.getKey() ) 
)
                 {
-                    map.put( labelMapEntry.getValue(), "<span 
class='technavat'>" + labelMapEntry.getValue()
-                        + "</span>" );
+                    if ( linkToCurrent )
+                    {
+                        map.put( labelMapEntry.getValue(), "<a 
class='technavat' href='" + appRoot + "/"
+                            + labelMapEntry.getKey() + "'>" + 
labelMapEntry.getValue() + "</a></li>" );
+                    }
+                    else
+                    {
+                        map.put( labelMapEntry.getValue(), "<span 
class='technavat'>" + labelMapEntry.getValue()
+                            + "</span>" );
+                    }
                 }
                 else
                 {


Reply via email to