X-Git-Url: http://www2.svjatoslav.eu/gitweb/?a=blobdiff_plain;ds=inline;f=src%2Fmain%2Fjava%2Feu%2Fsvjatoslav%2Fcommons%2Fnetwork%2Fnavigation%2FNavigation.java;h=8b049bbcd4d984286a3496b50cbdf6ba74e3d7a8;hb=aa03fa52face6f13f8da2e9b89e798671653a074;hp=408372a21e89e97e9cc4407fd697aa5647f04619;hpb=a2b2acd6d8c6a73c0897a2002a313266b1b74872;p=svjatoslav_commons.git diff --git a/src/main/java/eu/svjatoslav/commons/network/navigation/Navigation.java b/src/main/java/eu/svjatoslav/commons/network/navigation/Navigation.java index 408372a..8b049bb 100755 --- a/src/main/java/eu/svjatoslav/commons/network/navigation/Navigation.java +++ b/src/main/java/eu/svjatoslav/commons/network/navigation/Navigation.java @@ -1,3 +1,12 @@ +/* + * Svjatoslav Commons - shared library of common functionality. + * Copyright ©2012-2014, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 3 of the GNU Lesser General Public License + * or later as published by the Free Software Foundation. + */ + package eu.svjatoslav.commons.network.navigation; import java.net.MalformedURLException; @@ -5,6 +14,9 @@ import java.net.URL; import javax.servlet.http.HttpServletRequest; +import eu.svjatoslav.commons.network.Locale; +import eu.svjatoslav.commons.network.LocaleHelper; + public class Navigation { private NavigationItem rootNavigationItem; @@ -15,6 +27,13 @@ public class Navigation { return defaultNavigationItem; } + private String getGetNotNullString(final String string) { + if (string != null) + return string; + + return ""; + } + public NavigationItem getRootNavigationItem() { return rootNavigationItem; } @@ -40,22 +59,29 @@ public class Navigation { public String getTopMenu(final HttpServletRequest request) { + final Locale currentLocale = LocaleHelper.detectLocale(request); + final NavigationItem selectedItem = getSelectedItem(request); final StringBuffer result = new StringBuffer(); - result.append("