mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 18:29:37 +02:00
GT-2925 - Key Bindings - Support Window Menu Provider Key Bindings -
Step 2 - fixed bug that allowed dummy actions into the toolbar; updated DockingAction to handle null keybindings the same way as null menu and toolbar data
This commit is contained in:
parent
8c11c1eebd
commit
f510ddf338
4 changed files with 17 additions and 7 deletions
|
@ -200,6 +200,12 @@ public class DeleteTableRowAction extends DockingAction {
|
||||||
|
|
||||||
public DummyDeleteAction(PluginTool tool) {
|
public DummyDeleteAction(PluginTool tool) {
|
||||||
super(NAME, "Tool", DEFAULT_KEYSTROKE);
|
super(NAME, "Tool", DEFAULT_KEYSTROKE);
|
||||||
|
|
||||||
|
// prevent this action from appearing in the toolbar, menus, etc
|
||||||
|
setToolBarData(null);
|
||||||
|
setPopupMenuData(null);
|
||||||
|
setKeyBindingData(null);
|
||||||
|
|
||||||
tool.addAction(this);
|
tool.addAction(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -540,10 +540,6 @@ public abstract class ComponentProvider implements HelpDescriptor, ActionContext
|
||||||
Fix:
|
Fix:
|
||||||
|
|
||||||
-Toolbar description for key doesn't match menu (goes away)
|
-Toolbar description for key doesn't match menu (goes away)
|
||||||
-dummy actions getting added to toolbar
|
|
||||||
-cleanup odd relationship with keybindings action and UI (move to tool??
|
|
||||||
or ToolActions...<= this)
|
|
||||||
|
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -80,6 +80,10 @@ public class KeyBindingData {
|
||||||
* @return the potentially changed data
|
* @return the potentially changed data
|
||||||
*/
|
*/
|
||||||
public static KeyBindingData validateKeyBindingData(KeyBindingData newKeyBindingData) {
|
public static KeyBindingData validateKeyBindingData(KeyBindingData newKeyBindingData) {
|
||||||
|
if (newKeyBindingData == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
KeyStroke keyBinding = newKeyBindingData.getKeyBinding();
|
KeyStroke keyBinding = newKeyBindingData.getKeyBinding();
|
||||||
if (keyBinding == null) {
|
if (keyBinding == null) {
|
||||||
// not sure when this can happen
|
// not sure when this can happen
|
||||||
|
|
|
@ -300,8 +300,12 @@ public class ToolActions implements PropertyChangeListener {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
KeyBindingData keyBindingData = (KeyBindingData) evt.getNewValue();
|
KeyBindingData newKeyBindingData = (KeyBindingData) evt.getNewValue();
|
||||||
KeyStroke newKeyStroke = keyBindingData.getKeyBinding();
|
KeyStroke newKeyStroke = null;
|
||||||
|
if (newKeyBindingData != null) {
|
||||||
|
newKeyStroke = newKeyBindingData.getKeyBinding();
|
||||||
|
}
|
||||||
|
|
||||||
Options opt = dockingTool.getOptions(DockingToolConstants.KEY_BINDINGS);
|
Options opt = dockingTool.getOptions(DockingToolConstants.KEY_BINDINGS);
|
||||||
KeyStroke optKeyStroke = opt.getKeyStroke(action.getFullName(), null);
|
KeyStroke optKeyStroke = opt.getKeyStroke(action.getFullName(), null);
|
||||||
if (newKeyStroke == null) {
|
if (newKeyStroke == null) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue