mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 10:49:34 +02:00
GP-4436 - Mouse Bindings
This commit is contained in:
parent
eca5195dea
commit
8aeebf919a
61 changed files with 3136 additions and 919 deletions
|
@ -19,8 +19,6 @@ import java.awt.Component;
|
|||
import java.io.*;
|
||||
import java.util.*;
|
||||
|
||||
import javax.swing.KeyStroke;
|
||||
|
||||
import org.jdom.Document;
|
||||
import org.jdom.output.XMLOutputter;
|
||||
|
||||
|
@ -51,7 +49,6 @@ import ghidra.framework.options.*;
|
|||
import ghidra.framework.plugintool.*;
|
||||
import ghidra.framework.plugintool.util.PluginException;
|
||||
import ghidra.framework.plugintool.util.PluginStatus;
|
||||
import ghidra.framework.project.tool.GhidraTool;
|
||||
import ghidra.program.model.address.*;
|
||||
import ghidra.program.model.listing.*;
|
||||
import ghidra.program.model.symbol.Reference;
|
||||
|
@ -144,8 +141,7 @@ public class VTSubToolManager implements VTControllerListener, OptionsChangeList
|
|||
toolTemplate = ToolUtils.readToolTemplate(toolFileName);
|
||||
}
|
||||
|
||||
PluginTool newTool =
|
||||
(GhidraTool) toolTemplate.createTool(controller.getTool().getProject());
|
||||
PluginTool newTool = toolTemplate.createTool(controller.getTool().getProject());
|
||||
try {
|
||||
VersionTrackingSubordinatePluginX pluginX =
|
||||
new VersionTrackingSubordinatePluginX(newTool, isSourceTool);
|
||||
|
@ -190,33 +186,38 @@ public class VTSubToolManager implements VTControllerListener, OptionsChangeList
|
|||
if (processingOptions) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(newValue instanceof ActionTrigger)) {
|
||||
return;
|
||||
}
|
||||
|
||||
processingOptions = true;
|
||||
try {
|
||||
if (!(newValue instanceof KeyStroke)) {
|
||||
return;
|
||||
}
|
||||
KeyStroke keyStroke = (KeyStroke) newValue;
|
||||
if (sourceTool != null) {
|
||||
Options sourceOptions = sourceTool.getOptions(ToolConstants.KEY_BINDINGS);
|
||||
if (sourceOptions != options) {
|
||||
sourceOptions.setKeyStroke(optionName, keyStroke);
|
||||
sourceTool.refreshKeybindings();
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (destinationTool != null) {
|
||||
Options destinationOptions = destinationTool.getOptions(ToolConstants.KEY_BINDINGS);
|
||||
if (destinationOptions != options) {
|
||||
destinationOptions.setKeyStroke(optionName, keyStroke);
|
||||
destinationTool.refreshKeybindings();
|
||||
}
|
||||
}
|
||||
updateActionTrigger(options, optionName, (ActionTrigger) newValue);
|
||||
}
|
||||
finally {
|
||||
processingOptions = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void updateActionTrigger(ToolOptions options, String optionName,
|
||||
ActionTrigger trigger) {
|
||||
if (sourceTool != null) {
|
||||
Options sourceOptions = sourceTool.getOptions(DockingToolConstants.KEY_BINDINGS);
|
||||
if (sourceOptions != options) {
|
||||
sourceOptions.setActionTrigger(optionName, trigger);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (destinationTool != null) {
|
||||
Options destinationOptions =
|
||||
destinationTool.getOptions(DockingToolConstants.KEY_BINDINGS);
|
||||
if (destinationOptions != options) {
|
||||
destinationOptions.setActionTrigger(optionName, trigger);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void createMatchActions(final PluginTool newTool) {
|
||||
newTool.setMenuGroup(new String[] { VTPlugin.MATCH_POPUP_MENU_NAME }, "1", "1");
|
||||
newTool.setMenuGroup(new String[] { VTPlugin.MARKUP_POPUP_MENU_NAME }, "1", "2");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue