Fixed shared action binding conflict

This commit is contained in:
dragonmacher 2024-05-24 16:21:30 -04:00
parent 19f9a4ab8b
commit a651e30959
2 changed files with 4 additions and 8 deletions

View File

@ -15,12 +15,8 @@
*/
package ghidra.app.plugin.core.compositeeditor;
import static docking.KeyBindingPrecedence.*;
import java.awt.event.KeyEvent;
import javax.swing.KeyStroke;
import docking.ActionContext;
import docking.action.KeyBindingData;
import ghidra.program.model.data.DataType;
@ -37,12 +33,11 @@ public class PointerAction extends CompositeEditorTableAction {
private final static String GROUP_NAME = COMPONENT_ACTION_GROUP;
private final static String DESCRIPTION = "Create a pointer(s) on the selection";
private final static DataType POINTER_DT = new PointerDataType();
private final static KeyStroke KEY_STROKE = KeyStroke.getKeyStroke(KeyEvent.VK_P, 0);
public PointerAction(CompositeEditorProvider provider) {
super(provider, ACTION_NAME, GROUP_NAME, null, null, null);
setDescription(DESCRIPTION);
setKeyBindingData(new KeyBindingData(KEY_STROKE, DefaultLevel));
setKeyBindingData(new KeyBindingData(KeyEvent.VK_P, 0));
adjustEnablement();
}

View File

@ -16,12 +16,12 @@
package ghidra.app.plugin.core.datamgr.actions;
import java.awt.Component;
import java.awt.event.KeyEvent;
import javax.swing.tree.TreePath;
import docking.ActionContext;
import docking.action.DockingAction;
import docking.action.MenuData;
import docking.action.*;
import docking.widgets.tree.GTree;
import docking.widgets.tree.GTreeNode;
import ghidra.app.plugin.core.datamgr.*;
@ -37,6 +37,7 @@ public class CreatePointerAction extends DockingAction {
super("Create Pointer", plugin.getName());
this.plugin = plugin;
setKeyBindingData(new KeyBindingData(KeyEvent.VK_P, 0));
setPopupMenuData(new MenuData(new String[] { "New", "Pointer" }, null, "Create"));
}