improved navigation
[svjatoslav_commons.git] / src / main / java / eu / svjatoslav / commons / network / navigation / Navigation.java
index ff16177..2c5aa27 100755 (executable)
@@ -55,8 +55,7 @@ public class Navigation<NI extends NavigationItem> {
                        final String requestPath = new URL(requestUrl).getPath();
 
                        @SuppressWarnings("unchecked")
-                       final NI match = (NI) rootNavigationItem
-                                       .getMatchingNavigationItem(requestPath);
+                       final NI match = (NI) rootNavigationItem.getMatchingNavigationItem(requestPath);
 
                        if (match != null)
                                return match;
@@ -71,28 +70,21 @@ public class Navigation<NI extends NavigationItem> {
        @SuppressWarnings("unchecked")
        public String getTopMenu(final HttpServletRequest request) {
 
-               final String currentLocale = localeConfiguration
-                               .detectCurrentLocale(request);
+               final String currentLocale = localeConfiguration.detectCurrentLocale(request);
 
                final NI selectedItem = getSelectedItem(request);
                final StringBuffer result = new StringBuffer();
 
-               result.append("<div class=\""
-                               + getGetNotNullString(rootNavigationItem.getCssPrefix())
-                               + "navigationMenu\">");
+               result.append("<div class=\"" + getGetNotNullString(rootNavigationItem.getCssPrefix()) + "navigationMenu\">");
 
-               for (final NI item : (List<NI>) getRootNavigationItem()
-                               .getSubElements()) {
+               for (final NI item : (List<NI>) getRootNavigationItem().getSubElements()) {
 
                        if (item == selectedItem)
-                               result.append("<a class=\""
-                                               + getGetNotNullString(item.getCssPrefix())
-                                               + "menuItemSelected\" href=\"" + item.getLinkUrl()
-                                               + "\">");
+                               result.append("<a class=\"" + getGetNotNullString(item.getCssPrefix()) + "menuItemSelected\" href=\""
+                                               + item.getLinkUrl() + "\">");
                        else
-                               result.append("<a class=\""
-                                               + getGetNotNullString(item.getCssPrefix())
-                                               + "menuItem\" href=\"" + item.getLinkUrl() + "\">");
+                               result.append("<a class=\"" + getGetNotNullString(item.getCssPrefix()) + "menuItem\" href=\""
+                                               + item.getLinkUrl() + "\">");
 
                        result.append("<div>" + item.getTitle(currentLocale) + "</div>");
                        result.append("</a>");