GT-2869 - Key Bindings - refactor of methods to provide all actions

This commit is contained in:
dragonmacher 2019-06-04 18:15:16 -04:00
parent c1de98304a
commit 43fa7e3f92
75 changed files with 1243 additions and 1049 deletions

View file

@ -18,12 +18,10 @@ package help.screenshot;
import java.awt.AWTException;
import java.awt.Robot;
import java.awt.event.KeyEvent;
import java.util.List;
import org.junit.Test;
import docking.action.DockingActionIf;
import ghidra.app.plugin.core.assembler.AssembleDockingAction;
import ghidra.app.plugin.core.assembler.AssemblerPlugin;
import ghidra.app.plugin.core.codebrowser.CodeViewerProvider;
import ghidra.framework.plugintool.util.PluginException;
@ -37,9 +35,7 @@ public class AssemblerPluginScreenShots extends GhidraScreenShotGenerator {
positionCursor(0x0040512e);
tool.addPlugin(AssemblerPlugin.class.getName());
String fullActionName = "Assemble (AssemblerPlugin)";
List<DockingActionIf> actions = tool.getDockingActionsByFullActionName(fullActionName);
AssembleDockingAction action = (AssembleDockingAction) actions.get(0);
DockingActionIf action = getAction(tool, "AssemblerPlugin", "Assemble");
performAction(action, true);

View file

@ -156,10 +156,10 @@ public class DataTypeManagerPluginScreenShots extends GhidraScreenShotGenerator
@Test
public void testPreviewWindow() {
String fullActionName = "Show Preview Window (DataTypeManagerPlugin)";
List<DockingActionIf> action = tool.getDockingActionsByFullActionName(fullActionName);
performAction(action.get(0));
// performAction("Show Preview Window", "DataTypeManagerPlugin", false);
DockingActionIf action = getAction(tool, "DataTypeManagerPlugin", "Show Preview Window");
performAction(action);
DataTypesProvider provider = getProvider(DataTypesProvider.class);
GTree tree = (GTree) getInstanceField("archiveGTree", provider);
GTreeRootNode rootNode = tree.getRootNode();

View file

@ -283,10 +283,9 @@ public class ToolScreenShots extends GhidraScreenShotGenerator {
DockingWindowManager windowManager = tool.getWindowManager();
DockingActionManager actionMgr =
(DockingActionManager) getInstanceField("actionManager", windowManager);
String fullActionName = "Delete Function" + " (" + "FunctionPlugin" + ")";
List<DockingActionIf> actions = tool.getDockingActionsByFullActionName(fullActionName);
final KeyEntryDialog keyEntryDialog = new KeyEntryDialog(actions.get(0), actionMgr);
DockingActionIf action = getAction(tool, "FunctionPlugin", "Delete Function");
final KeyEntryDialog keyEntryDialog = new KeyEntryDialog(action, actionMgr);
runSwing(() -> tool.showDialog(keyEntryDialog), false);
captureDialog();