mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 10:49:34 +02:00
GT-2925 - Key Bindings - Support Window Menu Provider Key Bindings -
Step 3 - removed old plugin pattern of creating special actions to show their respective providers; updated inception information for new action
This commit is contained in:
parent
f510ddf338
commit
fa75f7dff6
32 changed files with 296 additions and 425 deletions
|
@ -15,14 +15,10 @@
|
|||
*/
|
||||
package ghidra.app.plugin.core.decompile;
|
||||
|
||||
import java.awt.event.InputEvent;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.util.*;
|
||||
|
||||
import org.jdom.Element;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.action.*;
|
||||
import ghidra.app.CorePluginPackage;
|
||||
import ghidra.app.decompiler.component.DecompilerHighlightService;
|
||||
import ghidra.app.decompiler.component.hover.DecompilerHoverService;
|
||||
|
@ -37,9 +33,7 @@ import ghidra.program.model.address.Address;
|
|||
import ghidra.program.model.listing.*;
|
||||
import ghidra.program.util.ProgramLocation;
|
||||
import ghidra.program.util.ProgramSelection;
|
||||
import ghidra.util.HelpLocation;
|
||||
import ghidra.util.task.SwingUpdateManager;
|
||||
import resources.ResourceManager;
|
||||
|
||||
/**
|
||||
* Plugin for producing a high-level C interpretation of assembly functions.
|
||||
|
@ -72,8 +66,6 @@ public class DecompilePlugin extends Plugin {
|
|||
private ProgramLocation currentLocation;
|
||||
private ProgramSelection currentSelection;
|
||||
|
||||
private DockingAction decompileAction;
|
||||
|
||||
/**
|
||||
* Delay location changes to allow location events to settle down.
|
||||
* This happens when a readDataState occurs when a tool is restored
|
||||
|
@ -92,8 +84,6 @@ public class DecompilePlugin extends Plugin {
|
|||
disconnectedProviders = new ArrayList<>();
|
||||
connectedProvider = new PrimaryDecompilerProvider(this);
|
||||
|
||||
createActions();
|
||||
|
||||
registerServices();
|
||||
}
|
||||
|
||||
|
@ -112,22 +102,6 @@ public class DecompilePlugin extends Plugin {
|
|||
}
|
||||
}
|
||||
|
||||
private void createActions() {
|
||||
decompileAction = new DockingAction("Display Decompiler", getName()) {
|
||||
@Override
|
||||
public void actionPerformed(ActionContext context) {
|
||||
showProvider();
|
||||
}
|
||||
};
|
||||
decompileAction.setToolBarData(
|
||||
new ToolBarData(ResourceManager.loadImage("images/decompileFunction.gif"), "View"));
|
||||
decompileAction.setKeyBindingData(
|
||||
new KeyBindingData(KeyEvent.VK_E, InputEvent.CTRL_DOWN_MASK));
|
||||
|
||||
decompileAction.setHelpLocation(new HelpLocation(getName(), "Decompiler"));
|
||||
tool.addAction(decompileAction);
|
||||
}
|
||||
|
||||
/**
|
||||
* Tells the Plugin to write any data-dependent state to the
|
||||
* output stream.
|
||||
|
@ -184,10 +158,6 @@ public class DecompilePlugin extends Plugin {
|
|||
}
|
||||
}
|
||||
|
||||
private void showProvider() {
|
||||
connectedProvider.setVisible(true);
|
||||
}
|
||||
|
||||
DecompilerProvider createNewDisconnectedProvider() {
|
||||
DecompilerProvider decompilerProvider = new DecompilerProvider(this, false);
|
||||
decompilerProvider.setClipboardService(tool.getService(ClipboardService.class));
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
*/
|
||||
package ghidra.app.plugin.core.decompile;
|
||||
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.math.BigInteger;
|
||||
import java.util.Arrays;
|
||||
|
@ -22,8 +23,7 @@ import java.util.List;
|
|||
|
||||
import javax.swing.*;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.WindowPosition;
|
||||
import docking.*;
|
||||
import docking.action.*;
|
||||
import docking.widgets.fieldpanel.LayoutModel;
|
||||
import docking.widgets.fieldpanel.support.FieldLocation;
|
||||
|
@ -125,6 +125,7 @@ public class DecompilerProvider extends NavigatableComponentProviderAdapter
|
|||
public DecompilerProvider(DecompilePlugin plugin, boolean isConnected) {
|
||||
super(plugin.getTool(), "Decompiler", plugin.getName(), DecompilerActionContext.class);
|
||||
this.plugin = plugin;
|
||||
|
||||
clipboardProvider = new DecompilerClipboardProvider(plugin, this);
|
||||
setConnected(isConnected);
|
||||
|
||||
|
@ -135,8 +136,11 @@ public class DecompilerProvider extends NavigatableComponentProviderAdapter
|
|||
DecompilerPanel decompilerPanel = controller.getDecompilerPanel();
|
||||
decompilerPanel.setHighlightController(highlightController);
|
||||
decorationPanel = new DecoratorPanel(decompilerPanel, isConnected);
|
||||
|
||||
setTitle("Decompile");
|
||||
setIcon(C_SOURCE_ICON);
|
||||
setIcon(C_SOURCE_ICON, true);
|
||||
setDefaultKeyBinding(
|
||||
new KeyBindingData(KeyEvent.VK_E, DockingUtils.CONTROL_KEY_MODIFIER_MASK));
|
||||
setWindowMenuGroup("Decompile");
|
||||
setDefaultWindowPosition(WindowPosition.RIGHT);
|
||||
createActions(isConnected);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue