mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-03 17:59:46 +02:00
GT-2971 - Key Bindings - Added the ability to set a key binding for the
close button for all Component Providers
This commit is contained in:
parent
8739d8e750
commit
380d863c96
113 changed files with 612 additions and 477 deletions
|
@ -22,6 +22,7 @@ import docking.ActionContext;
|
|||
import docking.ComponentProvider;
|
||||
import docking.action.DockingAction;
|
||||
import docking.action.MenuData;
|
||||
import docking.tool.ToolConstants;
|
||||
import ghidra.app.CorePluginPackage;
|
||||
import ghidra.app.context.*;
|
||||
import ghidra.app.events.ProgramClosedPluginEvent;
|
||||
|
@ -33,7 +34,6 @@ import ghidra.app.util.HelpTopics;
|
|||
import ghidra.app.util.query.TableService;
|
||||
import ghidra.framework.plugintool.*;
|
||||
import ghidra.framework.plugintool.util.PluginStatus;
|
||||
import ghidra.framework.plugintool.util.ToolConstants;
|
||||
import ghidra.program.model.address.*;
|
||||
import ghidra.program.model.listing.CodeUnit;
|
||||
import ghidra.program.model.listing.Program;
|
||||
|
|
|
@ -25,6 +25,7 @@ import java.util.zip.ZipEntry;
|
|||
import docking.ActionContext;
|
||||
import docking.action.DockingAction;
|
||||
import docking.action.MenuData;
|
||||
import docking.tool.ToolConstants;
|
||||
import ghidra.app.CorePluginPackage;
|
||||
import ghidra.framework.main.*;
|
||||
import ghidra.framework.model.*;
|
||||
|
|
|
@ -15,6 +15,12 @@
|
|||
*/
|
||||
package ghidra.app.plugin.core.blockmodel;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.util.ArrayList;
|
||||
import java.util.TreeMap;
|
||||
|
||||
import docking.options.editor.StringWithChoicesEditor;
|
||||
import docking.tool.ToolConstants;
|
||||
import ghidra.app.CorePluginPackage;
|
||||
import ghidra.app.plugin.PluginCategoryNames;
|
||||
import ghidra.app.plugin.ProgramPlugin;
|
||||
|
@ -31,12 +37,6 @@ import ghidra.util.datastruct.WeakDataStructureFactory;
|
|||
import ghidra.util.datastruct.WeakSet;
|
||||
import ghidra.util.exception.NotFoundException;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.util.ArrayList;
|
||||
import java.util.TreeMap;
|
||||
|
||||
import docking.options.editor.StringWithChoicesEditor;
|
||||
|
||||
/**
|
||||
* Provides a service for tracking the selected basic/subroutine block models for a tool.
|
||||
* Methods are provided for obtaining an instance of the active or arbitrary block model.
|
||||
|
@ -64,9 +64,9 @@ public class BlockModelServicePlugin extends ProgramPlugin
|
|||
private static final String SUB_OPTION = "Subroutine Block Model";
|
||||
|
||||
private TreeMap<String, BlockModelInfo> basicModelsByName =
|
||||
new TreeMap<String, BlockModelInfo>();
|
||||
new TreeMap<>();
|
||||
private TreeMap<String, BlockModelInfo> subroutineModelsByName =
|
||||
new TreeMap<String, BlockModelInfo>();
|
||||
new TreeMap<>();
|
||||
private BlockModelInfo activeBasicModel;
|
||||
private BlockModelInfo activeSubroutineModel;
|
||||
|
||||
|
@ -103,8 +103,7 @@ public class BlockModelServicePlugin extends ProgramPlugin
|
|||
info =
|
||||
new BlockModelInfo(OverlapCodeSubModel.OVERLAP_MODEL_NAME, OverlapCodeSubModel.class);
|
||||
subroutineModelsByName.put(OverlapCodeSubModel.OVERLAP_MODEL_NAME, info);
|
||||
info =
|
||||
new BlockModelInfo(IsolatedEntrySubModel.ISOLATED_MODEL_NAME,
|
||||
info = new BlockModelInfo(IsolatedEntrySubModel.ISOLATED_MODEL_NAME,
|
||||
IsolatedEntrySubModel.class);
|
||||
subroutineModelsByName.put(IsolatedEntrySubModel.ISOLATED_MODEL_NAME, info);
|
||||
info =
|
||||
|
@ -115,7 +114,7 @@ public class BlockModelServicePlugin extends ProgramPlugin
|
|||
selectedSubroutineModelName = availableModelNames[0];
|
||||
|
||||
// Install model selection option in Tool panel
|
||||
options = tool.getOptions("Tool");
|
||||
options = tool.getOptions(ToolConstants.TOOL_OPTIONS);
|
||||
editor = new StringWithChoicesEditor(availableModelNames);
|
||||
options.registerOption(SUB_OPTION, OptionType.STRING_TYPE, selectedSubroutineModelName,
|
||||
null, "The default subroutine model used when creating call graphs.", editor);
|
||||
|
@ -426,7 +425,7 @@ public class BlockModelServicePlugin extends ProgramPlugin
|
|||
String defaultModelName =
|
||||
(modelType == BASIC_MODEL) ? DEFAULT_BLOCK_MODEL_NAME : DEFAULT_SUBROUTINE_MODEL_NAME;
|
||||
|
||||
ArrayList<String> list = new ArrayList<String>();
|
||||
ArrayList<String> list = new ArrayList<>();
|
||||
for (String modelName : models.keySet()) {
|
||||
if (modelName.equals(defaultModelName)) {
|
||||
list.add(0, modelName);
|
||||
|
|
|
@ -18,13 +18,13 @@ package ghidra.app.plugin.core.checksums;
|
|||
import docking.ActionContext;
|
||||
import docking.action.DockingAction;
|
||||
import docking.action.MenuData;
|
||||
import docking.tool.ToolConstants;
|
||||
import ghidra.app.CorePluginPackage;
|
||||
import ghidra.app.plugin.PluginCategoryNames;
|
||||
import ghidra.app.plugin.ProgramPlugin;
|
||||
import ghidra.framework.plugintool.PluginInfo;
|
||||
import ghidra.framework.plugintool.PluginTool;
|
||||
import ghidra.framework.plugintool.util.PluginStatus;
|
||||
import ghidra.framework.plugintool.util.ToolConstants;
|
||||
import ghidra.program.model.listing.Program;
|
||||
import ghidra.program.util.ProgramSelection;
|
||||
import ghidra.util.HelpLocation;
|
||||
|
|
|
@ -19,6 +19,7 @@ import java.awt.event.KeyEvent;
|
|||
|
||||
import docking.ActionContext;
|
||||
import docking.action.*;
|
||||
import docking.tool.ToolConstants;
|
||||
import ghidra.app.CorePluginPackage;
|
||||
import ghidra.app.context.ListingActionContext;
|
||||
import ghidra.app.context.ListingContextAction;
|
||||
|
|
|
@ -32,6 +32,7 @@ import org.jdom.Element;
|
|||
import docking.ActionContext;
|
||||
import docking.action.DockingAction;
|
||||
import docking.action.MenuData;
|
||||
import docking.tool.ToolConstants;
|
||||
import docking.widgets.fieldpanel.*;
|
||||
import docking.widgets.fieldpanel.field.Field;
|
||||
import docking.widgets.fieldpanel.support.*;
|
||||
|
@ -57,7 +58,6 @@ import ghidra.framework.model.*;
|
|||
import ghidra.framework.options.*;
|
||||
import ghidra.framework.plugintool.*;
|
||||
import ghidra.framework.plugintool.util.PluginStatus;
|
||||
import ghidra.framework.plugintool.util.ToolConstants;
|
||||
import ghidra.program.model.address.*;
|
||||
import ghidra.program.model.listing.*;
|
||||
import ghidra.program.util.ProgramLocation;
|
||||
|
|
|
@ -17,9 +17,9 @@ package ghidra.app.plugin.core.codebrowser.actions;
|
|||
|
||||
import docking.ActionContext;
|
||||
import docking.action.MenuData;
|
||||
import docking.tool.ToolConstants;
|
||||
import ghidra.app.plugin.core.codebrowser.CodeViewerProvider;
|
||||
import ghidra.app.util.HelpTopics;
|
||||
import ghidra.framework.plugintool.util.ToolConstants;
|
||||
import ghidra.program.util.ProgramSelection;
|
||||
import ghidra.util.HelpLocation;
|
||||
|
||||
|
|
|
@ -22,12 +22,12 @@ import javax.swing.KeyStroke;
|
|||
|
||||
import docking.action.KeyBindingData;
|
||||
import docking.action.MenuData;
|
||||
import docking.tool.ToolConstants;
|
||||
import ghidra.app.nav.Navigatable;
|
||||
import ghidra.app.plugin.core.codebrowser.CodeViewerActionContext;
|
||||
import ghidra.app.services.GoToService;
|
||||
import ghidra.app.util.HelpTopics;
|
||||
import ghidra.framework.plugintool.PluginTool;
|
||||
import ghidra.framework.plugintool.util.ToolConstants;
|
||||
import ghidra.program.model.address.Address;
|
||||
import ghidra.program.model.listing.*;
|
||||
import ghidra.program.util.FunctionSignatureFieldLocation;
|
||||
|
|
|
@ -22,12 +22,12 @@ import javax.swing.KeyStroke;
|
|||
|
||||
import docking.action.KeyBindingData;
|
||||
import docking.action.MenuData;
|
||||
import docking.tool.ToolConstants;
|
||||
import ghidra.app.nav.Navigatable;
|
||||
import ghidra.app.plugin.core.codebrowser.CodeViewerActionContext;
|
||||
import ghidra.app.services.GoToService;
|
||||
import ghidra.app.util.HelpTopics;
|
||||
import ghidra.framework.plugintool.PluginTool;
|
||||
import ghidra.framework.plugintool.util.ToolConstants;
|
||||
import ghidra.program.model.address.Address;
|
||||
import ghidra.program.model.listing.*;
|
||||
import ghidra.program.util.FunctionSignatureFieldLocation;
|
||||
|
|
|
@ -17,7 +17,6 @@ package ghidra.app.plugin.core.codebrowser.actions;
|
|||
|
||||
import ghidra.app.plugin.core.codebrowser.CodeViewerProvider;
|
||||
import ghidra.app.util.HelpTopics;
|
||||
import ghidra.framework.plugintool.util.ToolConstants;
|
||||
import ghidra.util.HelpLocation;
|
||||
|
||||
import java.awt.event.InputEvent;
|
||||
|
@ -26,6 +25,7 @@ import java.awt.event.KeyEvent;
|
|||
import docking.ActionContext;
|
||||
import docking.action.KeyBindingData;
|
||||
import docking.action.MenuData;
|
||||
import docking.tool.ToolConstants;
|
||||
|
||||
/**
|
||||
* Action for adding all fields to the current format.
|
||||
|
|
|
@ -17,11 +17,11 @@ package ghidra.app.plugin.core.codebrowser.actions;
|
|||
import ghidra.app.plugin.core.codebrowser.CodeViewerActionContext;
|
||||
import ghidra.app.plugin.core.codebrowser.CodeViewerProvider;
|
||||
import ghidra.app.util.HelpTopics;
|
||||
import ghidra.framework.plugintool.util.ToolConstants;
|
||||
import ghidra.program.util.ProgramSelection;
|
||||
import ghidra.util.HelpLocation;
|
||||
import docking.ActionContext;
|
||||
import docking.action.MenuData;
|
||||
import docking.tool.ToolConstants;
|
||||
|
||||
/**
|
||||
* Action for changing the selection to the complement of all the currently
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
/* ###
|
||||
* IP: GHIDRA
|
||||
* REVIEWED: YES
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -21,10 +20,10 @@ import ghidra.app.nav.NextRangeAction;
|
|||
import ghidra.app.plugin.PluginCategoryNames;
|
||||
import ghidra.app.plugin.core.navigation.NavigationOptions;
|
||||
import ghidra.framework.plugintool.PluginTool;
|
||||
import ghidra.framework.plugintool.util.ToolConstants;
|
||||
import ghidra.program.util.ProgramSelection;
|
||||
import ghidra.util.HelpLocation;
|
||||
import docking.action.MenuData;
|
||||
import docking.tool.ToolConstants;
|
||||
|
||||
public class NextColorRangeAction extends NextRangeAction {
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
/* ###
|
||||
* IP: GHIDRA
|
||||
* REVIEWED: YES
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -21,10 +20,10 @@ import ghidra.app.nav.PreviousRangeAction;
|
|||
import ghidra.app.plugin.PluginCategoryNames;
|
||||
import ghidra.app.plugin.core.navigation.NavigationOptions;
|
||||
import ghidra.framework.plugintool.PluginTool;
|
||||
import ghidra.framework.plugintool.util.ToolConstants;
|
||||
import ghidra.program.util.ProgramSelection;
|
||||
import ghidra.util.HelpLocation;
|
||||
import docking.action.MenuData;
|
||||
import docking.tool.ToolConstants;
|
||||
|
||||
public class PreviousColorRangeAction extends PreviousRangeAction {
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@ import javax.swing.SwingUtilities;
|
|||
import docking.ActionContext;
|
||||
import docking.action.DockingAction;
|
||||
import docking.action.MenuData;
|
||||
import docking.tool.ToolConstants;
|
||||
import docking.widgets.OptionDialog;
|
||||
import ghidra.app.CorePluginPackage;
|
||||
import ghidra.app.plugin.PluginCategoryNames;
|
||||
|
@ -37,7 +38,6 @@ import ghidra.framework.options.SaveState;
|
|||
import ghidra.framework.plugintool.PluginInfo;
|
||||
import ghidra.framework.plugintool.PluginTool;
|
||||
import ghidra.framework.plugintool.util.PluginStatus;
|
||||
import ghidra.framework.plugintool.util.ToolConstants;
|
||||
import ghidra.program.database.data.ProgramDataTypeManager;
|
||||
import ghidra.program.model.data.*;
|
||||
import ghidra.program.model.listing.Program;
|
||||
|
|
|
@ -18,6 +18,7 @@ package ghidra.app.plugin.core.disassembler;
|
|||
import docking.ActionContext;
|
||||
import docking.action.DockingAction;
|
||||
import docking.action.MenuData;
|
||||
import docking.tool.ToolConstants;
|
||||
import docking.widgets.table.GTable;
|
||||
import docking.widgets.table.threaded.ThreadedTableModelListener;
|
||||
import ghidra.app.CorePluginPackage;
|
||||
|
@ -32,7 +33,6 @@ import ghidra.framework.model.*;
|
|||
import ghidra.framework.plugintool.PluginInfo;
|
||||
import ghidra.framework.plugintool.PluginTool;
|
||||
import ghidra.framework.plugintool.util.PluginStatus;
|
||||
import ghidra.framework.plugintool.util.ToolConstants;
|
||||
import ghidra.program.model.address.Address;
|
||||
import ghidra.program.model.address.AddressSetView;
|
||||
import ghidra.program.model.lang.RegisterValue;
|
||||
|
|
|
@ -20,6 +20,7 @@ import java.util.Map;
|
|||
import docking.ActionContext;
|
||||
import docking.action.DockingAction;
|
||||
import docking.action.MenuData;
|
||||
import docking.tool.ToolConstants;
|
||||
import ghidra.app.CorePluginPackage;
|
||||
import ghidra.app.context.ProgramActionContext;
|
||||
import ghidra.app.context.ProgramContextAction;
|
||||
|
@ -33,7 +34,6 @@ import ghidra.framework.main.datatable.ProjectDataContextAction;
|
|||
import ghidra.framework.model.DomainFile;
|
||||
import ghidra.framework.plugintool.*;
|
||||
import ghidra.framework.plugintool.util.PluginStatus;
|
||||
import ghidra.framework.plugintool.util.ToolConstants;
|
||||
import ghidra.program.model.listing.Program;
|
||||
import ghidra.util.HelpLocation;
|
||||
|
||||
|
|
|
@ -27,6 +27,7 @@ import docking.action.DockingAction;
|
|||
import docking.action.MenuData;
|
||||
import docking.dnd.GClipboard;
|
||||
import docking.dnd.StringTransferable;
|
||||
import docking.tool.ToolConstants;
|
||||
import docking.widgets.table.AbstractSortedTableModel;
|
||||
import docking.widgets.table.GTable;
|
||||
import ghidra.app.CorePluginPackage;
|
||||
|
|
|
@ -19,6 +19,7 @@ import java.awt.event.InputEvent;
|
|||
import java.awt.event.KeyEvent;
|
||||
|
||||
import docking.action.*;
|
||||
import docking.tool.ToolConstants;
|
||||
import ghidra.app.CorePluginPackage;
|
||||
import ghidra.app.context.NavigatableActionContext;
|
||||
import ghidra.app.context.NavigatableContextAction;
|
||||
|
@ -28,7 +29,6 @@ import ghidra.app.plugin.PluginCategoryNames;
|
|||
import ghidra.app.services.GoToService;
|
||||
import ghidra.framework.plugintool.*;
|
||||
import ghidra.framework.plugintool.util.PluginStatus;
|
||||
import ghidra.framework.plugintool.util.ToolConstants;
|
||||
import ghidra.program.util.InteriorSelection;
|
||||
import ghidra.program.util.ProgramSelection;
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@ import java.util.Set;
|
|||
|
||||
import docking.action.DockingAction;
|
||||
import docking.action.MenuData;
|
||||
import docking.tool.ToolConstants;
|
||||
import ghidra.app.CorePluginPackage;
|
||||
import ghidra.app.context.*;
|
||||
import ghidra.app.plugin.PluginCategoryNames;
|
||||
|
@ -31,7 +32,6 @@ import ghidra.app.util.query.TableService;
|
|||
import ghidra.framework.plugintool.PluginInfo;
|
||||
import ghidra.framework.plugintool.PluginTool;
|
||||
import ghidra.framework.plugintool.util.PluginStatus;
|
||||
import ghidra.framework.plugintool.util.ToolConstants;
|
||||
import ghidra.program.model.address.*;
|
||||
import ghidra.program.model.listing.*;
|
||||
import ghidra.program.model.mem.MemoryBlock;
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
/* ###
|
||||
* IP: GHIDRA
|
||||
* REVIEWED: YES
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -19,12 +18,12 @@ package ghidra.app.plugin.core.label;
|
|||
import ghidra.app.context.ListingActionContext;
|
||||
import ghidra.app.context.ListingContextAction;
|
||||
import ghidra.framework.plugintool.PluginTool;
|
||||
import ghidra.framework.plugintool.util.ToolConstants;
|
||||
|
||||
import java.awt.event.KeyEvent;
|
||||
|
||||
import docking.action.KeyBindingData;
|
||||
import docking.action.MenuData;
|
||||
import docking.tool.ToolConstants;
|
||||
|
||||
public class AllHistoryAction extends ListingContextAction {
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@ package ghidra.app.plugin.core.navigation;
|
|||
import javax.swing.*;
|
||||
|
||||
import docking.action.*;
|
||||
import docking.tool.ToolConstants;
|
||||
import ghidra.app.context.ListingActionContext;
|
||||
import ghidra.app.nav.Navigatable;
|
||||
import ghidra.app.plugin.core.codebrowser.CodeViewerActionContext;
|
||||
|
@ -25,7 +26,6 @@ import ghidra.app.plugin.core.codebrowser.actions.CodeViewerContextAction;
|
|||
import ghidra.app.services.GoToService;
|
||||
import ghidra.app.util.HelpTopics;
|
||||
import ghidra.framework.plugintool.PluginTool;
|
||||
import ghidra.framework.plugintool.util.ToolConstants;
|
||||
import ghidra.program.model.address.Address;
|
||||
import ghidra.program.model.listing.Program;
|
||||
import ghidra.program.util.AddressFieldLocation;
|
||||
|
|
|
@ -18,6 +18,7 @@ package ghidra.app.plugin.core.navigation;
|
|||
import java.awt.event.KeyEvent;
|
||||
|
||||
import docking.action.*;
|
||||
import docking.tool.ToolConstants;
|
||||
import ghidra.GhidraOptions;
|
||||
import ghidra.app.CorePluginPackage;
|
||||
import ghidra.app.context.NavigatableActionContext;
|
||||
|
|
|
@ -19,6 +19,7 @@ import java.util.*;
|
|||
|
||||
import org.jdom.Element;
|
||||
|
||||
import docking.tool.ToolConstants;
|
||||
import ghidra.app.CorePluginPackage;
|
||||
import ghidra.app.events.ProgramClosedPluginEvent;
|
||||
import ghidra.app.nav.*;
|
||||
|
@ -27,7 +28,6 @@ import ghidra.app.services.*;
|
|||
import ghidra.framework.options.*;
|
||||
import ghidra.framework.plugintool.*;
|
||||
import ghidra.framework.plugintool.util.PluginStatus;
|
||||
import ghidra.framework.plugintool.util.ToolConstants;
|
||||
import ghidra.program.model.listing.Program;
|
||||
import ghidra.util.Msg;
|
||||
import ghidra.util.bean.opteditor.OptionsVetoException;
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
/* ###
|
||||
* IP: GHIDRA
|
||||
* REVIEWED: YES
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -21,7 +20,6 @@ import ghidra.app.nav.NextRangeAction;
|
|||
import ghidra.app.plugin.PluginCategoryNames;
|
||||
import ghidra.app.util.HelpTopics;
|
||||
import ghidra.framework.plugintool.PluginTool;
|
||||
import ghidra.framework.plugintool.util.ToolConstants;
|
||||
import ghidra.program.util.ProgramSelection;
|
||||
import ghidra.util.HelpLocation;
|
||||
|
||||
|
@ -30,6 +28,7 @@ import java.awt.event.KeyEvent;
|
|||
|
||||
import resources.ResourceManager;
|
||||
import docking.action.*;
|
||||
import docking.tool.ToolConstants;
|
||||
|
||||
public class NextHighlightedRangeAction extends NextRangeAction {
|
||||
|
||||
|
|
|
@ -32,6 +32,7 @@ import javax.swing.Icon;
|
|||
|
||||
import resources.ResourceManager;
|
||||
import docking.action.*;
|
||||
import docking.tool.ToolConstants;
|
||||
|
||||
/**
|
||||
* The NextPrevCodeUnitPlugin generates a GoTo event based on where the cursor
|
||||
|
|
|
@ -26,6 +26,7 @@ import docking.ActionContext;
|
|||
import docking.action.*;
|
||||
import docking.menu.ActionState;
|
||||
import docking.menu.MultiStateDockingAction;
|
||||
import docking.tool.ToolConstants;
|
||||
import docking.widgets.EventTrigger;
|
||||
import ghidra.app.context.ListingActionContext;
|
||||
import ghidra.app.nav.Navigatable;
|
||||
|
@ -33,7 +34,6 @@ import ghidra.app.plugin.core.codebrowser.CodeViewerActionContext;
|
|||
import ghidra.app.services.GoToService;
|
||||
import ghidra.app.util.HelpTopics;
|
||||
import ghidra.framework.plugintool.PluginTool;
|
||||
import ghidra.framework.plugintool.util.ToolConstants;
|
||||
import ghidra.program.model.address.Address;
|
||||
import ghidra.program.model.listing.*;
|
||||
import ghidra.util.HelpLocation;
|
||||
|
|
|
@ -26,6 +26,7 @@ import docking.ActionContext;
|
|||
import docking.action.*;
|
||||
import docking.menu.ActionState;
|
||||
import docking.menu.MultiStateDockingAction;
|
||||
import docking.tool.ToolConstants;
|
||||
import docking.widgets.EventTrigger;
|
||||
import ghidra.app.context.ListingActionContext;
|
||||
import ghidra.app.nav.Navigatable;
|
||||
|
@ -34,7 +35,6 @@ import ghidra.app.services.GoToService;
|
|||
import ghidra.app.services.MarkerSet;
|
||||
import ghidra.app.util.HelpTopics;
|
||||
import ghidra.framework.plugintool.PluginTool;
|
||||
import ghidra.framework.plugintool.util.ToolConstants;
|
||||
import ghidra.program.model.address.Address;
|
||||
import ghidra.program.model.listing.BookmarkType;
|
||||
import ghidra.util.HelpLocation;
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
/* ###
|
||||
* IP: GHIDRA
|
||||
* REVIEWED: YES
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -21,7 +20,6 @@ import ghidra.app.nav.NextRangeAction;
|
|||
import ghidra.app.plugin.PluginCategoryNames;
|
||||
import ghidra.app.util.HelpTopics;
|
||||
import ghidra.framework.plugintool.PluginTool;
|
||||
import ghidra.framework.plugintool.util.ToolConstants;
|
||||
import ghidra.program.util.ProgramSelection;
|
||||
import ghidra.util.HelpLocation;
|
||||
|
||||
|
@ -30,6 +28,7 @@ import java.awt.event.KeyEvent;
|
|||
|
||||
import resources.ResourceManager;
|
||||
import docking.action.*;
|
||||
import docking.tool.ToolConstants;
|
||||
|
||||
public class NextSelectedRangeAction extends NextRangeAction {
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
/* ###
|
||||
* IP: GHIDRA
|
||||
* REVIEWED: YES
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -21,7 +20,6 @@ import ghidra.app.nav.PreviousRangeAction;
|
|||
import ghidra.app.plugin.PluginCategoryNames;
|
||||
import ghidra.app.util.HelpTopics;
|
||||
import ghidra.framework.plugintool.PluginTool;
|
||||
import ghidra.framework.plugintool.util.ToolConstants;
|
||||
import ghidra.program.util.ProgramSelection;
|
||||
import ghidra.util.HelpLocation;
|
||||
|
||||
|
@ -30,6 +28,7 @@ import java.awt.event.KeyEvent;
|
|||
|
||||
import resources.ResourceManager;
|
||||
import docking.action.*;
|
||||
import docking.tool.ToolConstants;
|
||||
|
||||
public class PreviousHighlightedRangeAction extends PreviousRangeAction {
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
/* ###
|
||||
* IP: GHIDRA
|
||||
* REVIEWED: YES
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -21,7 +20,6 @@ import ghidra.app.nav.PreviousRangeAction;
|
|||
import ghidra.app.plugin.PluginCategoryNames;
|
||||
import ghidra.app.util.HelpTopics;
|
||||
import ghidra.framework.plugintool.PluginTool;
|
||||
import ghidra.framework.plugintool.util.ToolConstants;
|
||||
import ghidra.program.util.ProgramSelection;
|
||||
import ghidra.util.HelpLocation;
|
||||
|
||||
|
@ -32,6 +30,7 @@ import javax.swing.ImageIcon;
|
|||
|
||||
import resources.ResourceManager;
|
||||
import docking.action.*;
|
||||
import docking.tool.ToolConstants;
|
||||
|
||||
public class PreviousSelectedRangeAction extends PreviousRangeAction {
|
||||
|
||||
|
|
|
@ -22,11 +22,11 @@ import javax.swing.KeyStroke;
|
|||
|
||||
import docking.*;
|
||||
import docking.action.*;
|
||||
import docking.tool.ToolConstants;
|
||||
import ghidra.app.CorePluginPackage;
|
||||
import ghidra.app.plugin.PluginCategoryNames;
|
||||
import ghidra.framework.plugintool.*;
|
||||
import ghidra.framework.plugintool.util.PluginStatus;
|
||||
import ghidra.framework.plugintool.util.ToolConstants;
|
||||
import ghidra.util.HelpLocation;
|
||||
|
||||
//@formatter:off
|
||||
|
|
|
@ -26,6 +26,7 @@ import javax.swing.SwingUtilities;
|
|||
|
||||
import docking.ActionContext;
|
||||
import docking.action.*;
|
||||
import docking.tool.ToolConstants;
|
||||
import docking.widgets.fieldpanel.*;
|
||||
import docking.widgets.fieldpanel.support.AnchoredLayout;
|
||||
import ghidra.app.CorePluginPackage;
|
||||
|
@ -36,7 +37,6 @@ import ghidra.app.util.viewer.util.AddressIndexMap;
|
|||
import ghidra.framework.plugintool.PluginInfo;
|
||||
import ghidra.framework.plugintool.PluginTool;
|
||||
import ghidra.framework.plugintool.util.PluginStatus;
|
||||
import ghidra.framework.plugintool.util.ToolConstants;
|
||||
import ghidra.program.model.address.*;
|
||||
import ghidra.program.model.listing.Program;
|
||||
import ghidra.util.HelpLocation;
|
||||
|
|
|
@ -24,6 +24,7 @@ import javax.swing.Timer;
|
|||
import docking.ActionContext;
|
||||
import docking.DockingUtils;
|
||||
import docking.action.*;
|
||||
import docking.tool.ToolConstants;
|
||||
import ghidra.app.CorePluginPackage;
|
||||
import ghidra.app.events.*;
|
||||
import ghidra.app.plugin.PluginCategoryNames;
|
||||
|
@ -32,7 +33,6 @@ import ghidra.app.services.ProgramManager;
|
|||
import ghidra.framework.model.*;
|
||||
import ghidra.framework.plugintool.*;
|
||||
import ghidra.framework.plugintool.util.PluginStatus;
|
||||
import ghidra.framework.plugintool.util.ToolConstants;
|
||||
import ghidra.program.model.listing.Program;
|
||||
import ghidra.util.HelpLocation;
|
||||
|
||||
|
|
|
@ -30,6 +30,7 @@ import javax.swing.Icon;
|
|||
import docking.ActionContext;
|
||||
import docking.action.*;
|
||||
import docking.options.editor.*;
|
||||
import docking.tool.ToolConstants;
|
||||
import ghidra.app.CorePluginPackage;
|
||||
import ghidra.app.context.ProgramActionContext;
|
||||
import ghidra.app.context.ProgramContextAction;
|
||||
|
@ -46,7 +47,6 @@ import ghidra.framework.model.*;
|
|||
import ghidra.framework.options.*;
|
||||
import ghidra.framework.plugintool.*;
|
||||
import ghidra.framework.plugintool.util.PluginStatus;
|
||||
import ghidra.framework.plugintool.util.ToolConstants;
|
||||
import ghidra.framework.protocol.ghidra.*;
|
||||
import ghidra.program.database.ProgramContentHandler;
|
||||
import ghidra.program.model.address.*;
|
||||
|
|
|
@ -22,12 +22,12 @@ import javax.swing.Icon;
|
|||
|
||||
import docking.ActionContext;
|
||||
import docking.action.*;
|
||||
import docking.tool.ToolConstants;
|
||||
import ghidra.app.context.ProgramActionContext;
|
||||
import ghidra.app.context.ProgramContextAction;
|
||||
import ghidra.app.services.GoToService;
|
||||
import ghidra.app.services.NavigationHistoryService;
|
||||
import ghidra.framework.plugintool.PluginTool;
|
||||
import ghidra.framework.plugintool.util.ToolConstants;
|
||||
import ghidra.program.model.listing.Program;
|
||||
import ghidra.util.*;
|
||||
import resources.ResourceManager;
|
||||
|
@ -38,7 +38,7 @@ public class RedoAction extends ProgramContextAction {
|
|||
public RedoAction(PluginTool tool, String owner) {
|
||||
super("Redo", owner);
|
||||
this.tool = tool;
|
||||
setHelpLocation(new HelpLocation("Tool", "Redo"));
|
||||
setHelpLocation(new HelpLocation(ToolConstants.TOOL_HELP_TOPIC, "Redo"));
|
||||
String[] menuPath = { ToolConstants.MENU_EDIT, "&Redo" };
|
||||
String group = "Undo";
|
||||
Icon icon = ResourceManager.loadImage("images/redo.png");
|
||||
|
|
|
@ -22,12 +22,12 @@ import javax.swing.Icon;
|
|||
|
||||
import docking.ActionContext;
|
||||
import docking.action.*;
|
||||
import docking.tool.ToolConstants;
|
||||
import ghidra.app.context.ProgramActionContext;
|
||||
import ghidra.app.context.ProgramContextAction;
|
||||
import ghidra.app.services.GoToService;
|
||||
import ghidra.app.services.NavigationHistoryService;
|
||||
import ghidra.framework.plugintool.PluginTool;
|
||||
import ghidra.framework.plugintool.util.ToolConstants;
|
||||
import ghidra.program.model.listing.Program;
|
||||
import ghidra.util.*;
|
||||
import resources.ResourceManager;
|
||||
|
@ -38,7 +38,7 @@ public class UndoAction extends ProgramContextAction {
|
|||
public UndoAction(PluginTool tool, String owner) {
|
||||
super("Undo", owner);
|
||||
this.tool = tool;
|
||||
setHelpLocation(new HelpLocation("Tool", "Undo"));
|
||||
setHelpLocation(new HelpLocation(ToolConstants.TOOL_HELP_TOPIC, "Undo"));
|
||||
String[] menuPath = { ToolConstants.MENU_EDIT, "&Undo" };
|
||||
Icon icon = ResourceManager.loadImage("images/undo.png");
|
||||
MenuData menuData = new MenuData(menuPath, icon, "Undo");
|
||||
|
|
|
@ -19,6 +19,7 @@ import java.util.*;
|
|||
|
||||
import docking.action.DockingAction;
|
||||
import docking.action.MenuData;
|
||||
import docking.tool.ToolConstants;
|
||||
import ghidra.app.CorePluginPackage;
|
||||
import ghidra.app.context.*;
|
||||
import ghidra.app.events.ViewChangedPluginEvent;
|
||||
|
@ -29,7 +30,6 @@ import ghidra.framework.model.*;
|
|||
import ghidra.framework.plugintool.PluginInfo;
|
||||
import ghidra.framework.plugintool.PluginTool;
|
||||
import ghidra.framework.plugintool.util.PluginStatus;
|
||||
import ghidra.framework.plugintool.util.ToolConstants;
|
||||
import ghidra.program.model.listing.Program;
|
||||
import ghidra.program.util.ChangeManager;
|
||||
import ghidra.util.HelpLocation;
|
||||
|
|
|
@ -30,13 +30,13 @@ import docking.ActionContext;
|
|||
import docking.DockingUtils;
|
||||
import docking.action.*;
|
||||
import docking.actions.KeyBindingUtils;
|
||||
import docking.tool.ToolConstants;
|
||||
import docking.widgets.table.GTable;
|
||||
import generic.jar.ResourceFile;
|
||||
import ghidra.app.script.GhidraScriptUtil;
|
||||
import ghidra.app.script.ScriptInfo;
|
||||
import ghidra.framework.Application;
|
||||
import ghidra.framework.options.SaveState;
|
||||
import ghidra.framework.plugintool.util.ToolConstants;
|
||||
import ghidra.util.*;
|
||||
import ghidra.util.task.*;
|
||||
import resources.Icons;
|
||||
|
|
|
@ -25,6 +25,7 @@ import javax.swing.JComponent;
|
|||
|
||||
import docking.*;
|
||||
import docking.action.*;
|
||||
import docking.tool.ToolConstants;
|
||||
import docking.widgets.fieldpanel.support.Highlight;
|
||||
import docking.widgets.table.threaded.*;
|
||||
import ghidra.GhidraOptions;
|
||||
|
@ -44,7 +45,6 @@ import ghidra.framework.model.DomainObject;
|
|||
import ghidra.framework.options.*;
|
||||
import ghidra.framework.plugintool.*;
|
||||
import ghidra.framework.plugintool.util.PluginStatus;
|
||||
import ghidra.framework.plugintool.util.ToolConstants;
|
||||
import ghidra.program.model.address.Address;
|
||||
import ghidra.program.model.listing.CodeUnit;
|
||||
import ghidra.program.model.listing.Program;
|
||||
|
|
|
@ -27,6 +27,7 @@ import javax.swing.ImageIcon;
|
|||
|
||||
import docking.*;
|
||||
import docking.action.*;
|
||||
import docking.tool.ToolConstants;
|
||||
import docking.widgets.fieldpanel.support.Highlight;
|
||||
import docking.widgets.table.threaded.*;
|
||||
import ghidra.GhidraOptions;
|
||||
|
@ -49,7 +50,6 @@ import ghidra.framework.options.ToolOptions;
|
|||
import ghidra.framework.plugintool.PluginInfo;
|
||||
import ghidra.framework.plugintool.PluginTool;
|
||||
import ghidra.framework.plugintool.util.PluginStatus;
|
||||
import ghidra.framework.plugintool.util.ToolConstants;
|
||||
import ghidra.program.model.address.*;
|
||||
import ghidra.program.model.listing.*;
|
||||
import ghidra.program.model.mem.Memory;
|
||||
|
|
|
@ -34,6 +34,7 @@ import java.util.Map;
|
|||
import docking.ActionContext;
|
||||
import docking.action.DockingAction;
|
||||
import docking.action.MenuData;
|
||||
import docking.tool.ToolConstants;
|
||||
|
||||
//@formatter:off
|
||||
@PluginInfo(
|
||||
|
|
|
@ -27,6 +27,7 @@ import docking.ActionContext;
|
|||
import docking.ComponentProvider;
|
||||
import docking.action.DockingAction;
|
||||
import docking.action.MenuData;
|
||||
import docking.tool.ToolConstants;
|
||||
|
||||
/**
|
||||
* This plugin class contains the structure needed for the user to
|
||||
|
|
|
@ -18,11 +18,11 @@ package ghidra.app.plugin.core.select.flow;
|
|||
import ghidra.app.context.ListingActionContext;
|
||||
import ghidra.app.context.ListingContextAction;
|
||||
import ghidra.app.util.HelpTopics;
|
||||
import ghidra.framework.plugintool.util.ToolConstants;
|
||||
import ghidra.program.model.address.Address;
|
||||
import ghidra.program.model.listing.CodeUnit;
|
||||
import ghidra.util.HelpLocation;
|
||||
import docking.action.MenuData;
|
||||
import docking.tool.ToolConstants;
|
||||
|
||||
/**
|
||||
* <CODE>SelectByFlowAction</CODE> allows the user to Select Code By Flowing from
|
||||
|
|
|
@ -19,6 +19,7 @@ import java.util.*;
|
|||
|
||||
import docking.action.DockingAction;
|
||||
import docking.action.MenuData;
|
||||
import docking.tool.ToolConstants;
|
||||
import edu.uci.ics.jung.graph.DirectedSparseGraph;
|
||||
import edu.uci.ics.jung.graph.Graph;
|
||||
import ghidra.app.CorePluginPackage;
|
||||
|
@ -29,7 +30,6 @@ import ghidra.app.plugin.ProgramPlugin;
|
|||
import ghidra.framework.plugintool.PluginInfo;
|
||||
import ghidra.framework.plugintool.PluginTool;
|
||||
import ghidra.framework.plugintool.util.PluginStatus;
|
||||
import ghidra.framework.plugintool.util.ToolConstants;
|
||||
import ghidra.graph.GDirectedGraph;
|
||||
import ghidra.graph.GraphAlgorithms;
|
||||
import ghidra.graph.jung.JungToGDirectedGraphAdapter;
|
||||
|
|
|
@ -17,6 +17,7 @@ package ghidra.app.plugin.core.select.qualified;
|
|||
|
||||
import docking.action.DockingAction;
|
||||
import docking.action.MenuData;
|
||||
import docking.tool.ToolConstants;
|
||||
import ghidra.app.CorePluginPackage;
|
||||
import ghidra.app.context.*;
|
||||
import ghidra.app.events.ProgramSelectionPluginEvent;
|
||||
|
|
|
@ -19,6 +19,7 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
import docking.action.MenuData;
|
||||
import docking.tool.ToolConstants;
|
||||
import ghidra.app.CorePluginPackage;
|
||||
import ghidra.app.context.NavigatableActionContext;
|
||||
import ghidra.app.context.NavigatableContextAction;
|
||||
|
@ -29,7 +30,6 @@ import ghidra.app.util.HelpTopics;
|
|||
import ghidra.framework.plugintool.PluginInfo;
|
||||
import ghidra.framework.plugintool.PluginTool;
|
||||
import ghidra.framework.plugintool.util.PluginStatus;
|
||||
import ghidra.framework.plugintool.util.ToolConstants;
|
||||
import ghidra.program.model.address.*;
|
||||
import ghidra.program.model.listing.Program;
|
||||
import ghidra.program.util.ProgramSelection;
|
||||
|
|
|
@ -22,11 +22,12 @@ import java.util.List;
|
|||
import docking.ActionContext;
|
||||
import docking.action.DockingAction;
|
||||
import docking.action.MenuData;
|
||||
import docking.tool.ToolConstants;
|
||||
import ghidra.app.CorePluginPackage;
|
||||
import ghidra.app.plugin.PluginCategoryNames;
|
||||
import ghidra.framework.main.FrontEndOnly;
|
||||
import ghidra.framework.plugintool.*;
|
||||
import ghidra.framework.plugintool.util.*;
|
||||
import ghidra.framework.plugintool.util.PluginStatus;
|
||||
import ghidra.framework.preferences.Preferences;
|
||||
import ghidra.util.HelpLocation;
|
||||
import ghidra.util.SystemUtilities;
|
||||
|
@ -63,7 +64,7 @@ public class TipOfTheDayPlugin extends Plugin implements FrontEndOnly {
|
|||
ToolConstants.HELP_CONTENTS_MENU_GROUP));
|
||||
|
||||
action.setEnabled(true);
|
||||
action.setHelpLocation(new HelpLocation("Tool", "Tip_of_the_day"));
|
||||
action.setHelpLocation(new HelpLocation(ToolConstants.TOOL_HELP_TOPIC, "Tip_of_the_day"));
|
||||
tool.addAction(action);
|
||||
|
||||
List<String> tips = null;
|
||||
|
|
|
@ -33,6 +33,7 @@ import java.util.*;
|
|||
import docking.ActionContext;
|
||||
import docking.action.DockingAction;
|
||||
import docking.action.MenuData;
|
||||
import docking.tool.ToolConstants;
|
||||
import docking.widgets.conditiontestpanel.ConditionTester;
|
||||
|
||||
/**
|
||||
|
|
|
@ -27,13 +27,13 @@ import docking.action.DockingAction;
|
|||
import docking.action.MenuData;
|
||||
import docking.actions.SharedStubKeyBindingAction;
|
||||
import docking.help.*;
|
||||
import docking.tool.ToolConstants;
|
||||
import ghidra.app.DeveloperPluginPackage;
|
||||
import ghidra.app.plugin.PluginCategoryNames;
|
||||
import ghidra.framework.main.FrontEndable;
|
||||
import ghidra.framework.model.Project;
|
||||
import ghidra.framework.plugintool.*;
|
||||
import ghidra.framework.plugintool.util.PluginStatus;
|
||||
import ghidra.framework.plugintool.util.ToolConstants;
|
||||
import ghidra.util.HelpLocation;
|
||||
import ghidra.util.Msg;
|
||||
import ghidra.util.task.*;
|
||||
|
|
|
@ -20,6 +20,7 @@ import static ghidra.docking.util.DockingWindowsLookAndFeelUtils.*;
|
|||
import java.util.List;
|
||||
|
||||
import docking.options.editor.StringWithChoicesEditor;
|
||||
import docking.tool.ToolConstants;
|
||||
import docking.widgets.OptionDialog;
|
||||
import ghidra.app.CorePluginPackage;
|
||||
import ghidra.app.plugin.PluginCategoryNames;
|
||||
|
@ -49,7 +50,7 @@ public class LookAndFeelPlugin extends Plugin implements FrontEndOnly, OptionsCh
|
|||
private boolean useInvertedColors;
|
||||
public final static String LOOK_AND_FEEL_NAME = "Swing Look And Feel";
|
||||
private final static String USE_INVERTED_COLORS_NAME = "Use Inverted Colors";
|
||||
private final static String OPTIONS_TITLE = "Tool";
|
||||
private final static String OPTIONS_TITLE = ToolConstants.TOOL_OPTIONS;
|
||||
|
||||
private static boolean issuedLafNotification;
|
||||
private static boolean issuedPreferredDarkThemeLafNotification;
|
||||
|
@ -69,7 +70,7 @@ public class LookAndFeelPlugin extends Plugin implements FrontEndOnly, OptionsCh
|
|||
selectedLookAndFeel = getInstalledLookAndFeelName();
|
||||
List<String> lookAndFeelNames = getLookAndFeelNames();
|
||||
opt.registerOption(LOOK_AND_FEEL_NAME, OptionType.STRING_TYPE, selectedLookAndFeel,
|
||||
new HelpLocation("Tool", "Look_And_Feel"),
|
||||
new HelpLocation(ToolConstants.TOOL_HELP_TOPIC, "Look_And_Feel"),
|
||||
"Set the look and feel for Ghidra. After you change the " +
|
||||
"look and feel, you will have to restart Ghidra to see the effect.",
|
||||
new StringWithChoicesEditor(lookAndFeelNames));
|
||||
|
@ -77,7 +78,7 @@ public class LookAndFeelPlugin extends Plugin implements FrontEndOnly, OptionsCh
|
|||
|
||||
useInvertedColors = getUseInvertedColorsPreference();
|
||||
opt.registerOption(USE_INVERTED_COLORS_NAME, OptionType.BOOLEAN_TYPE, useInvertedColors,
|
||||
new HelpLocation("Tool", "Use_Inverted_Colors"),
|
||||
new HelpLocation(ToolConstants.TOOL_HELP_TOPIC, "Use_Inverted_Colors"),
|
||||
"Indicates to invert all drawn colors. This provides the ability to create an " +
|
||||
"effective 'Dark Theme' appearance. (Note: you may have to change your " +
|
||||
"Look and Feel to achieve the best rendering.)\n\n" +
|
||||
|
|
|
@ -25,6 +25,7 @@ import java.util.*;
|
|||
import docking.ActionContext;
|
||||
import docking.action.DockingAction;
|
||||
import docking.action.MenuData;
|
||||
import docking.tool.ToolConstants;
|
||||
import docking.widgets.filechooser.GhidraFileChooser;
|
||||
import ghidra.MiscellaneousPluginPackage;
|
||||
import ghidra.app.context.ListingActionContext;
|
||||
|
|
|
@ -35,6 +35,7 @@ import javax.swing.filechooser.FileNameExtensionFilter;
|
|||
|
||||
import docking.*;
|
||||
import docking.action.*;
|
||||
import docking.tool.ToolConstants;
|
||||
|
||||
//@formatter:off
|
||||
@PluginInfo(
|
||||
|
|
|
@ -28,6 +28,7 @@ import javax.swing.event.HyperlinkListener;
|
|||
|
||||
import docking.DialogComponentProvider;
|
||||
import docking.DockingWindowManager;
|
||||
import docking.tool.ToolConstants;
|
||||
import docking.widgets.HyperlinkComponent;
|
||||
import docking.widgets.checkbox.GCheckBox;
|
||||
import docking.widgets.combobox.GhidraComboBox;
|
||||
|
@ -39,7 +40,6 @@ import ghidra.framework.options.Options;
|
|||
import ghidra.framework.options.SaveState;
|
||||
import ghidra.framework.plugintool.Plugin;
|
||||
import ghidra.framework.plugintool.PluginTool;
|
||||
import ghidra.framework.plugintool.util.ToolConstants;
|
||||
import ghidra.program.model.address.Address;
|
||||
import ghidra.util.HelpLocation;
|
||||
import ghidra.util.task.TaskMonitorComponent;
|
||||
|
|
|
@ -29,6 +29,7 @@ import org.jdom.Element;
|
|||
import docking.ComponentProvider;
|
||||
import docking.DialogComponentProvider;
|
||||
import docking.test.AbstractDockingTest;
|
||||
import docking.tool.ToolConstants;
|
||||
import generic.jar.ResourceFile;
|
||||
import generic.test.*;
|
||||
import ghidra.app.events.CloseProgramPluginEvent;
|
||||
|
@ -887,7 +888,7 @@ public class TestEnv {
|
|||
protected void setAutoSaveEnabled(final FrontEndTool frontEndToolInstance,
|
||||
final boolean enabled) {
|
||||
AbstractGenericTest.runSwing(() -> {
|
||||
Options options = frontEndToolInstance.getOptions("Tool");
|
||||
Options options = frontEndToolInstance.getOptions(ToolConstants.TOOL_OPTIONS);
|
||||
options.setBoolean(FrontEndTool.AUTOMATICALLY_SAVE_TOOLS, enabled);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -25,6 +25,7 @@ import javax.swing.table.TableModel;
|
|||
|
||||
import docking.ActionContext;
|
||||
import docking.action.*;
|
||||
import docking.tool.ToolConstants;
|
||||
import docking.widgets.table.GTable;
|
||||
import docking.widgets.table.RowObjectTableModel;
|
||||
import docking.widgets.table.threaded.ThreadedTableModel;
|
||||
|
@ -194,7 +195,7 @@ public class DeleteTableRowAction extends DockingAction {
|
|||
private static class DummyDeleteAction extends DeleteTableRowAction {
|
||||
|
||||
public DummyDeleteAction(PluginTool tool) {
|
||||
super(NAME, "Tool", DEFAULT_KEYSTROKE);
|
||||
super(NAME, ToolConstants.TOOL_OWNER, DEFAULT_KEYSTROKE);
|
||||
|
||||
// prevent this action from appearing in the toolbar, menus, etc
|
||||
setToolBarData(null);
|
||||
|
|
|
@ -37,6 +37,7 @@ import docking.*;
|
|||
import docking.action.DockingActionIf;
|
||||
import docking.framework.ApplicationInformationDisplayFactory;
|
||||
import docking.options.editor.OptionsDialog;
|
||||
import docking.tool.ToolConstants;
|
||||
import docking.widgets.dialogs.SettingsDialog;
|
||||
import docking.widgets.fieldpanel.FieldPanel;
|
||||
import docking.widgets.fieldpanel.field.Field;
|
||||
|
@ -217,7 +218,7 @@ public abstract class AbstractScreenShotGenerator extends AbstractGhidraHeadedIn
|
|||
}
|
||||
|
||||
public void showOptions(final String optionsCategoryName) {
|
||||
performAction("Edit Options", "Tool", false);
|
||||
performAction("Edit Options", ToolConstants.TOOL_OWNER, false);
|
||||
final OptionsDialog dialog = (OptionsDialog) getDialog();
|
||||
runSwing(() -> dialog.displayCategory(optionsCategoryName, null));
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@ package docking;
|
|||
import static org.junit.Assert.*;
|
||||
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.swing.*;
|
||||
|
@ -228,7 +229,7 @@ public class ComponentProviderActionsTest extends AbstractGhidraHeadedIntegratio
|
|||
showProvider();
|
||||
|
||||
KeyStroke newKs = CONTROL_T;
|
||||
setKeyBindingViaF4Dialog_FromToolsToolbar(newKs);
|
||||
setKeyBindingViaF4Dialog_FromToolToolbar(newKs);
|
||||
|
||||
assertProviderKeyStroke(newKs);
|
||||
assertOptionsKeyStroke(newKs);
|
||||
|
@ -325,6 +326,19 @@ public class ComponentProviderActionsTest extends AbstractGhidraHeadedIntegratio
|
|||
assertToolbarActionHasIcon(newIcon);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSetCloseButtonKeyBinding() {
|
||||
|
||||
showProvider();
|
||||
|
||||
KeyStroke controlEsc =
|
||||
KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, DockingUtils.CONTROL_KEY_MODIFIER_MASK);
|
||||
setKeyBindingViaF4Dialog_FromCloseButton(controlEsc);
|
||||
|
||||
pressKey(controlEsc);
|
||||
assertProviderIsHidden();
|
||||
}
|
||||
|
||||
//==================================================================================================
|
||||
// Private Methods
|
||||
//==================================================================================================
|
||||
|
@ -420,6 +434,11 @@ public class ComponentProviderActionsTest extends AbstractGhidraHeadedIntegratio
|
|||
runSwing(() -> tool.isActive(provider)));
|
||||
}
|
||||
|
||||
private void assertProviderIsHidden() {
|
||||
assertFalse("The test provider is showing, but should be hidden",
|
||||
runSwing(() -> tool.isVisible(provider)));
|
||||
}
|
||||
|
||||
private void assertNoToolbarAction() {
|
||||
assertNull("No toolbar action found for provider", getToolbarShowProviderAction());
|
||||
}
|
||||
|
@ -492,6 +511,23 @@ public class ComponentProviderActionsTest extends AbstractGhidraHeadedIntegratio
|
|||
assertFalse("Invalid key stroke: " + ks, runSwing(() -> dialog.isVisible()));
|
||||
}
|
||||
|
||||
private void setKeyBindingViaF4Dialog_FromCloseButton(KeyStroke ks) {
|
||||
|
||||
// simulate the user mousing over the toolbar button
|
||||
DockingActionIf closeAction = getAction(tool, provider.getOwner(), "Close Window");
|
||||
assertNotNull("Provider action not installed in toolbar", closeAction);
|
||||
DockingWindowManager.setMouseOverAction(closeAction);
|
||||
|
||||
performLaunchKeyStrokeDialogAction();
|
||||
KeyEntryDialog dialog = waitForDialogComponent(KeyEntryDialog.class);
|
||||
|
||||
runSwing(() -> dialog.setKeyStroke(ks));
|
||||
|
||||
pressButtonByText(dialog, "OK");
|
||||
|
||||
assertFalse("Invalid key stroke: " + ks, runSwing(() -> dialog.isVisible()));
|
||||
}
|
||||
|
||||
private void applyBindingToDialog_FromWindowsMenu(KeyStroke ks) {
|
||||
DockingActionIf windowMenuAction = getWindowMenuShowProviderAction();
|
||||
DockingWindowManager.setMouseOverAction(windowMenuAction);
|
||||
|
@ -518,9 +554,9 @@ public class ComponentProviderActionsTest extends AbstractGhidraHeadedIntegratio
|
|||
expected, action.getKeyBinding());
|
||||
}
|
||||
|
||||
private void setKeyBindingViaF4Dialog_FromToolsToolbar(KeyStroke ks) {
|
||||
private void setKeyBindingViaF4Dialog_FromToolToolbar(KeyStroke ks) {
|
||||
|
||||
// simulate the user mousing over the 'Window' menu's action
|
||||
// simulate the user mousing over the toolbar button
|
||||
DockingActionIf toolbarAction = getToolbarShowProviderAction();
|
||||
assertNotNull("Provider action not installed in toolbar", toolbarAction);
|
||||
DockingWindowManager.setMouseOverAction(toolbarAction);
|
||||
|
|
|
@ -30,6 +30,7 @@ import org.junit.*;
|
|||
|
||||
import docking.ActionContext;
|
||||
import docking.action.DockingActionIf;
|
||||
import docking.tool.ToolConstants;
|
||||
import docking.widgets.MultiLineLabel;
|
||||
import docking.widgets.OptionDialog;
|
||||
import docking.widgets.table.GTable;
|
||||
|
@ -709,7 +710,7 @@ public class SearchTextPlugin1Test extends AbstractGhidraHeadedIntegrationTest {
|
|||
selectCheckBox(container, "Instruction Operands");
|
||||
deSelectCheckBox(container, "Comments");
|
||||
|
||||
Options options = tool.getOptions("Tool");
|
||||
Options options = tool.getOptions(ToolConstants.TOOL_OPTIONS);
|
||||
options.setInt("Search Limit", 50);
|
||||
|
||||
setText(tf, "sscanf");
|
||||
|
|
|
@ -25,6 +25,7 @@ import javax.swing.*;
|
|||
import org.junit.*;
|
||||
|
||||
import docking.action.DockingActionIf;
|
||||
import docking.tool.ToolConstants;
|
||||
import ghidra.app.plugin.core.codebrowser.CodeBrowserPlugin;
|
||||
import ghidra.app.plugin.core.codebrowser.CodeViewerProvider;
|
||||
import ghidra.app.plugin.core.table.TableServicePlugin;
|
||||
|
@ -616,7 +617,7 @@ public class SearchTextPlugin2Test extends AbstractGhidraHeadedIntegrationTest {
|
|||
|
||||
goToService.goTo(new ProgramLocation(program, getAddr(0x01002c92)));
|
||||
|
||||
Options options = tool.getOptions("Tool");
|
||||
Options options = tool.getOptions(ToolConstants.TOOL_OPTIONS);
|
||||
options.setInt("Search Limit", 20);
|
||||
|
||||
setTextAndPressEnter(tf, "eax");
|
||||
|
|
|
@ -25,6 +25,7 @@ import javax.swing.table.TableModel;
|
|||
import org.junit.*;
|
||||
|
||||
import docking.action.DockingActionIf;
|
||||
import docking.tool.ToolConstants;
|
||||
import docking.widgets.table.GTableFilterPanel;
|
||||
import docking.widgets.table.threaded.ThreadedTableModel;
|
||||
import ghidra.app.DeveloperPluginPackage;
|
||||
|
@ -255,7 +256,7 @@ public class ManagePluginsTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
|
||||
private void showProvider() {
|
||||
|
||||
DockingActionIf action = getAction(tool, "Tool", "Configure Tool");
|
||||
DockingActionIf action = getAction(tool, ToolConstants.TOOL_OWNER, "Configure Tool");
|
||||
performAction(action, true);
|
||||
waitForSwing();
|
||||
provider = tool.getManagePluginsDialog();
|
||||
|
|
|
@ -36,6 +36,7 @@ import org.junit.*;
|
|||
import docking.action.DockingActionIf;
|
||||
import docking.actions.KeyBindingUtils;
|
||||
import docking.options.editor.*;
|
||||
import docking.tool.ToolConstants;
|
||||
import docking.widgets.MultiLineLabel;
|
||||
import docking.widgets.filechooser.GhidraFileChooser;
|
||||
import docking.widgets.table.RowObjectFilterModel;
|
||||
|
@ -58,6 +59,7 @@ import ghidra.test.TestEnv;
|
|||
*/
|
||||
public class OptionsDialogTest extends AbstractGhidraHeadedIntegrationTest {
|
||||
|
||||
private static final String TOOL_NODE_NAME = "Tool";
|
||||
private PluginTool tool;
|
||||
private TestEnv env;
|
||||
private OptionsDialog dialog;
|
||||
|
@ -248,9 +250,9 @@ public class OptionsDialogTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
public void testShowMultiLevelOptions2() throws Exception {
|
||||
|
||||
Object root = treeModel.getRoot();
|
||||
Object toolNode = getGTreeNode(root, "Tool");
|
||||
Object toolNode = getGTreeNode(root, TOOL_NODE_NAME);
|
||||
|
||||
Options options = tool.getOptions("Tool");
|
||||
Options options = tool.getOptions(ToolConstants.TOOL_OPTIONS);
|
||||
List<String> optNames = options.getOptionNames();
|
||||
Collections.sort(optNames);
|
||||
for (String simpleName : optNames) {
|
||||
|
@ -276,7 +278,7 @@ public class OptionsDialogTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
@Test
|
||||
public void testFileChooserEditor() throws Exception {
|
||||
|
||||
ScrollableOptionsEditor editor = showOptions("Tool");
|
||||
ScrollableOptionsEditor editor = showOptions(ToolConstants.TOOL_OPTIONS);
|
||||
|
||||
pressBrowseButton(editor, "My PathName");
|
||||
|
||||
|
@ -301,7 +303,7 @@ public class OptionsDialogTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
@Test
|
||||
public void testFileChooserEditor_ClearValue() throws Exception {
|
||||
|
||||
ScrollableOptionsEditor editor = showOptions("Tool");
|
||||
ScrollableOptionsEditor editor = showOptions(ToolConstants.TOOL_OPTIONS);
|
||||
JTextField pathField = getEditorTextField(editor, "My PathName");
|
||||
|
||||
setText(pathField, "");
|
||||
|
@ -309,7 +311,7 @@ public class OptionsDialogTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
pressOptionsOk();
|
||||
|
||||
showOptionsDialog(tool);
|
||||
editor = showOptions("Tool");
|
||||
editor = showOptions(ToolConstants.TOOL_OPTIONS);
|
||||
pathField = getEditorTextField(editor, "My PathName");
|
||||
assertEquals("", pathField.getText());
|
||||
}
|
||||
|
@ -320,7 +322,7 @@ public class OptionsDialogTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
// test double click on color panel
|
||||
// verify the color editor is displayed
|
||||
Object root = treeModel.getRoot();
|
||||
Object toolNode = getGTreeNode(root, "Tool");
|
||||
Object toolNode = getGTreeNode(root, TOOL_NODE_NAME);
|
||||
selectNode(toolNode);
|
||||
assertTrue(!defaultPanel.isShowing());
|
||||
|
||||
|
@ -353,7 +355,7 @@ public class OptionsDialogTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
@Test
|
||||
public void testPropertySelectorEditor() throws Exception {
|
||||
Object root = treeModel.getRoot();
|
||||
Object toolNode = getGTreeNode(root, "Tool");
|
||||
Object toolNode = getGTreeNode(root, TOOL_NODE_NAME);
|
||||
assertTrue(defaultPanel.isShowing());
|
||||
|
||||
Object buttonNode = getGTreeNode(toolNode, "Mouse Buttons");
|
||||
|
@ -457,17 +459,17 @@ public class OptionsDialogTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
// Tests that options under a folder in the tree will properly restore default values
|
||||
//
|
||||
|
||||
boolean originalValue = getCurrentBooleanEditorValueForNestedOption("Tool", "My Options",
|
||||
"my sub group Boolean Value");
|
||||
boolean originalValue = getCurrentBooleanEditorValueForNestedOption(
|
||||
ToolConstants.TOOL_OPTIONS, "My Options", "my sub group Boolean Value");
|
||||
|
||||
setCurrentBooleanEditorValueForNestedOption("Tool", "My Options",
|
||||
setCurrentBooleanEditorValueForNestedOption(ToolConstants.TOOL_OPTIONS, "My Options",
|
||||
"my sub group Boolean Value", !originalValue);
|
||||
apply();
|
||||
|
||||
restoreDefaults();
|
||||
|
||||
boolean currentValue = getCurrentBooleanEditorValueForNestedOption("Tool", "My Options",
|
||||
"my sub group Boolean Value");
|
||||
boolean currentValue = getCurrentBooleanEditorValueForNestedOption(
|
||||
ToolConstants.TOOL_OPTIONS, "My Options", "my sub group Boolean Value");
|
||||
assertEquals("Sub-option did not get restored after restoring default values",
|
||||
originalValue, currentValue);
|
||||
}
|
||||
|
@ -500,7 +502,7 @@ public class OptionsDialogTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
// Verify that options get changed in the options objects
|
||||
//
|
||||
Object root = treeModel.getRoot();
|
||||
Object toolNode = getGTreeNode(root, "Tool");
|
||||
Object toolNode = getGTreeNode(root, TOOL_NODE_NAME);
|
||||
assertTrue(defaultPanel.isShowing());
|
||||
|
||||
Object buttonNode = getGTreeNode(toolNode, "Mouse Buttons");
|
||||
|
@ -521,7 +523,7 @@ public class OptionsDialogTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
assertTrue(applyButton.isEnabled());
|
||||
runSwing(() -> applyButton.getActionListeners()[0].actionPerformed(null));
|
||||
|
||||
Options options = tool.getOptions("Tool");
|
||||
Options options = tool.getOptions(ToolConstants.TOOL_OPTIONS);
|
||||
GhidraOptions.CURSOR_MOUSE_BUTTON_NAMES mouseButton =
|
||||
options.getEnum("Mouse Buttons" + Options.DELIMITER + "Mouse Button To Activate",
|
||||
(GhidraOptions.CURSOR_MOUSE_BUTTON_NAMES) null);
|
||||
|
@ -533,7 +535,7 @@ public class OptionsDialogTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
public void testCancel() throws Exception {
|
||||
// make changes to options, but cancel
|
||||
Object root = treeModel.getRoot();
|
||||
Object toolNode = getGTreeNode(root, "Tool");
|
||||
Object toolNode = getGTreeNode(root, TOOL_NODE_NAME);
|
||||
assertTrue(defaultPanel.isShowing());
|
||||
|
||||
Object buttonNode = getGTreeNode(toolNode, "Mouse Buttons");
|
||||
|
@ -554,7 +556,7 @@ public class OptionsDialogTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
assertTrue(cancelButton.isEnabled());
|
||||
runSwing(() -> cancelButton.getActionListeners()[0].actionPerformed(null));
|
||||
|
||||
Options options = tool.getOptions("Tool");
|
||||
Options options = tool.getOptions(ToolConstants.TOOL_OPTIONS);
|
||||
GhidraOptions.CURSOR_MOUSE_BUTTON_NAMES mouseButton =
|
||||
options.getEnum("Mouse Buttons" + Options.DELIMITER + "Mouse Button To Activate",
|
||||
(GhidraOptions.CURSOR_MOUSE_BUTTON_NAMES) null);
|
||||
|
@ -603,7 +605,7 @@ public class OptionsDialogTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
@Test
|
||||
public void testToolConfigChange() throws Exception {
|
||||
Object root = treeModel.getRoot();
|
||||
Object toolNode = getGTreeNode(root, "Tool");
|
||||
Object toolNode = getGTreeNode(root, TOOL_NODE_NAME);
|
||||
assertTrue(defaultPanel.isShowing());
|
||||
selectNode(toolNode);
|
||||
|
||||
|
@ -636,7 +638,7 @@ public class OptionsDialogTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
assertTrue(applyButton.isEnabled());
|
||||
runSwing(() -> applyButton.getActionListeners()[0].actionPerformed(null));
|
||||
|
||||
Options options = tool.getOptions("Tool");
|
||||
Options options = tool.getOptions(ToolConstants.TOOL_OPTIONS);
|
||||
|
||||
Color c = options.getColor("Favorite Color", Color.RED);
|
||||
|
||||
|
@ -648,7 +650,7 @@ public class OptionsDialogTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
@Test
|
||||
public void testSaveRestoreToolState() throws Exception {
|
||||
Object root = treeModel.getRoot();
|
||||
Object toolNode = getGTreeNode(root, "Tool");
|
||||
Object toolNode = getGTreeNode(root, TOOL_NODE_NAME);
|
||||
assertTrue(defaultPanel.isShowing());
|
||||
selectNode(toolNode);
|
||||
|
||||
|
@ -681,7 +683,7 @@ public class OptionsDialogTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
assertTrue(applyButton.isEnabled());
|
||||
runSwing(() -> applyButton.getActionListeners()[0].actionPerformed(null));
|
||||
|
||||
Options options = tool.getOptions("Tool");
|
||||
Options options = tool.getOptions(ToolConstants.TOOL_OPTIONS);
|
||||
|
||||
Color c = options.getColor("Favorite Color", Color.RED);
|
||||
|
||||
|
@ -1051,7 +1053,7 @@ public class OptionsDialogTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
}
|
||||
|
||||
private void createMultiLevelOptions() {
|
||||
Options options = tool.getOptions("Tool");
|
||||
Options options = tool.getOptions(ToolConstants.TOOL_OPTIONS);
|
||||
|
||||
// register this options because it is used in a test that saves and restores and
|
||||
// only registered options are saved.
|
||||
|
|
|
@ -26,13 +26,13 @@ import javax.swing.tree.TreePath;
|
|||
import docking.ActionContext;
|
||||
import docking.action.DockingAction;
|
||||
import docking.action.MenuData;
|
||||
import docking.tool.ToolConstants;
|
||||
import docking.widgets.filechooser.GhidraFileChooser;
|
||||
import docking.widgets.label.GLabel;
|
||||
import ghidra.bitpatterns.info.*;
|
||||
import ghidra.framework.options.OptionsChangeListener;
|
||||
import ghidra.framework.options.ToolOptions;
|
||||
import ghidra.framework.plugintool.ComponentProviderAdapter;
|
||||
import ghidra.framework.plugintool.util.ToolConstants;
|
||||
import ghidra.framework.preferences.Preferences;
|
||||
import ghidra.program.model.listing.Program;
|
||||
import ghidra.util.HelpLocation;
|
||||
|
|
|
@ -27,6 +27,7 @@ import javax.swing.*;
|
|||
import org.junit.*;
|
||||
|
||||
import docking.action.DockingActionIf;
|
||||
import docking.tool.ToolConstants;
|
||||
import docking.widgets.OptionDialog;
|
||||
import docking.widgets.filechooser.GhidraFileChooser;
|
||||
import generic.test.AbstractGTest;
|
||||
|
@ -44,7 +45,6 @@ import ghidra.framework.model.ToolChest;
|
|||
import ghidra.framework.model.ToolTemplate;
|
||||
import ghidra.framework.plugintool.PluginTool;
|
||||
import ghidra.framework.plugintool.util.PluginException;
|
||||
import ghidra.framework.plugintool.util.ToolConstants;
|
||||
import ghidra.framework.preferences.Preferences;
|
||||
import ghidra.framework.project.tool.ToolIconURL;
|
||||
import ghidra.test.AbstractGhidraHeadedIntegrationTest;
|
||||
|
@ -315,7 +315,7 @@ public class SaveToolConfigDialogTest extends AbstractGhidraHeadedIntegrationTes
|
|||
|
||||
private void showDialogs() throws Exception {
|
||||
|
||||
DockingActionIf action = getAction(tool, "Tool", "Save Tool As");
|
||||
DockingActionIf action = getAction(tool, ToolConstants.TOOL_OWNER, "Save Tool As");
|
||||
performAction(action, false);
|
||||
waitForSwing();
|
||||
|
||||
|
|
|
@ -28,6 +28,7 @@ import docking.ActionContext;
|
|||
import docking.ComponentProvider;
|
||||
import docking.action.DockingAction;
|
||||
import docking.action.MenuData;
|
||||
import docking.tool.ToolConstants;
|
||||
import docking.widgets.filechooser.GhidraFileChooser;
|
||||
import docking.widgets.filechooser.GhidraFileChooserMode;
|
||||
import ghidra.app.DeveloperPluginPackage;
|
||||
|
@ -44,7 +45,6 @@ import ghidra.feature.fid.service.FidService;
|
|||
import ghidra.framework.plugintool.PluginInfo;
|
||||
import ghidra.framework.plugintool.PluginTool;
|
||||
import ghidra.framework.plugintool.util.PluginStatus;
|
||||
import ghidra.framework.plugintool.util.ToolConstants;
|
||||
import ghidra.program.model.address.Address;
|
||||
import ghidra.program.model.listing.*;
|
||||
import ghidra.program.model.mem.MemoryAccessException;
|
||||
|
|
|
@ -26,6 +26,7 @@ import javax.swing.event.ChangeListener;
|
|||
import docking.ActionContext;
|
||||
import docking.action.DockingAction;
|
||||
import docking.action.MenuData;
|
||||
import docking.tool.ToolConstants;
|
||||
import docking.widgets.filechooser.GhidraFileChooser;
|
||||
import ghidra.app.plugin.PluginCategoryNames;
|
||||
import ghidra.app.plugin.ProgramPlugin;
|
||||
|
@ -36,7 +37,6 @@ import ghidra.feature.fid.service.FidService;
|
|||
import ghidra.framework.plugintool.PluginInfo;
|
||||
import ghidra.framework.plugintool.PluginTool;
|
||||
import ghidra.framework.plugintool.util.PluginStatus;
|
||||
import ghidra.framework.plugintool.util.ToolConstants;
|
||||
import ghidra.util.HelpLocation;
|
||||
import ghidra.util.Msg;
|
||||
import ghidra.util.exception.CancelledException;
|
||||
|
|
|
@ -22,11 +22,11 @@ import javax.swing.ImageIcon;
|
|||
|
||||
import docking.ActionContext;
|
||||
import docking.action.*;
|
||||
import docking.tool.ToolConstants;
|
||||
import docking.widgets.OptionDialog;
|
||||
import ghidra.app.plugin.core.codebrowser.OtherPanelContext;
|
||||
import ghidra.app.services.CodeViewerService;
|
||||
import ghidra.app.util.HelpTopics;
|
||||
import ghidra.framework.plugintool.util.ToolConstants;
|
||||
import ghidra.program.model.listing.Program;
|
||||
import ghidra.util.HTMLUtilities;
|
||||
import ghidra.util.HelpLocation;
|
||||
|
|
|
@ -30,6 +30,7 @@ import org.junit.*;
|
|||
import docking.*;
|
||||
import docking.action.DockingActionIf;
|
||||
import docking.action.ToggleDockingAction;
|
||||
import docking.tool.ToolConstants;
|
||||
import docking.widgets.fieldpanel.FieldPanel;
|
||||
import generic.test.AbstractGenericTest;
|
||||
import ghidra.app.events.ProgramLocationPluginEvent;
|
||||
|
@ -589,7 +590,7 @@ public class DiffTestAdapter extends AbstractGhidraHeadedIntegrationTest {
|
|||
}
|
||||
|
||||
public static DockingActionIf getToolAction(PluginTool tool, String name) {
|
||||
Set<DockingActionIf> actions = getActionsByOwner(tool, "Tool");
|
||||
Set<DockingActionIf> actions = getActionsByOwner(tool, ToolConstants.TOOL_OWNER);
|
||||
for (DockingActionIf action : actions) {
|
||||
if (name.equals(action.getName())) {
|
||||
return action;
|
||||
|
|
|
@ -21,6 +21,7 @@ import java.net.Socket;
|
|||
|
||||
import docking.ActionContext;
|
||||
import docking.action.*;
|
||||
import docking.tool.ToolConstants;
|
||||
import ghidra.app.CorePluginPackage;
|
||||
import ghidra.app.context.ProgramLocationActionContext;
|
||||
import ghidra.app.decompiler.*;
|
||||
|
@ -37,7 +38,6 @@ import ghidra.framework.options.ToolOptions;
|
|||
import ghidra.framework.plugintool.PluginInfo;
|
||||
import ghidra.framework.plugintool.PluginTool;
|
||||
import ghidra.framework.plugintool.util.PluginStatus;
|
||||
import ghidra.framework.plugintool.util.ToolConstants;
|
||||
import ghidra.util.HelpLocation;
|
||||
import ghidra.util.Msg;
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
/* ###
|
||||
* IP: GHIDRA
|
||||
* REVIEWED: YES
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -19,7 +18,6 @@ package ghidra.feature.vt.gui.actions;
|
|||
import ghidra.feature.vt.gui.plugin.VTController;
|
||||
import ghidra.feature.vt.gui.plugin.VTPlugin;
|
||||
import ghidra.feature.vt.gui.wizard.VTAddToSessionWizardManager;
|
||||
import ghidra.framework.plugintool.util.ToolConstants;
|
||||
import ghidra.util.HelpLocation;
|
||||
|
||||
import javax.swing.Icon;
|
||||
|
@ -27,6 +25,7 @@ import javax.swing.Icon;
|
|||
import resources.ResourceManager;
|
||||
import docking.ActionContext;
|
||||
import docking.action.*;
|
||||
import docking.tool.ToolConstants;
|
||||
import docking.wizard.WizardManager;
|
||||
|
||||
public class AddToVersionTrackingSessionAction extends DockingAction {
|
||||
|
|
|
@ -19,10 +19,10 @@ import javax.swing.Icon;
|
|||
|
||||
import docking.ActionContext;
|
||||
import docking.action.*;
|
||||
import docking.tool.ToolConstants;
|
||||
import ghidra.feature.vt.api.main.VTSession;
|
||||
import ghidra.feature.vt.gui.plugin.VTController;
|
||||
import ghidra.feature.vt.gui.plugin.VTPlugin;
|
||||
import ghidra.framework.plugintool.util.ToolConstants;
|
||||
import ghidra.util.HTMLUtilities;
|
||||
import ghidra.util.HelpLocation;
|
||||
import resources.ResourceManager;
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
/* ###
|
||||
* IP: GHIDRA
|
||||
* REVIEWED: YES
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -18,11 +17,11 @@ package ghidra.feature.vt.gui.actions;
|
|||
|
||||
import ghidra.feature.vt.gui.plugin.VTController;
|
||||
import ghidra.feature.vt.gui.plugin.VTPlugin;
|
||||
import ghidra.framework.plugintool.util.ToolConstants;
|
||||
import ghidra.util.HelpLocation;
|
||||
import docking.ActionContext;
|
||||
import docking.action.DockingAction;
|
||||
import docking.action.MenuData;
|
||||
import docking.tool.ToolConstants;
|
||||
|
||||
public class CloseVersionTrackingSessionAction extends DockingAction {
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
/* ###
|
||||
* IP: GHIDRA
|
||||
* REVIEWED: YES
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -19,7 +18,6 @@ package ghidra.feature.vt.gui.actions;
|
|||
import ghidra.feature.vt.gui.plugin.VTController;
|
||||
import ghidra.feature.vt.gui.plugin.VTPlugin;
|
||||
import ghidra.feature.vt.gui.wizard.VTNewSessionWizardManager;
|
||||
import ghidra.framework.plugintool.util.ToolConstants;
|
||||
import ghidra.util.HelpLocation;
|
||||
|
||||
import javax.swing.Icon;
|
||||
|
@ -27,6 +25,7 @@ import javax.swing.Icon;
|
|||
import resources.ResourceManager;
|
||||
import docking.ActionContext;
|
||||
import docking.action.*;
|
||||
import docking.tool.ToolConstants;
|
||||
import docking.widgets.OptionDialog;
|
||||
import docking.wizard.WizardManager;
|
||||
|
||||
|
|
|
@ -23,8 +23,8 @@ import docking.ActionContext;
|
|||
import docking.action.*;
|
||||
import docking.help.Help;
|
||||
import docking.help.HelpService;
|
||||
import docking.tool.ToolConstants;
|
||||
import ghidra.feature.vt.gui.plugin.VTPlugin;
|
||||
import ghidra.framework.plugintool.util.ToolConstants;
|
||||
import ghidra.util.HelpLocation;
|
||||
import ghidra.util.Msg;
|
||||
import resources.ResourceManager;
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
/* ###
|
||||
* IP: GHIDRA
|
||||
* REVIEWED: YES
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -23,11 +22,11 @@ import ghidra.framework.main.DataTreeDialog;
|
|||
import ghidra.framework.model.DomainFile;
|
||||
import ghidra.framework.model.DomainFileFilter;
|
||||
import ghidra.framework.plugintool.PluginTool;
|
||||
import ghidra.framework.plugintool.util.ToolConstants;
|
||||
import ghidra.util.HelpLocation;
|
||||
import docking.ActionContext;
|
||||
import docking.action.DockingAction;
|
||||
import docking.action.MenuData;
|
||||
import docking.tool.ToolConstants;
|
||||
|
||||
public class OpenVersionTrackingSessionAction extends DockingAction {
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
/* ###
|
||||
* IP: GHIDRA
|
||||
* REVIEWED: YES
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -16,21 +15,20 @@
|
|||
*/
|
||||
package ghidra.feature.vt.gui.actions;
|
||||
|
||||
import ghidra.feature.vt.api.db.VTSessionDB;
|
||||
import ghidra.feature.vt.api.main.VTSession;
|
||||
import ghidra.feature.vt.gui.plugin.VTController;
|
||||
import ghidra.feature.vt.gui.plugin.VTPlugin;
|
||||
import ghidra.framework.plugintool.util.ToolConstants;
|
||||
import ghidra.util.*;
|
||||
|
||||
import java.awt.event.InputEvent;
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.swing.Icon;
|
||||
|
||||
import resources.ResourceManager;
|
||||
import docking.ActionContext;
|
||||
import docking.action.*;
|
||||
import docking.tool.ToolConstants;
|
||||
import ghidra.feature.vt.api.db.VTSessionDB;
|
||||
import ghidra.feature.vt.api.main.VTSession;
|
||||
import ghidra.feature.vt.gui.plugin.VTController;
|
||||
import ghidra.feature.vt.gui.plugin.VTPlugin;
|
||||
import ghidra.util.*;
|
||||
import resources.ResourceManager;
|
||||
|
||||
public class RedoAction extends DockingAction {
|
||||
private final VTController controller;
|
||||
|
@ -38,7 +36,7 @@ public class RedoAction extends DockingAction {
|
|||
public RedoAction(VTController controller) {
|
||||
super("Redo", VTPlugin.OWNER);
|
||||
this.controller = controller;
|
||||
setHelpLocation(new HelpLocation("Tool", "Redo"));
|
||||
setHelpLocation(new HelpLocation(ToolConstants.TOOL_HELP_TOPIC, "Redo"));
|
||||
String[] menuPath = { ToolConstants.MENU_EDIT, "&Redo" };
|
||||
String group = "ZZUndo";
|
||||
Icon icon = ResourceManager.loadImage("images/redo.png");
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
/* ###
|
||||
* IP: GHIDRA
|
||||
* REVIEWED: YES
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -20,11 +19,11 @@ import ghidra.feature.vt.api.db.VTSessionDB;
|
|||
import ghidra.feature.vt.api.main.VTSession;
|
||||
import ghidra.feature.vt.gui.plugin.*;
|
||||
import ghidra.framework.model.DomainFile;
|
||||
import ghidra.framework.plugintool.util.ToolConstants;
|
||||
import ghidra.util.HelpLocation;
|
||||
import docking.ActionContext;
|
||||
import docking.action.DockingAction;
|
||||
import docking.action.MenuData;
|
||||
import docking.tool.ToolConstants;
|
||||
import docking.widgets.OptionDialog;
|
||||
|
||||
public class ResetToolAction extends DockingAction {
|
||||
|
|
|
@ -21,13 +21,13 @@ import javax.swing.Icon;
|
|||
|
||||
import docking.ActionContext;
|
||||
import docking.action.*;
|
||||
import docking.tool.ToolConstants;
|
||||
import ghidra.feature.vt.api.db.VTSessionDB;
|
||||
import ghidra.feature.vt.api.main.VTSession;
|
||||
import ghidra.feature.vt.gui.plugin.VTController;
|
||||
import ghidra.feature.vt.gui.plugin.VTPlugin;
|
||||
import ghidra.feature.vt.gui.task.SaveTask;
|
||||
import ghidra.framework.model.DomainFile;
|
||||
import ghidra.framework.plugintool.util.ToolConstants;
|
||||
import ghidra.program.model.listing.Program;
|
||||
import ghidra.util.HelpLocation;
|
||||
import ghidra.util.task.TaskLauncher;
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
/* ###
|
||||
* IP: GHIDRA
|
||||
* REVIEWED: YES
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -16,20 +15,19 @@
|
|||
*/
|
||||
package ghidra.feature.vt.gui.actions;
|
||||
|
||||
import ghidra.feature.vt.api.db.VTSessionDB;
|
||||
import ghidra.feature.vt.gui.plugin.VTController;
|
||||
import ghidra.feature.vt.gui.plugin.VTPlugin;
|
||||
import ghidra.framework.plugintool.util.ToolConstants;
|
||||
import ghidra.util.*;
|
||||
|
||||
import java.awt.event.InputEvent;
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.swing.Icon;
|
||||
|
||||
import resources.ResourceManager;
|
||||
import docking.ActionContext;
|
||||
import docking.action.*;
|
||||
import docking.tool.ToolConstants;
|
||||
import ghidra.feature.vt.api.db.VTSessionDB;
|
||||
import ghidra.feature.vt.gui.plugin.VTController;
|
||||
import ghidra.feature.vt.gui.plugin.VTPlugin;
|
||||
import ghidra.util.*;
|
||||
import resources.ResourceManager;
|
||||
|
||||
public class UndoAction extends DockingAction {
|
||||
private final VTController controller;
|
||||
|
@ -37,7 +35,7 @@ public class UndoAction extends DockingAction {
|
|||
public UndoAction(VTController controller) {
|
||||
super("Undo", VTPlugin.OWNER);
|
||||
this.controller = controller;
|
||||
setHelpLocation(new HelpLocation("Tool", "Undo"));
|
||||
setHelpLocation(new HelpLocation(ToolConstants.TOOL_HELP_TOPIC, "Undo"));
|
||||
String[] menuPath = { ToolConstants.MENU_EDIT, "&Undo" };
|
||||
String group = "ZZUndo";
|
||||
Icon icon = ResourceManager.loadImage("images/undo.png");
|
||||
|
|
|
@ -24,6 +24,7 @@ import javax.swing.*;
|
|||
import docking.action.DockingActionIf;
|
||||
import docking.help.Help;
|
||||
import docking.help.HelpService;
|
||||
import docking.tool.ToolConstants;
|
||||
import docking.wizard.WizardManager;
|
||||
import ghidra.GhidraOptions;
|
||||
import ghidra.app.plugin.core.codebrowser.CodeBrowserPlugin;
|
||||
|
@ -137,7 +138,7 @@ public class VTPlugin extends Plugin {
|
|||
}
|
||||
|
||||
private DockingActionIf getToolAction(String actionName) {
|
||||
Set<DockingActionIf> actions = tool.getDockingActionsByOwnerName("Tool");
|
||||
Set<DockingActionIf> actions = tool.getDockingActionsByOwnerName(ToolConstants.TOOL_OWNER);
|
||||
for (DockingActionIf action : actions) {
|
||||
if (action.getName().equals(actionName)) {
|
||||
return action;
|
||||
|
|
|
@ -26,6 +26,7 @@ import org.jdom.output.XMLOutputter;
|
|||
|
||||
import docking.ActionContext;
|
||||
import docking.action.*;
|
||||
import docking.tool.ToolConstants;
|
||||
import docking.tool.util.DockingToolConstants;
|
||||
import docking.widgets.OptionDialog;
|
||||
import docking.widgets.fieldpanel.FieldPanel;
|
||||
|
@ -48,7 +49,8 @@ import ghidra.framework.ToolUtils;
|
|||
import ghidra.framework.model.*;
|
||||
import ghidra.framework.options.*;
|
||||
import ghidra.framework.plugintool.*;
|
||||
import ghidra.framework.plugintool.util.*;
|
||||
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.*;
|
||||
|
@ -173,7 +175,7 @@ public class VTSubToolManager implements VTControllerListener, OptionsChangeList
|
|||
}
|
||||
|
||||
private DockingActionIf getToolAction(Tool tool, String actionName) {
|
||||
Set<DockingActionIf> actions = tool.getDockingActionsByOwnerName("Tool");
|
||||
Set<DockingActionIf> actions = tool.getDockingActionsByOwnerName(ToolConstants.TOOL_OWNER);
|
||||
for (DockingActionIf action : actions) {
|
||||
if (action.getName().equals(actionName)) {
|
||||
return action;
|
||||
|
|
|
@ -193,6 +193,30 @@ public class DockableComponent extends JPanel implements ContainerListener {
|
|||
return componentInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the component provider attached to this dockable component; null if this object
|
||||
* has been disposed
|
||||
*
|
||||
* @return the provider
|
||||
*/
|
||||
public ComponentProvider getComponentProvider() {
|
||||
if (componentInfo == null) {
|
||||
return null;
|
||||
}
|
||||
return componentInfo.getProvider();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the docking window manager that owns this component
|
||||
* @return the manager
|
||||
*/
|
||||
public DockingWindowManager getDockingWindowManager() {
|
||||
if (componentInfo == null) {
|
||||
return null;
|
||||
}
|
||||
return componentInfo.getNode().getDockingWindowManager();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
if (componentInfo == null) {
|
||||
|
|
|
@ -32,8 +32,8 @@ import resources.ResourceManager;
|
|||
* Manages to toolbar for the dockable components.
|
||||
*/
|
||||
class DockableToolBarManager {
|
||||
private static final ImageIcon closeIcon = ResourceManager.loadImage("images/close16.gif");
|
||||
private static final ImageIcon menuIcon = ResourceManager.loadImage("images/menu16.gif");
|
||||
private static final ImageIcon CLOSE_ICON = ResourceManager.loadImage("images/close16.gif");
|
||||
private static final ImageIcon MENU_ICON = ResourceManager.loadImage("images/menu16.gif");
|
||||
|
||||
private GenericHeader dockableHeader;
|
||||
private ToolBarManager toolBarManager;
|
||||
|
@ -45,6 +45,7 @@ class DockableToolBarManager {
|
|||
|
||||
private SwingUpdateManager headerUpdater =
|
||||
new SwingUpdateManager(() -> dockableHeader.update());
|
||||
private DockableComponent dockableComponent;
|
||||
|
||||
DockableToolBarManager(GenericHeader header) {
|
||||
this.dockableHeader = header;
|
||||
|
@ -52,14 +53,16 @@ class DockableToolBarManager {
|
|||
}
|
||||
|
||||
/**
|
||||
* Constructs a new DockableToolBarManger for the given ComponentInfo.
|
||||
* @param info the componentInfo object containing the component.
|
||||
* Constructs a new DockableToolBarManger for the given ComponentInfo
|
||||
*
|
||||
* @param dockableComponent the component to which this toolbar belongs
|
||||
* @param header the header to which this toolbar belongs
|
||||
*/
|
||||
DockableToolBarManager(DockableComponent dockableComp, DockableHeader header) {
|
||||
DockableToolBarManager(DockableComponent dockableComponent, DockableHeader header) {
|
||||
this.dockableComponent = dockableComponent;
|
||||
this.dockableHeader = header;
|
||||
ComponentPlaceholder placeholder = dockableComp.getComponentWindowingPlaceholder();
|
||||
DockingWindowManager winMgr =
|
||||
dockableComp.getComponentWindowingPlaceholder().getNode().winMgr;
|
||||
ComponentPlaceholder placeholder = dockableComponent.getComponentWindowingPlaceholder();
|
||||
DockingWindowManager winMgr = dockableComponent.getDockingWindowManager();
|
||||
ActionToGuiMapper actionManager = winMgr.getActionToGuiMapper();
|
||||
menuGroupMap = actionManager.getMenuGroupMap();
|
||||
|
||||
|
@ -67,7 +70,14 @@ class DockableToolBarManager {
|
|||
Iterator<DockingActionIf> iter = placeholder.getActions();
|
||||
initialize(winMgr, menuHandler, iter);
|
||||
|
||||
closeButtonManager = new ToolBarItemManager(new ToolBarCloseAction(dockableComp), winMgr);
|
||||
ComponentProvider provider = placeholder.getProvider();
|
||||
String owner = provider.getOwner();
|
||||
ToolBarCloseAction closeAction = new ToolBarCloseAction(owner);
|
||||
closeButtonManager = new ToolBarItemManager(closeAction, winMgr);
|
||||
DockingTool tool = winMgr.getTool();
|
||||
|
||||
// we need to add this action to the tool in order to use key bindings
|
||||
tool.addLocalAction(provider, closeAction);
|
||||
}
|
||||
|
||||
private void initialize(DockingWindowManager winMgr, MenuHandler menuHandler,
|
||||
|
@ -152,6 +162,12 @@ class DockableToolBarManager {
|
|||
}
|
||||
|
||||
void dispose() {
|
||||
|
||||
DockingWindowManager dwm = dockableComponent.getDockingWindowManager();
|
||||
DockingTool tool = dwm.getTool();
|
||||
ComponentProvider provider = dockableComponent.getComponentProvider();
|
||||
tool.removeLocalAction(provider, closeButtonManager.getAction());
|
||||
|
||||
headerUpdater.dispose();
|
||||
menuManager.dispose();
|
||||
toolBarManager.dispose();
|
||||
|
@ -165,14 +181,11 @@ class DockableToolBarManager {
|
|||
* Action added to toolbar for "hiding" the component.
|
||||
*/
|
||||
private class ToolBarCloseAction extends DockingAction {
|
||||
private DockableComponent dockableComponent;
|
||||
|
||||
ToolBarCloseAction(DockableComponent dockableComponent) {
|
||||
super("Close Window", DockingWindowManager.DOCKING_WINDOWS_OWNER,
|
||||
KeyBindingType.UNSUPPORTED);
|
||||
this.dockableComponent = dockableComponent;
|
||||
ToolBarCloseAction(String owner) {
|
||||
super("Close Window", owner, KeyBindingType.SHARED);
|
||||
setDescription("Close Window");
|
||||
setToolBarData(new ToolBarData(closeIcon, null));
|
||||
setToolBarData(new ToolBarData(CLOSE_ICON, null));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -182,6 +195,12 @@ class DockableToolBarManager {
|
|||
placeholder.close();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEnabledForContext(ActionContext context) {
|
||||
ComponentProvider provider = context.getComponentProvider();
|
||||
return provider == dockableComponent.getComponentProvider();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -192,7 +211,7 @@ class DockableToolBarManager {
|
|||
ToolBarMenuAction() {
|
||||
super("Local Menu", DockingWindowManager.DOCKING_WINDOWS_OWNER);
|
||||
setDescription("Menu");
|
||||
setToolBarData(new ToolBarData(menuIcon, null));
|
||||
setToolBarData(new ToolBarData(MENU_ICON, null));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -326,6 +326,14 @@ public class DockingWindowManager implements PropertyChangeListener, Placeholder
|
|||
return root;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the tool that owns this manager
|
||||
* @return the tool
|
||||
*/
|
||||
public DockingTool getTool() {
|
||||
return tool;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the root window frame.
|
||||
* @return the root window frame.
|
||||
|
|
|
@ -37,6 +37,14 @@ abstract class Node {
|
|||
this.winMgr = winMgr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns this node's window manager
|
||||
* @return the window manager
|
||||
*/
|
||||
DockingWindowManager getDockingWindowManager() {
|
||||
return winMgr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets all children of this node; an empty list if no children exist.
|
||||
*
|
||||
|
@ -50,20 +58,23 @@ abstract class Node {
|
|||
abstract void close();
|
||||
|
||||
/**
|
||||
* Returns a component that manages all the components from the nodes below it.
|
||||
* Returns a component that manages all the components from the nodes below it
|
||||
* @return the component
|
||||
*/
|
||||
abstract JComponent getComponent();
|
||||
|
||||
/**
|
||||
* Determine if this node contains the specified component.
|
||||
* Determine if this node contains the specified component
|
||||
*
|
||||
* @param info component information
|
||||
* @return true if this node contains the specified component.
|
||||
* @return true if this node contains the specified component
|
||||
*/
|
||||
abstract boolean contains(ComponentPlaceholder info);
|
||||
|
||||
/**
|
||||
* Returns an JDOM element object that contains the configuration state of this node
|
||||
* and its children.
|
||||
* and its children
|
||||
* @return the element
|
||||
*/
|
||||
abstract Element saveToXML();
|
||||
|
||||
|
@ -83,7 +94,8 @@ abstract class Node {
|
|||
abstract WindowNode getTopLevelNode();
|
||||
|
||||
/**
|
||||
* Returns list of active components.
|
||||
* Puts into the given list all active components in this node
|
||||
* @param list the results list
|
||||
*/
|
||||
abstract void populateActiveComponents(List<ComponentPlaceholder> list);
|
||||
|
||||
|
@ -98,11 +110,14 @@ abstract class Node {
|
|||
}
|
||||
|
||||
/**
|
||||
* Generates a node corresponding to the given XML element.
|
||||
* @param elem the XML element for which to generate a node.
|
||||
* @param mgr the DockingWindowsManager for the new node.
|
||||
* @param parentNode the parent node for the new node.
|
||||
* @return the new node generated from the XML element.
|
||||
* Generates a node corresponding to the given XML element
|
||||
*
|
||||
* @param elem the XML element for which to generate a node
|
||||
* @param mgr the DockingWindowsManager for the new node
|
||||
* @param parentNode the parent node for the new node
|
||||
* @param restoredPlaceholders a 'results' list into which will be placed any restored
|
||||
* placeholders
|
||||
* @return the new node generated from the XML element
|
||||
*/
|
||||
Node processChildElement(Element elem, DockingWindowManager mgr, Node parentNode,
|
||||
List<ComponentPlaceholder> restoredPlaceholders) {
|
||||
|
|
|
@ -20,6 +20,7 @@ import javax.swing.Icon;
|
|||
import docking.action.DockingAction;
|
||||
import docking.action.MenuData;
|
||||
import docking.actions.AutoGeneratedDockingAction;
|
||||
import docking.tool.ToolConstants;
|
||||
import ghidra.util.HelpLocation;
|
||||
import resources.ResourceManager;
|
||||
|
||||
|
@ -47,7 +48,7 @@ class ShowWindowAction extends DockingAction
|
|||
this.node = node;
|
||||
|
||||
setMenuBarData(new MenuData(new String[] { MENU_WINDOW, getName() }, ICON, "WindowGroup"));
|
||||
setHelpLocation(new HelpLocation("Tool", "DefaultTools")); // somewhat arbitrary location
|
||||
setHelpLocation(new HelpLocation(ToolConstants.TOOL_HELP_TOPIC, "DefaultTools")); // somewhat arbitrary location
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -25,6 +25,7 @@ import javax.swing.text.*;
|
|||
import docking.DialogComponentProvider;
|
||||
import docking.KeyEntryTextField;
|
||||
import docking.action.*;
|
||||
import docking.tool.ToolConstants;
|
||||
import docking.widgets.label.GIconLabel;
|
||||
import ghidra.util.HelpLocation;
|
||||
import ghidra.util.ReservedKeyBindings;
|
||||
|
@ -54,7 +55,7 @@ public class KeyEntryDialog extends DialogComponentProvider {
|
|||
createPanel();
|
||||
KeyStroke keyBinding = action.getKeyBinding();
|
||||
updateCollisionPane(keyBinding);
|
||||
setHelpLocation(new HelpLocation("Tool", "KeyBindingPopup"));
|
||||
setHelpLocation(new HelpLocation(ToolConstants.TOOL_HELP_TOPIC, "KeyBindingPopup"));
|
||||
}
|
||||
|
||||
private void createPanel() {
|
||||
|
@ -161,8 +162,6 @@ public class KeyEntryDialog extends DialogComponentProvider {
|
|||
|
||||
action.setUnvalidatedKeyBindingData(new KeyBindingData(newKeyStroke));
|
||||
|
||||
toolActions.keyBindingsChanged();
|
||||
|
||||
close();
|
||||
}
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@ import org.apache.commons.lang3.StringUtils;
|
|||
import docking.ActionContext;
|
||||
import docking.DockingWindowManager;
|
||||
import docking.action.*;
|
||||
import docking.tool.ToolConstants;
|
||||
import ghidra.framework.options.OptionsChangeListener;
|
||||
import ghidra.framework.options.ToolOptions;
|
||||
|
||||
|
@ -37,7 +38,7 @@ import ghidra.framework.options.ToolOptions;
|
|||
*/
|
||||
public class SharedStubKeyBindingAction extends DockingAction implements OptionsChangeListener {
|
||||
|
||||
static final String SHARED_OWNER = "Tool";
|
||||
static final String SHARED_OWNER = ToolConstants.TOOL_OWNER;
|
||||
|
||||
/**
|
||||
* We save the client actions for later validate and options updating. We also need the
|
||||
|
@ -109,6 +110,13 @@ public class SharedStubKeyBindingAction extends DockingAction implements Options
|
|||
results.add(owner);
|
||||
}
|
||||
}
|
||||
|
||||
if (results.isEmpty()) {
|
||||
// This implies we have an action owned by the DockingWindowManager
|
||||
// (the DOCKING_WINDOWS_OWNER). In this case, use the Tool as the owner.
|
||||
results.add(SHARED_OWNER);
|
||||
}
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
|
|
|
@ -376,6 +376,12 @@ public class ToolActions implements DockingToolActions, PropertyChangeListener {
|
|||
}
|
||||
}
|
||||
|
||||
// triggered by a user-initiated action; called by propertyChange()
|
||||
private void keyBindingsChanged() {
|
||||
dockingTool.setConfigChanged(true);
|
||||
actionGuiHelper.keyBindingsChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public DockingActionIf getLocalAction(ComponentProvider provider, String actionName) {
|
||||
|
||||
|
@ -397,9 +403,4 @@ public class ToolActions implements DockingToolActions, PropertyChangeListener {
|
|||
return sharedActionMap.get(name);
|
||||
}
|
||||
|
||||
// triggered by a user-initiated action
|
||||
void keyBindingsChanged() {
|
||||
dockingTool.setConfigChanged(true);
|
||||
actionGuiHelper.keyBindingsChanged();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,131 @@
|
|||
/* ###
|
||||
* IP: GHIDRA
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package docking.tool;
|
||||
|
||||
import docking.tool.util.DockingToolConstants;
|
||||
|
||||
/**
|
||||
* Values used to define standard menu names and other miscellaneous constants
|
||||
*/
|
||||
public interface ToolConstants extends DockingToolConstants {
|
||||
|
||||
/**
|
||||
* Used when placing an action in the "File" menu of the tool
|
||||
*/
|
||||
public static final String MENU_FILE = "&File";
|
||||
|
||||
/**
|
||||
* Used when placing an action in the "Edit" menu of the tool
|
||||
*/
|
||||
public static final String MENU_EDIT = "&Edit";
|
||||
|
||||
/**
|
||||
* Used when placing a PluginAction in the "Navigation" menu of the tool
|
||||
*/
|
||||
public static final String MENU_NAVIGATION = "&Navigation";
|
||||
|
||||
/**
|
||||
* Group name for actions to navigate between windows
|
||||
*/
|
||||
public static final String MENU_NAVIGATION_GROUP_WINDOWS = "GoToWindow";
|
||||
|
||||
/**
|
||||
* Used when placing an action in the "Search" menu of the tool
|
||||
*/
|
||||
public static final String MENU_SEARCH = "&Search";
|
||||
|
||||
/**
|
||||
* Used when placing an action in the "Selection" menu of the tool
|
||||
*/
|
||||
public static final String MENU_SELECTION = "Se&lect";
|
||||
|
||||
/**
|
||||
* Used when placing an action in the "About" menu of the tool
|
||||
*/
|
||||
public static final String MENU_HELP = "&Help";
|
||||
|
||||
/**
|
||||
* Used when placing an action in the "Analysis" menu of the tool
|
||||
*/
|
||||
public static final String MENU_ANALYSIS = "&Analysis";
|
||||
|
||||
/**
|
||||
* Used when placing an action in the "Project" menu of the tool
|
||||
*/
|
||||
public static final String MENU_PROJECT = "&Project";
|
||||
|
||||
/**
|
||||
* Used when placing an action in the "Tools" menu of the tool
|
||||
*/
|
||||
public static final String MENU_TOOLS = "&Tools";
|
||||
|
||||
/** A group for actions that link directly to help content */
|
||||
public static final String HELP_CONTENTS_MENU_GROUP = "AAAHelpContents";
|
||||
|
||||
/** Used for navigation-based action */
|
||||
public static final String NEXT_CODE_UNIT_NAVIGATION_MENU_GROUP = "NextPrevCodeUnit";
|
||||
|
||||
/**
|
||||
* Constant for the options menu group for the Tool Options menu item
|
||||
*/
|
||||
public static final String TOOL_OPTIONS_MENU_GROUP = "AOptions";
|
||||
|
||||
/**
|
||||
* Node name used in the Data tree when a project is not open
|
||||
*/
|
||||
public static final String NO_ACTIVE_PROJECT = "NO ACTIVE PROJECT";
|
||||
|
||||
/**
|
||||
* This is used when an action has the tool as its owner
|
||||
*/
|
||||
public static final String TOOL_OWNER = "Tool";
|
||||
|
||||
/**
|
||||
* Name of options for a tool
|
||||
*/
|
||||
public static final String TOOL_OPTIONS = "Tool";
|
||||
|
||||
/**
|
||||
* Name of the help topic for "About" domain objects and Ghidra
|
||||
*/
|
||||
public static final String ABOUT_HELP_TOPIC = "About";
|
||||
|
||||
/**
|
||||
* Name of help topic for the front end (Ghidra Project Window)
|
||||
*/
|
||||
public static final String FRONT_END_HELP_TOPIC = "FrontEndPlugin";
|
||||
|
||||
/**
|
||||
* Name of help topic for the Tool
|
||||
*/
|
||||
public static final String TOOL_HELP_TOPIC = "Tool";
|
||||
|
||||
/**
|
||||
* The large icon size (height and width)
|
||||
*/
|
||||
public static final int LARGE_ICON_SIZE = 24;
|
||||
|
||||
/**
|
||||
* The medium icon size (height and width)
|
||||
*/
|
||||
public static final int MEDIUM_ICON_SIZE = 22;
|
||||
|
||||
/**
|
||||
* The small icon size (height and width)
|
||||
*/
|
||||
public static final int SMALL_ICON_SIZE = 16;
|
||||
|
||||
}
|
|
@ -24,6 +24,7 @@ import javax.swing.*;
|
|||
|
||||
import docking.DialogComponentProvider;
|
||||
import docking.DockingWindowManager;
|
||||
import docking.tool.ToolConstants;
|
||||
import docking.widgets.OptionDialog;
|
||||
import ghidra.util.*;
|
||||
import ghidra.util.exception.CancelledException;
|
||||
|
@ -146,7 +147,7 @@ public class TaskDialog extends DialogComponentProvider implements TaskMonitor {
|
|||
}
|
||||
|
||||
// SPLIT the help for this dialog should not be in the front end plugin.
|
||||
setHelpLocation(new HelpLocation("Tool", "TaskDialog"));
|
||||
setHelpLocation(new HelpLocation(ToolConstants.TOOL_HELP_TOPIC, "TaskDialog"));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
/* ###
|
||||
* IP: GHIDRA
|
||||
* REVIEWED: YES
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -16,6 +15,8 @@
|
|||
*/
|
||||
package ghidra.app.util;
|
||||
|
||||
import docking.tool.ToolConstants;
|
||||
|
||||
public class GenericHelpTopics {
|
||||
/**
|
||||
* Help Topic for "About."
|
||||
|
@ -46,5 +47,5 @@ public class GenericHelpTopics {
|
|||
/**
|
||||
* Help Topic for tools.
|
||||
*/
|
||||
public final static String TOOL = "Tool";
|
||||
public final static String TOOL = ToolConstants.TOOL_HELP_TOPIC;
|
||||
}
|
||||
|
|
|
@ -21,9 +21,9 @@ import java.io.IOException;
|
|||
import docking.ActionContext;
|
||||
import docking.action.DockingAction;
|
||||
import docking.action.MenuData;
|
||||
import docking.tool.ToolConstants;
|
||||
import docking.widgets.OptionDialog;
|
||||
import docking.widgets.filechooser.GhidraFileChooser;
|
||||
import ghidra.framework.plugintool.util.ToolConstants;
|
||||
import ghidra.net.ApplicationKeyManagerFactory;
|
||||
import ghidra.util.HelpLocation;
|
||||
import ghidra.util.Msg;
|
||||
|
|
|
@ -25,6 +25,7 @@ import javax.swing.KeyStroke;
|
|||
|
||||
import docking.ActionContext;
|
||||
import docking.action.*;
|
||||
import docking.tool.ToolConstants;
|
||||
import docking.widgets.OptionDialog;
|
||||
import docking.widgets.filechooser.GhidraFileChooser;
|
||||
import docking.wizard.WizardManager;
|
||||
|
@ -32,7 +33,6 @@ import ghidra.framework.client.ClientUtil;
|
|||
import ghidra.framework.client.RepositoryAdapter;
|
||||
import ghidra.framework.model.*;
|
||||
import ghidra.framework.options.SaveState;
|
||||
import ghidra.framework.plugintool.util.ToolConstants;
|
||||
import ghidra.framework.store.LockException;
|
||||
import ghidra.util.*;
|
||||
import ghidra.util.exception.NotFoundException;
|
||||
|
|
|
@ -31,6 +31,7 @@ import org.jdom.output.XMLOutputter;
|
|||
import docking.*;
|
||||
import docking.action.DockingAction;
|
||||
import docking.action.MenuData;
|
||||
import docking.tool.ToolConstants;
|
||||
import docking.widgets.OkDialog;
|
||||
import docking.widgets.OptionDialog;
|
||||
import docking.widgets.dialogs.InputDialog;
|
||||
|
@ -48,7 +49,6 @@ import ghidra.framework.model.*;
|
|||
import ghidra.framework.options.SaveState;
|
||||
import ghidra.framework.plugintool.*;
|
||||
import ghidra.framework.plugintool.util.PluginStatus;
|
||||
import ghidra.framework.plugintool.util.ToolConstants;
|
||||
import ghidra.framework.preferences.Preferences;
|
||||
import ghidra.framework.remote.User;
|
||||
import ghidra.util.*;
|
||||
|
@ -722,7 +722,8 @@ public class FrontEndPlugin extends Plugin
|
|||
private GhidraFileChooser getFileChooser(ToolTemplate template) {
|
||||
if (exportFileChooser == null) {
|
||||
exportFileChooser = new GhidraFileChooser(tool.getToolFrame());
|
||||
exportFileChooser.setFileFilter(new ExtensionFileFilter("tool", "Tools"));
|
||||
exportFileChooser.setFileFilter(
|
||||
new ExtensionFileFilter(ToolConstants.TOOL_HELP_TOPIC, "Tools"));
|
||||
exportFileChooser.setApproveButtonText("Export");
|
||||
|
||||
// always prefer the last export directory...
|
||||
|
@ -970,7 +971,8 @@ public class FrontEndPlugin extends Plugin
|
|||
}
|
||||
};
|
||||
exportToolAction.setPopupMenuData(new MenuData(new String[] { "Export..." }, "tool"));
|
||||
exportToolAction.setHelpLocation(new HelpLocation("Tool", EXPORT_TOOL_ACTION_NAME));
|
||||
exportToolAction.setHelpLocation(
|
||||
new HelpLocation(ToolConstants.TOOL_HELP_TOPIC, EXPORT_TOOL_ACTION_NAME));
|
||||
|
||||
deleteToolAction = new ToolButtonAction(DELETE_TOOL_ACTION_NAME) {
|
||||
@Override
|
||||
|
@ -986,7 +988,8 @@ public class FrontEndPlugin extends Plugin
|
|||
|
||||
};
|
||||
deleteToolAction.setPopupMenuData(new MenuData(new String[] { "Delete..." }, "tool"));
|
||||
deleteToolAction.setHelpLocation(new HelpLocation("Tool", DELETE_TOOL_ACTION_NAME));
|
||||
deleteToolAction.setHelpLocation(
|
||||
new HelpLocation(ToolConstants.TOOL_HELP_TOPIC, DELETE_TOOL_ACTION_NAME));
|
||||
|
||||
closeToolAction = new ToolButtonAction(CLOSE_TOOL_ACTION_NAME) {
|
||||
@Override
|
||||
|
@ -1001,7 +1004,8 @@ public class FrontEndPlugin extends Plugin
|
|||
}
|
||||
};
|
||||
closeToolAction.setPopupMenuData(new MenuData(new String[] { "Close" }, "tool"));
|
||||
closeToolAction.setHelpLocation(new HelpLocation("Tool", CLOSE_TOOL_ACTION_NAME));
|
||||
closeToolAction.setHelpLocation(
|
||||
new HelpLocation(ToolConstants.TOOL_HELP_TOPIC, CLOSE_TOOL_ACTION_NAME));
|
||||
|
||||
renameToolAction = new ToolButtonAction("Rename Tool") {
|
||||
@Override
|
||||
|
@ -1070,7 +1074,8 @@ public class FrontEndPlugin extends Plugin
|
|||
}
|
||||
};
|
||||
renameToolAction.setPopupMenuData(new MenuData(new String[] { "Rename..." }, "tool"));
|
||||
renameToolAction.setHelpLocation(new HelpLocation("Tool", "Rename Tool"));
|
||||
renameToolAction.setHelpLocation(
|
||||
new HelpLocation(ToolConstants.TOOL_HELP_TOPIC, "Rename Tool"));
|
||||
|
||||
propertiesAction = new ToolButtonAction(PROPERTIES_ACTION_NAME) {
|
||||
@Override
|
||||
|
@ -1093,7 +1098,8 @@ public class FrontEndPlugin extends Plugin
|
|||
propertiesAction.setPopupMenuData(
|
||||
new MenuData(new String[] { "Configure Plugins..." }, "zproperties"));
|
||||
|
||||
propertiesAction.setHelpLocation(new HelpLocation("Tool", "Configure_Tool"));
|
||||
propertiesAction.setHelpLocation(
|
||||
new HelpLocation(ToolConstants.TOOL_HELP_TOPIC, "Configure_Tool"));
|
||||
|
||||
tool.addLocalAction(frontEndProvider, exportToolAction);
|
||||
tool.addLocalAction(frontEndProvider, renameToolAction);
|
||||
|
|
|
@ -38,6 +38,7 @@ import docking.action.DockingAction;
|
|||
import docking.action.MenuData;
|
||||
import docking.help.Help;
|
||||
import docking.help.HelpService;
|
||||
import docking.tool.ToolConstants;
|
||||
import docking.util.AnimationUtils;
|
||||
import docking.widgets.OptionDialog;
|
||||
import generic.jar.ResourceFile;
|
||||
|
@ -225,8 +226,8 @@ public class FrontEndTool extends PluginTool implements OptionsChangeListener {
|
|||
}
|
||||
|
||||
private void initFrontEndOptions() {
|
||||
ToolOptions options = getOptions("Tool");
|
||||
HelpLocation help = new HelpLocation("Tool", "Save_Tool");
|
||||
ToolOptions options = getOptions(ToolConstants.TOOL_OPTIONS);
|
||||
HelpLocation help = new HelpLocation(ToolConstants.TOOL_HELP_TOPIC, "Save_Tool");
|
||||
|
||||
options.registerOption(AUTOMATICALLY_SAVE_TOOLS, true, help,
|
||||
"When enabled tools will be saved " + "when they are closed");
|
||||
|
@ -285,7 +286,7 @@ public class FrontEndTool extends PluginTool implements OptionsChangeListener {
|
|||
return;
|
||||
}
|
||||
|
||||
ToolOptions options = getOptions("Tool");
|
||||
ToolOptions options = getOptions(ToolConstants.TOOL_OPTIONS);
|
||||
options.removeOptionsChangeListener(this);
|
||||
|
||||
configureToolAction.setEnabled(true);
|
||||
|
@ -656,7 +657,7 @@ public class FrontEndTool extends PluginTool implements OptionsChangeListener {
|
|||
addHelpActions();
|
||||
|
||||
// our log file action
|
||||
DockingAction action = new DockingAction("Show Log", "Tool") {
|
||||
DockingAction action = new DockingAction("Show Log", ToolConstants.TOOL_OWNER) {
|
||||
@Override
|
||||
public void actionPerformed(ActionContext context) {
|
||||
showGhidraUserLogFile();
|
||||
|
|
|
@ -28,6 +28,7 @@ import com.google.common.collect.Iterables;
|
|||
|
||||
import docking.DialogComponentProvider;
|
||||
import docking.options.editor.ButtonPanelFactory;
|
||||
import docking.tool.ToolConstants;
|
||||
import docking.widgets.checkbox.GCheckBox;
|
||||
import docking.widgets.list.ListPanel;
|
||||
import ghidra.framework.ToolUtils;
|
||||
|
@ -55,7 +56,7 @@ class ImportGhidraToolsDialog extends DialogComponentProvider {
|
|||
ImportGhidraToolsDialog(FrontEndTool tool) {
|
||||
|
||||
super("Import Ghidra Tools", true);
|
||||
setHelpLocation(new HelpLocation("Tool", "Import Ghidra Tools"));
|
||||
setHelpLocation(new HelpLocation(ToolConstants.TOOL_HELP_TOPIC, "Import Ghidra Tools"));
|
||||
|
||||
this.tool = tool;
|
||||
|
||||
|
|
|
@ -20,10 +20,9 @@ import java.awt.Component;
|
|||
import java.util.*;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.event.ListSelectionEvent;
|
||||
import javax.swing.event.ListSelectionListener;
|
||||
|
||||
import docking.DialogComponentProvider;
|
||||
import docking.tool.ToolConstants;
|
||||
import docking.widgets.table.*;
|
||||
import ghidra.framework.model.*;
|
||||
import ghidra.framework.project.tool.GhidraToolTemplate;
|
||||
|
@ -42,7 +41,7 @@ public class PickToolDialog extends DialogComponentProvider {
|
|||
this.tool = tool;
|
||||
this.domainClass = domainClass;
|
||||
|
||||
setHelpLocation(new HelpLocation("Tool", "Set Tool Associations"));
|
||||
setHelpLocation(new HelpLocation(ToolConstants.TOOL_HELP_TOPIC, "Set Tool Associations"));
|
||||
|
||||
addWorkPanel(createWorkPanel());
|
||||
|
||||
|
@ -64,9 +63,7 @@ public class PickToolDialog extends DialogComponentProvider {
|
|||
table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
|
||||
table.setDefaultRenderer(GhidraToolTemplate.class, new ToolTemplateRenderer());
|
||||
|
||||
table.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
|
||||
@Override
|
||||
public void valueChanged(ListSelectionEvent e) {
|
||||
table.getSelectionModel().addListSelectionListener(e -> {
|
||||
if (e.getValueIsAdjusting()) {
|
||||
return;
|
||||
}
|
||||
|
@ -74,7 +71,6 @@ public class PickToolDialog extends DialogComponentProvider {
|
|||
int selectedRow = table.getSelectedRow();
|
||||
ToolTemplate template = model.getRowObject(selectedRow);
|
||||
okButton.setEnabled(template != null);
|
||||
}
|
||||
});
|
||||
|
||||
loadList();
|
||||
|
|
|
@ -24,13 +24,13 @@ import docking.ActionContext;
|
|||
import docking.ComponentProvider;
|
||||
import docking.action.DockingAction;
|
||||
import docking.action.MenuData;
|
||||
import docking.tool.ToolConstants;
|
||||
import docking.widgets.OptionDialog;
|
||||
import docking.widgets.PasswordChangeDialog;
|
||||
import docking.widgets.filechooser.GhidraFileChooser;
|
||||
import ghidra.framework.client.ClientUtil;
|
||||
import ghidra.framework.client.RepositoryAdapter;
|
||||
import ghidra.framework.model.*;
|
||||
import ghidra.framework.plugintool.util.ToolConstants;
|
||||
import ghidra.framework.preferences.Preferences;
|
||||
import ghidra.framework.protocol.ghidra.GhidraURL;
|
||||
import ghidra.framework.remote.User;
|
||||
|
|
|
@ -16,16 +16,13 @@
|
|||
package ghidra.framework.main;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.util.*;
|
||||
import java.util.List;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.event.ListSelectionEvent;
|
||||
import javax.swing.event.ListSelectionListener;
|
||||
|
||||
import docking.DialogComponentProvider;
|
||||
import docking.tool.ToolConstants;
|
||||
import docking.widgets.table.*;
|
||||
import ghidra.framework.data.ContentHandler;
|
||||
import ghidra.framework.model.*;
|
||||
|
@ -43,7 +40,7 @@ class SetToolAssociationsDialog extends DialogComponentProvider {
|
|||
super("Set Tool Associations", true);
|
||||
this.tool = tool;
|
||||
|
||||
setHelpLocation(new HelpLocation("Tool", "Set Tool Associations"));
|
||||
setHelpLocation(new HelpLocation(ToolConstants.TOOL_HELP_TOPIC, "Set Tool Associations"));
|
||||
|
||||
addWorkPanel(createWorkPanel());
|
||||
|
||||
|
@ -61,9 +58,7 @@ class SetToolAssociationsDialog extends DialogComponentProvider {
|
|||
table = new GTable(model);
|
||||
|
||||
final JButton editButton = new JButton("Edit");
|
||||
editButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
editButton.addActionListener(e -> {
|
||||
int selectedRow = table.getSelectedRow();
|
||||
ToolAssociationInfo info = model.getRowObject(selectedRow);
|
||||
if (info == null) {
|
||||
|
@ -80,21 +75,17 @@ class SetToolAssociationsDialog extends DialogComponentProvider {
|
|||
info.setCurrentTool(template);
|
||||
model.fireTableDataChanged();
|
||||
}
|
||||
}
|
||||
});
|
||||
editButton.setEnabled(false);
|
||||
|
||||
final JButton resetButton = new JButton("Restore Default");
|
||||
resetButton.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
resetButton.addActionListener(e -> {
|
||||
int selectedRow = table.getSelectedRow();
|
||||
ToolAssociationInfo info = model.getRowObject(selectedRow);
|
||||
if (info != null) {
|
||||
info.restoreDefaultAssociation();
|
||||
table.repaint();
|
||||
}
|
||||
}
|
||||
});
|
||||
resetButton.setEnabled(false);
|
||||
|
||||
|
@ -104,9 +95,7 @@ class SetToolAssociationsDialog extends DialogComponentProvider {
|
|||
table.setDefaultRenderer(ContentHandler.class, new ContentHandlerRenderer());
|
||||
table.setDefaultRenderer(GhidraToolTemplate.class, new ToolTemplateRenderer());
|
||||
|
||||
table.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
|
||||
@Override
|
||||
public void valueChanged(ListSelectionEvent e) {
|
||||
table.getSelectionModel().addListSelectionListener(e -> {
|
||||
if (e.getValueIsAdjusting()) {
|
||||
return;
|
||||
}
|
||||
|
@ -121,7 +110,6 @@ class SetToolAssociationsDialog extends DialogComponentProvider {
|
|||
|
||||
editButton.setEnabled(true);
|
||||
resetButton.setEnabled(!info.isDefault());
|
||||
}
|
||||
});
|
||||
|
||||
loadList();
|
||||
|
|
|
@ -27,10 +27,10 @@ import org.jdom.input.SAXBuilder;
|
|||
|
||||
import docking.ActionContext;
|
||||
import docking.action.*;
|
||||
import docking.tool.ToolConstants;
|
||||
import docking.widgets.filechooser.GhidraFileChooser;
|
||||
import ghidra.framework.model.*;
|
||||
import ghidra.framework.plugintool.PluginTool;
|
||||
import ghidra.framework.plugintool.util.ToolConstants;
|
||||
import ghidra.framework.preferences.Preferences;
|
||||
import ghidra.framework.project.tool.GhidraToolTemplate;
|
||||
import ghidra.util.HelpLocation;
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue