Skip to content

Commit

Permalink
- close #347
Browse files Browse the repository at this point in the history
- added UnrelatedView10 as an example
  • Loading branch information
appreciated committed Jan 29, 2021
1 parent 5c1673b commit 7298757
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ public static boolean shouldHighlight(Class<? extends Component> className, Loca
Set<RouteData> routes = getUpNavigationHelper().registeredRoutes.keySet();
Optional<RouteSimilarity> result = routes.stream()
.map(s -> new RouteSimilarity(s, currentRoute))
.filter(routeSimilarity -> routeSimilarity.getSimilarity() > 0)
.max(Comparator.comparingInt(RouteSimilarity::getSimilarity));

return result.filter(routeSimilarity -> routeSimilarity.getRoute() == className).isPresent();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.github.appreciated.app.layout;

import com.vaadin.flow.router.Route;

@Route(value = "view10", layout = MainLayout.class)
public class UnrelatedView10 extends AbstractView {
@Override
String getViewName() {
return getClass().getName();
}
}

0 comments on commit 7298757

Please sign in to comment.