File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
src/main/java/org/scijava/search/module Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 3434
3535import org .scijava .MenuEntry ;
3636import org .scijava .MenuPath ;
37+ import org .scijava .UIDetails ;
3738import org .scijava .input .Accelerator ;
3839import org .scijava .module .ModuleInfo ;
3940import org .scijava .search .SearchResult ;
@@ -103,8 +104,13 @@ private String getMenuPath(boolean includeLeaf) {
103104 }
104105
105106 private String getMenuPath (boolean includeLeaf , String separator ) {
107+ final String menuRoot = info .getMenuRoot ();
108+ final boolean isContextMenu = menuRoot != null && //
109+ !menuRoot .equals (UIDetails .APPLICATION_MENU_ROOT );
110+ final String prefix = isContextMenu ? "[" + menuRoot + "]" : "" ;
106111 final MenuPath menuPath = info .getMenuPath ();
107- if (menuPath == null ) return "" ;
108- return menuPath .getMenuString (includeLeaf ).replace (" > " , separator );
112+ if (menuPath == null ) return prefix ;
113+ final String menuString = menuPath .getMenuString (includeLeaf );
114+ return prefix + " " + menuString .replace (" > " , separator );
109115 }
110116}
You can’t perform that action at this time.
0 commit comments