private Category getSelected() { if (componentConfig != null && componentConfig.selected() != null) { return componentConfig.selected(); } else if (config != null && config.selected() != null) { return config.selected(); } if (config != null && config.decoupledSelection()) { final PageKey p = route.getPage(); if(p instanceof WithNavigation) { final NavigationKey navigationKey = ((WithNavigation)p).getNavigationKey(); if (navigationKey != null && navigationKey.isCategory()) { Category c = navigationKey.getCategory(); if (categories.containsValue(c)) { return c; } } } } return getCurrent(); }