-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Correctly sort all menu entries (alphabetically by default) #179
Comments
I created a small test project (https://github.com/imagejan/test-menu-path), containing:
in the same submenu Plugins > ASubmenu. When placing the project's jar file ( However, when the jar file is placed in |
Menu entries are sorted alphabetically if and only if their menu weight is the same.
imagej-legacy/src/main/java/net/imagej/legacy/IJ1Helper.java Lines 907 to 922 in dd36b3f
So in order to unify menus of Legacy and IJ2 commands, we need to either:
(Maybe I'm missing something here.) |
For the record: here's a script I used to display the menu weights for each menu entry: #@ MenuService menus
def printMenu(menu, prefix) {
entry = menu.getMenuEntry()
if(entry!=null) println "${prefix}[${entry.getWeight()}] ${entry.getName()}"
if (!menu.isLeaf()) {
menu.getChildren().each {
printMenu(it, prefix+" ")
}
}
}
printMenu(menus.getMenu(), "") |
Currently, legacy-compatible IJ2 commands end up in a menu group separate from IJ1 plugins, e.g. the
Debug
,Sandbox
,AutoRun
,Kymograph
andScripting
submenus of the Plugins menu are in a separate section.Let's merge them all and sort them alphabetically.
See also PreibischLab/BigStitcher#7 (comment).
The adding and sorting is supposed to happen in
IJ1Helper#addMenuItems()
method:imagej-legacy/src/main/java/net/imagej/legacy/IJ1Helper.java
Lines 775 to 850 in dd36b3f
The text was updated successfully, but these errors were encountered: