mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 02:39:44 +02:00
fixes to action builder
This commit is contained in:
parent
341f1008f1
commit
04e49ee46a
2 changed files with 9 additions and 8 deletions
|
@ -41,19 +41,19 @@ public class MenuData {
|
||||||
private String menuSubGroup;
|
private String menuSubGroup;
|
||||||
|
|
||||||
public MenuData(String[] menuPath) {
|
public MenuData(String[] menuPath) {
|
||||||
this(menuPath, null, null);
|
this(menuPath, null, null, NO_MNEMONIC, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public MenuData(String[] menuPath, String group) {
|
public MenuData(String[] menuPath, String group) {
|
||||||
this(menuPath, null, group);
|
this(menuPath, null, group, NO_MNEMONIC, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public MenuData(String[] menuPath, Icon icon) {
|
public MenuData(String[] menuPath, Icon icon) {
|
||||||
this(menuPath, icon, null);
|
this(menuPath, icon, null, NO_MNEMONIC, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public MenuData(String[] menuPath, Icon icon, String menuGroup) {
|
public MenuData(String[] menuPath, Icon icon, String menuGroup) {
|
||||||
this(processMenuPath(menuPath), icon, menuGroup, getMnemonic(menuPath), null);
|
this(menuPath, icon, menuGroup, NO_MNEMONIC, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public MenuData(String[] menuPath, Icon icon, String menuGroup, int mnemonic,
|
public MenuData(String[] menuPath, Icon icon, String menuGroup, int mnemonic,
|
||||||
|
@ -62,10 +62,10 @@ public class MenuData {
|
||||||
if (menuPath == null || menuPath.length == 0) {
|
if (menuPath == null || menuPath.length == 0) {
|
||||||
throw new IllegalArgumentException("Menu path cannot be null or empty");
|
throw new IllegalArgumentException("Menu path cannot be null or empty");
|
||||||
}
|
}
|
||||||
this.menuPath = menuPath;
|
this.menuPath = processMenuPath(menuPath);
|
||||||
this.menuGroup = menuGroup;
|
this.menuGroup = menuGroup;
|
||||||
this.menuSubGroup = menuSubGroup == null ? NO_SUBGROUP : menuSubGroup;
|
this.menuSubGroup = menuSubGroup == null ? NO_SUBGROUP : menuSubGroup;
|
||||||
this.mnemonic = mnemonic;
|
this.mnemonic = mnemonic == NO_MNEMONIC ? getMnemonic(menuPath) : mnemonic;
|
||||||
this.icon = DockingUtils.scaleIconAsNeeded(icon);
|
this.icon = DockingUtils.scaleIconAsNeeded(icon);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -100,7 +100,7 @@ public abstract class AbstractActionBuilder<T extends DockingActionIf, B extends
|
||||||
/**
|
/**
|
||||||
* The mnemonic for the menu action (optional)
|
* The mnemonic for the menu action (optional)
|
||||||
*/
|
*/
|
||||||
private int menuMnemonic;
|
private int menuMnemonic = MenuData.NO_MNEMONIC;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The icon for the menu item (optional)
|
* The icon for the menu item (optional)
|
||||||
|
@ -304,7 +304,8 @@ public abstract class AbstractActionBuilder<T extends DockingActionIf, B extends
|
||||||
* @see #menuGroup(String)
|
* @see #menuGroup(String)
|
||||||
*/
|
*/
|
||||||
public B menuGroup(String group, String subGroup) {
|
public B menuGroup(String group, String subGroup) {
|
||||||
menuSubGroup = group;
|
menuGroup = group;
|
||||||
|
menuSubGroup = subGroup;
|
||||||
return self();
|
return self();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue