mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 02:09:44 +02:00
GP-3349 added support for mulitple default action context providers. Previously, all default (non-focused) context was provided by the Listing. Now the default provider is registered for each ActionContext class.
This commit is contained in:
parent
8aa9c8be3a
commit
5da5af23fb
149 changed files with 1354 additions and 1232 deletions
|
@ -15,10 +15,10 @@
|
|||
*/
|
||||
package ghidra.app.plugin.core.debug.gui;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import ghidra.trace.model.Trace;
|
||||
|
||||
public class DebuggerSnapActionContext extends ActionContext {
|
||||
public class DebuggerSnapActionContext extends DefaultActionContext {
|
||||
private final Trace trace;
|
||||
private final long snap;
|
||||
|
||||
|
|
|
@ -18,10 +18,10 @@ package ghidra.app.plugin.core.debug.gui.breakpoint;
|
|||
import java.util.Collection;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import ghidra.trace.model.breakpoint.TraceBreakpoint;
|
||||
|
||||
public class DebuggerBreakpointLocationsActionContext extends ActionContext {
|
||||
public class DebuggerBreakpointLocationsActionContext extends DefaultActionContext {
|
||||
private final Collection<BreakpointLocationRow> selection;
|
||||
|
||||
public DebuggerBreakpointLocationsActionContext(Collection<BreakpointLocationRow> selection) {
|
||||
|
|
|
@ -18,10 +18,10 @@ package ghidra.app.plugin.core.debug.gui.breakpoint;
|
|||
import java.util.Collection;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import ghidra.app.services.LogicalBreakpoint;
|
||||
|
||||
public class DebuggerLogicalBreakpointsActionContext extends ActionContext {
|
||||
public class DebuggerLogicalBreakpointsActionContext extends DefaultActionContext {
|
||||
private final Collection<LogicalBreakpointRow> selection;
|
||||
|
||||
public DebuggerLogicalBreakpointsActionContext(Collection<LogicalBreakpointRow> selection) {
|
||||
|
|
|
@ -15,9 +15,9 @@
|
|||
*/
|
||||
package ghidra.app.plugin.core.debug.gui.breakpoint;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
|
||||
// TODO: Any granularity, or just one suggested action on the global tool?
|
||||
public class DebuggerMakeBreakpointsEffectiveActionContext extends ActionContext {
|
||||
public class DebuggerMakeBreakpointsEffectiveActionContext extends DefaultActionContext {
|
||||
// Nothing to add
|
||||
}
|
||||
|
|
|
@ -15,8 +15,8 @@
|
|||
*/
|
||||
package ghidra.app.plugin.core.debug.gui.console;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
|
||||
public class LogRowConsoleActionContext extends ActionContext {
|
||||
public class LogRowConsoleActionContext extends DefaultActionContext {
|
||||
|
||||
}
|
||||
|
|
|
@ -17,10 +17,10 @@ package ghidra.app.plugin.core.debug.gui.listing;
|
|||
|
||||
import java.util.Objects;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import ghidra.framework.model.DomainFile;
|
||||
|
||||
public class DebuggerOpenProgramActionContext extends ActionContext {
|
||||
public class DebuggerOpenProgramActionContext extends DefaultActionContext {
|
||||
private final DomainFile df;
|
||||
private final int hashCode;
|
||||
|
||||
|
|
|
@ -18,10 +18,10 @@ package ghidra.app.plugin.core.debug.gui.memory;
|
|||
import java.util.Collection;
|
||||
import java.util.Set;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import docking.widgets.table.GTable;
|
||||
|
||||
public class DebuggerRegionActionContext extends ActionContext {
|
||||
public class DebuggerRegionActionContext extends DefaultActionContext {
|
||||
private final Set<RegionRow> selectedRegions;
|
||||
|
||||
public DebuggerRegionActionContext(DebuggerRegionsProvider provider,
|
||||
|
|
|
@ -23,6 +23,7 @@ import java.util.List;
|
|||
import javax.swing.*;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import docking.action.DockingAction;
|
||||
import docking.action.builder.ToggleActionBuilder;
|
||||
import ghidra.app.plugin.core.debug.DebuggerPluginPackage;
|
||||
|
@ -176,10 +177,10 @@ public class MemviewProvider extends ComponentProviderAdapter {
|
|||
@Override
|
||||
public ActionContext getActionContext(MouseEvent event) {
|
||||
if (event != null && event.getSource() == mainPanel) {
|
||||
return new ActionContext(this, mainPanel);
|
||||
return new DefaultActionContext(this, mainPanel);
|
||||
}
|
||||
if (event != null && event.getSource() == memviewPanel) {
|
||||
return new ActionContext(this, memviewPanel);
|
||||
return new DefaultActionContext(this, memviewPanel);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -19,11 +19,11 @@ import java.awt.Component;
|
|||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.ComponentProvider;
|
||||
import docking.DefaultActionContext;
|
||||
import ghidra.trace.model.target.TraceObjectValue;
|
||||
|
||||
public class DebuggerObjectActionContext extends ActionContext {
|
||||
public class DebuggerObjectActionContext extends DefaultActionContext {
|
||||
private final List<TraceObjectValue> objectValues;
|
||||
|
||||
public DebuggerObjectActionContext(Collection<TraceObjectValue> objectValues,
|
||||
|
|
|
@ -17,10 +17,10 @@ package ghidra.app.plugin.core.debug.gui.modules;
|
|||
|
||||
import java.util.Objects;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import ghidra.trace.model.modules.TraceModule;
|
||||
|
||||
public class DebuggerMissingModuleActionContext extends ActionContext {
|
||||
public class DebuggerMissingModuleActionContext extends DefaultActionContext {
|
||||
private final TraceModule module;
|
||||
private final int hashCode;
|
||||
|
||||
|
|
|
@ -18,10 +18,10 @@ package ghidra.app.plugin.core.debug.gui.modules;
|
|||
import java.util.Collection;
|
||||
import java.util.Set;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import docking.widgets.table.GTable;
|
||||
|
||||
public class DebuggerModuleActionContext extends ActionContext {
|
||||
public class DebuggerModuleActionContext extends DefaultActionContext {
|
||||
private final Set<ModuleRow> selectedModules;
|
||||
|
||||
public DebuggerModuleActionContext(DebuggerModulesProvider provider,
|
||||
|
|
|
@ -18,10 +18,10 @@ package ghidra.app.plugin.core.debug.gui.modules;
|
|||
import java.util.Collection;
|
||||
import java.util.Set;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import docking.widgets.table.GTable;
|
||||
|
||||
public class DebuggerSectionActionContext extends ActionContext {
|
||||
public class DebuggerSectionActionContext extends DefaultActionContext {
|
||||
private final Set<SectionRow> selectedSections;
|
||||
//private final Set<ModuleRecord> involvedModules;
|
||||
|
||||
|
|
|
@ -18,10 +18,10 @@ package ghidra.app.plugin.core.debug.gui.modules;
|
|||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import docking.widgets.table.GTable;
|
||||
|
||||
public class DebuggerStaticMappingActionContext extends ActionContext {
|
||||
public class DebuggerStaticMappingActionContext extends DefaultActionContext {
|
||||
private final Collection<StaticMappingRow> selected;
|
||||
|
||||
public DebuggerStaticMappingActionContext(DebuggerStaticMappingProvider provider,
|
||||
|
|
|
@ -20,14 +20,8 @@ import java.awt.Color;
|
|||
import java.awt.event.MouseEvent;
|
||||
import java.io.PrintWriter;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
@ -40,12 +34,8 @@ import javax.swing.tree.TreePath;
|
|||
import org.apache.commons.collections4.map.LinkedMap;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.WindowPosition;
|
||||
import docking.action.DockingAction;
|
||||
import docking.action.DockingActionIf;
|
||||
import docking.action.MenuData;
|
||||
import docking.action.ToggleDockingAction;
|
||||
import docking.*;
|
||||
import docking.action.*;
|
||||
import docking.action.builder.ActionBuilder;
|
||||
import docking.action.builder.ToggleActionBuilder;
|
||||
import docking.widgets.OptionDialog;
|
||||
|
@ -56,107 +46,30 @@ import generic.theme.GColor;
|
|||
import ghidra.app.plugin.core.debug.DebuggerCoordinates;
|
||||
import ghidra.app.plugin.core.debug.DebuggerPluginPackage;
|
||||
import ghidra.app.plugin.core.debug.gui.DebuggerResources;
|
||||
import ghidra.app.plugin.core.debug.gui.DebuggerResources.AbstractAttachAction;
|
||||
import ghidra.app.plugin.core.debug.gui.DebuggerResources.AbstractConsoleAction;
|
||||
import ghidra.app.plugin.core.debug.gui.DebuggerResources.AbstractDetachAction;
|
||||
import ghidra.app.plugin.core.debug.gui.DebuggerResources.AbstractInterruptAction;
|
||||
import ghidra.app.plugin.core.debug.gui.DebuggerResources.AbstractKillAction;
|
||||
import ghidra.app.plugin.core.debug.gui.DebuggerResources.AbstractLaunchAction;
|
||||
import ghidra.app.plugin.core.debug.gui.DebuggerResources.AbstractQuickLaunchAction;
|
||||
import ghidra.app.plugin.core.debug.gui.DebuggerResources.AbstractRecordAction;
|
||||
import ghidra.app.plugin.core.debug.gui.DebuggerResources.AbstractRefreshAction;
|
||||
import ghidra.app.plugin.core.debug.gui.DebuggerResources.AbstractResumeAction;
|
||||
import ghidra.app.plugin.core.debug.gui.DebuggerResources.AbstractSetBreakpointAction;
|
||||
import ghidra.app.plugin.core.debug.gui.DebuggerResources.AbstractStepFinishAction;
|
||||
import ghidra.app.plugin.core.debug.gui.DebuggerResources.AbstractStepIntoAction;
|
||||
import ghidra.app.plugin.core.debug.gui.DebuggerResources.AbstractStepLastAction;
|
||||
import ghidra.app.plugin.core.debug.gui.DebuggerResources.AbstractStepOverAction;
|
||||
import ghidra.app.plugin.core.debug.gui.DebuggerResources.AbstractToggleAction;
|
||||
import ghidra.app.plugin.core.debug.gui.objects.actions.DisplayAsGraphAction;
|
||||
import ghidra.app.plugin.core.debug.gui.objects.actions.DisplayAsTableAction;
|
||||
import ghidra.app.plugin.core.debug.gui.objects.actions.DisplayAsTreeAction;
|
||||
import ghidra.app.plugin.core.debug.gui.objects.actions.DisplayAsXMLAction;
|
||||
import ghidra.app.plugin.core.debug.gui.objects.actions.DisplayFilteredGraphAction;
|
||||
import ghidra.app.plugin.core.debug.gui.objects.actions.DisplayFilteredTableAction;
|
||||
import ghidra.app.plugin.core.debug.gui.objects.actions.DisplayFilteredTreeAction;
|
||||
import ghidra.app.plugin.core.debug.gui.objects.actions.DisplayFilteredXMLAction;
|
||||
import ghidra.app.plugin.core.debug.gui.objects.actions.DisplayMethodsAction;
|
||||
import ghidra.app.plugin.core.debug.gui.objects.actions.ExportAsFactsAction;
|
||||
import ghidra.app.plugin.core.debug.gui.objects.actions.ExportAsXMLAction;
|
||||
import ghidra.app.plugin.core.debug.gui.objects.actions.ImportFromFactsAction;
|
||||
import ghidra.app.plugin.core.debug.gui.objects.actions.ImportFromXMLAction;
|
||||
import ghidra.app.plugin.core.debug.gui.objects.actions.OpenWinDbgTraceAction;
|
||||
import ghidra.app.plugin.core.debug.gui.objects.actions.SetTimeoutAction;
|
||||
import ghidra.app.plugin.core.debug.gui.objects.components.DebuggerAttachDialog;
|
||||
import ghidra.app.plugin.core.debug.gui.objects.components.DebuggerBreakpointDialog;
|
||||
import ghidra.app.plugin.core.debug.gui.objects.components.DebuggerMethodInvocationDialog;
|
||||
import ghidra.app.plugin.core.debug.gui.objects.components.DummyTargetObject;
|
||||
import ghidra.app.plugin.core.debug.gui.objects.components.GenericDebuggerProgramLaunchOffer;
|
||||
import ghidra.app.plugin.core.debug.gui.objects.components.ObjectAttributeColumn;
|
||||
import ghidra.app.plugin.core.debug.gui.objects.components.ObjectAttributeRow;
|
||||
import ghidra.app.plugin.core.debug.gui.objects.components.ObjectElementColumn;
|
||||
import ghidra.app.plugin.core.debug.gui.objects.components.ObjectElementRow;
|
||||
import ghidra.app.plugin.core.debug.gui.objects.components.ObjectEnumeratedColumnTableModel;
|
||||
import ghidra.app.plugin.core.debug.gui.objects.components.ObjectNode;
|
||||
import ghidra.app.plugin.core.debug.gui.objects.components.ObjectPane;
|
||||
import ghidra.app.plugin.core.debug.gui.objects.components.ObjectTable;
|
||||
import ghidra.app.plugin.core.debug.gui.objects.components.ObjectTree;
|
||||
import ghidra.app.plugin.core.debug.gui.DebuggerResources.*;
|
||||
import ghidra.app.plugin.core.debug.gui.objects.actions.*;
|
||||
import ghidra.app.plugin.core.debug.gui.objects.components.*;
|
||||
import ghidra.app.plugin.core.debug.mapping.DebuggerMemoryMapper;
|
||||
import ghidra.app.script.GhidraScript;
|
||||
import ghidra.app.script.GhidraScriptLoadException;
|
||||
import ghidra.app.script.GhidraScriptProvider;
|
||||
import ghidra.app.script.GhidraScriptUtil;
|
||||
import ghidra.app.script.GhidraState;
|
||||
import ghidra.app.services.ConsoleService;
|
||||
import ghidra.app.services.DebuggerListingService;
|
||||
import ghidra.app.services.DebuggerModelService;
|
||||
import ghidra.app.services.DebuggerStaticMappingService;
|
||||
import ghidra.app.services.DebuggerTraceManagerService;
|
||||
import ghidra.app.script.*;
|
||||
import ghidra.app.services.*;
|
||||
import ghidra.app.services.DebuggerTraceManagerService.ActivationCause;
|
||||
import ghidra.app.services.GraphDisplayBroker;
|
||||
import ghidra.app.services.TraceRecorder;
|
||||
import ghidra.async.AsyncFence;
|
||||
import ghidra.async.AsyncUtils;
|
||||
import ghidra.async.TypeSpec;
|
||||
import ghidra.dbg.AnnotatedDebuggerAttributeListener;
|
||||
import ghidra.dbg.DebugModelConventions;
|
||||
import ghidra.dbg.DebuggerModelListener;
|
||||
import ghidra.dbg.DebuggerObjectModel;
|
||||
import ghidra.async.*;
|
||||
import ghidra.dbg.*;
|
||||
import ghidra.dbg.DebuggerObjectModel.RefreshBehavior;
|
||||
import ghidra.dbg.error.DebuggerMemoryAccessException;
|
||||
import ghidra.dbg.target.TargetAccessConditioned;
|
||||
import ghidra.dbg.target.TargetAttachable;
|
||||
import ghidra.dbg.target.TargetAttacher;
|
||||
import ghidra.dbg.target.TargetBreakpointSpec;
|
||||
import ghidra.dbg.target.TargetBreakpointSpecContainer;
|
||||
import ghidra.dbg.target.TargetConfigurable;
|
||||
import ghidra.dbg.target.*;
|
||||
import ghidra.dbg.target.TargetConsole.Channel;
|
||||
import ghidra.dbg.target.TargetDetachable;
|
||||
import ghidra.dbg.target.TargetExecutionStateful;
|
||||
import ghidra.dbg.target.TargetExecutionStateful.TargetExecutionState;
|
||||
import ghidra.dbg.target.TargetFocusScope;
|
||||
import ghidra.dbg.target.TargetInterpreter;
|
||||
import ghidra.dbg.target.TargetInterruptible;
|
||||
import ghidra.dbg.target.TargetKillable;
|
||||
import ghidra.dbg.target.TargetLauncher;
|
||||
import ghidra.dbg.target.TargetMethod;
|
||||
import ghidra.dbg.target.TargetMethod.ParameterDescription;
|
||||
import ghidra.dbg.target.TargetMethod.TargetParameterMap;
|
||||
import ghidra.dbg.target.TargetObject;
|
||||
import ghidra.dbg.target.TargetProcess;
|
||||
import ghidra.dbg.target.TargetResumable;
|
||||
import ghidra.dbg.target.TargetSteppable;
|
||||
import ghidra.dbg.target.TargetSteppable.TargetStepKind;
|
||||
import ghidra.dbg.target.TargetTogglable;
|
||||
import ghidra.dbg.util.DebuggerCallbackReorderer;
|
||||
import ghidra.dbg.util.PathUtils;
|
||||
import ghidra.framework.model.Project;
|
||||
import ghidra.framework.options.AutoOptions;
|
||||
import ghidra.framework.options.SaveState;
|
||||
import ghidra.framework.options.annotation.AutoOptionDefined;
|
||||
import ghidra.framework.plugintool.AutoConfigState;
|
||||
import ghidra.framework.plugintool.AutoService;
|
||||
import ghidra.framework.plugintool.ComponentProviderAdapter;
|
||||
import ghidra.framework.plugintool.*;
|
||||
import ghidra.framework.plugintool.annotation.AutoConfigStateField;
|
||||
import ghidra.framework.plugintool.annotation.AutoServiceConsumed;
|
||||
import ghidra.program.model.address.Address;
|
||||
|
@ -166,9 +79,7 @@ import ghidra.program.util.ProgramLocation;
|
|||
import ghidra.program.util.ProgramSelection;
|
||||
import ghidra.trace.model.Trace;
|
||||
import ghidra.trace.model.thread.TraceThread;
|
||||
import ghidra.util.HelpLocation;
|
||||
import ghidra.util.Msg;
|
||||
import ghidra.util.Swing;
|
||||
import ghidra.util.*;
|
||||
import ghidra.util.datastruct.PrivatelyQueuedListener;
|
||||
import ghidra.util.table.GhidraTable;
|
||||
import ghidra.util.task.TaskMonitor;
|
||||
|
@ -793,7 +704,7 @@ public class DebuggerObjectsProvider extends ComponentProviderAdapter
|
|||
plugin.fireObjectUpdated(object);
|
||||
}
|
||||
|
||||
class ObjectActionContext extends ActionContext {
|
||||
class ObjectActionContext extends DefaultActionContext {
|
||||
|
||||
private DebuggerObjectsProvider provider;
|
||||
|
||||
|
|
|
@ -17,9 +17,9 @@ package ghidra.app.plugin.core.debug.gui.register;
|
|||
|
||||
import java.util.Collection;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
|
||||
public class DebuggerAvailableRegistersActionContext extends ActionContext {
|
||||
public class DebuggerAvailableRegistersActionContext extends DefaultActionContext {
|
||||
private final Collection<AvailableRegisterRow> selection;
|
||||
|
||||
public DebuggerAvailableRegistersActionContext(Collection<AvailableRegisterRow> selection) {
|
||||
|
|
|
@ -15,10 +15,10 @@
|
|||
*/
|
||||
package ghidra.app.plugin.core.debug.gui.register;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import docking.widgets.table.GTable;
|
||||
|
||||
public class DebuggerRegisterActionContext extends ActionContext {
|
||||
public class DebuggerRegisterActionContext extends DefaultActionContext {
|
||||
private final RegisterRow selected;
|
||||
|
||||
public DebuggerRegisterActionContext(DebuggerRegistersProvider provider, RegisterRow selected,
|
||||
|
|
|
@ -17,9 +17,9 @@ package ghidra.app.plugin.core.debug.gui.stack;
|
|||
|
||||
import java.awt.Component;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
|
||||
public class DebuggerStackActionContext extends ActionContext {
|
||||
public class DebuggerStackActionContext extends DefaultActionContext {
|
||||
|
||||
private final StackFrameRow frame;
|
||||
|
||||
|
|
|
@ -19,14 +19,14 @@ import java.util.function.Function;
|
|||
|
||||
import javax.swing.tree.TreePath;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.ComponentProvider;
|
||||
import docking.DefaultActionContext;
|
||||
import docking.widgets.tree.GTree;
|
||||
import docking.widgets.tree.GTreeNode;
|
||||
import ghidra.app.services.DebuggerModelService;
|
||||
import ghidra.dbg.DebuggerObjectModel;
|
||||
|
||||
public class DebuggerModelActionContext extends ActionContext {
|
||||
public class DebuggerModelActionContext extends DefaultActionContext {
|
||||
private final TreePath path;
|
||||
|
||||
DebuggerModelActionContext(ComponentProvider provider, TreePath path, GTree tree) {
|
||||
|
|
|
@ -15,11 +15,11 @@
|
|||
*/
|
||||
package ghidra.app.plugin.core.debug.gui.thread;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import ghidra.trace.model.Trace;
|
||||
import ghidra.trace.model.thread.TraceThread;
|
||||
|
||||
public class DebuggerThreadActionContext extends ActionContext {
|
||||
public class DebuggerThreadActionContext extends DefaultActionContext {
|
||||
private final Trace trace;
|
||||
private final TraceThread thread;
|
||||
|
||||
|
|
|
@ -15,10 +15,10 @@
|
|||
*/
|
||||
package ghidra.app.plugin.core.debug.gui.thread;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import ghidra.trace.model.Trace;
|
||||
|
||||
public class DebuggerTraceFileActionContext extends ActionContext {
|
||||
public class DebuggerTraceFileActionContext extends DefaultActionContext {
|
||||
private final Trace trace;
|
||||
|
||||
public DebuggerTraceFileActionContext(Trace trace) {
|
||||
|
|
|
@ -19,9 +19,9 @@ import java.awt.Component;
|
|||
import java.util.Collection;
|
||||
import java.util.Set;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
|
||||
public class DebuggerWatchActionContext extends ActionContext {
|
||||
public class DebuggerWatchActionContext extends DefaultActionContext {
|
||||
private final Set<WatchRow> sel;
|
||||
|
||||
public DebuggerWatchActionContext(DebuggerWatchesProvider provider,
|
||||
|
|
|
@ -15,12 +15,13 @@
|
|||
*/
|
||||
package ghidra.app.plugin.core.debug.gui.console;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import org.junit.*;
|
||||
import org.junit.rules.TestName;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import docking.action.builder.ActionBuilder;
|
||||
import ghidra.app.plugin.core.debug.gui.AbstractGhidraHeadedDebuggerGUITest;
|
||||
import ghidra.app.plugin.core.debug.gui.DebuggerResources;
|
||||
|
@ -29,7 +30,7 @@ import help.screenshot.GhidraScreenShotGenerator;
|
|||
|
||||
public class DebuggerConsolePluginScreenShots extends GhidraScreenShotGenerator {
|
||||
|
||||
public static class ScreenShotActionContext extends ActionContext {
|
||||
public static class ScreenShotActionContext extends DefaultActionContext {
|
||||
}
|
||||
|
||||
DebuggerConsolePlugin consolePlugin;
|
||||
|
|
|
@ -39,6 +39,7 @@ import org.junit.runner.Description;
|
|||
|
||||
import db.Transaction;
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import docking.action.ActionContextProvider;
|
||||
import docking.action.DockingActionIf;
|
||||
import docking.widgets.table.DynamicTableColumn;
|
||||
|
@ -477,7 +478,7 @@ public abstract class AbstractGhidraHeadedDebuggerGUITest
|
|||
DockingActionIf action, boolean wait) {
|
||||
ActionContext context = waitForValue(() -> {
|
||||
ActionContext ctx = provider == null
|
||||
? new ActionContext()
|
||||
? new DefaultActionContext()
|
||||
: provider.getActionContext(null);
|
||||
if (!action.isEnabledForContext(ctx)) {
|
||||
return null;
|
||||
|
|
|
@ -15,12 +15,12 @@
|
|||
*/
|
||||
package ghidra.app.plugin.core.debug.gui.console;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import docking.action.builder.ActionBuilder;
|
||||
import ghidra.app.plugin.core.debug.gui.AbstractGhidraHeadedDebuggerGUITest;
|
||||
import ghidra.app.plugin.core.debug.gui.DebuggerResources;
|
||||
|
@ -36,7 +36,7 @@ public class DebuggerConsoleProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
|||
consoleProvider = waitForComponentProvider(DebuggerConsoleProvider.class);
|
||||
}
|
||||
|
||||
public static class TestConsoleActionContext extends ActionContext {
|
||||
public static class TestConsoleActionContext extends DefaultActionContext {
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -209,9 +209,8 @@ public class RandomForestFunctionFinderPlugin extends ProgramPlugin
|
|||
.menuGroup("search for", null)
|
||||
.description("Train models to search for function starts")
|
||||
.helpLocation(new HelpLocation(getName(), getName()))
|
||||
.withContext(NavigatableActionContext.class)
|
||||
.withContext(NavigatableActionContext.class, true)
|
||||
.validContextWhen(c -> !(c instanceof RestrictedAddressSetContext))
|
||||
.supportsDefaultToolContext(true)
|
||||
.onAction(c -> {
|
||||
displayDialog(c);
|
||||
})
|
||||
|
|
|
@ -20,8 +20,7 @@ import java.awt.event.*;
|
|||
|
||||
import javax.swing.*;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.WindowPosition;
|
||||
import docking.*;
|
||||
import docking.action.*;
|
||||
import docking.widgets.EmptyBorderButton;
|
||||
import generic.theme.GIcon;
|
||||
|
@ -132,7 +131,7 @@ public class HelloWorldComponentProvider extends ComponentProviderAdapter {
|
|||
if (event != null) {
|
||||
Object source = event.getSource();
|
||||
if (source == activeButtonObj) {
|
||||
return new ActionContext(this, activeButtonObj);
|
||||
return new DefaultActionContext(this, activeButtonObj);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
|
|
@ -45,7 +45,7 @@ public abstract class NavigatableContextAction extends DockingAction {
|
|||
public NavigatableContextAction(String name, String owner,
|
||||
boolean supportsRestrictedAddressSetContext) {
|
||||
super(name, owner);
|
||||
setSupportsDefaultToolContext(true);
|
||||
setContextClass(NavigatableActionContext.class, true);
|
||||
this.supportsRestrictedAddressSetContext = supportsRestrictedAddressSetContext;
|
||||
}
|
||||
|
||||
|
@ -58,7 +58,7 @@ public abstract class NavigatableContextAction extends DockingAction {
|
|||
*/
|
||||
public NavigatableContextAction(String name, String owner, KeyBindingType type) {
|
||||
super(name, owner, type);
|
||||
setSupportsDefaultToolContext(true);
|
||||
setContextClass(NavigatableActionContext.class, true);
|
||||
this.supportsRestrictedAddressSetContext = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -18,11 +18,11 @@ package ghidra.app.context;
|
|||
import java.awt.Component;
|
||||
import java.awt.KeyboardFocusManager;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.ComponentProvider;
|
||||
import docking.DefaultActionContext;
|
||||
import ghidra.program.model.listing.Program;
|
||||
|
||||
public class ProgramActionContext extends ActionContext {
|
||||
public class ProgramActionContext extends DefaultActionContext {
|
||||
protected final Program program;
|
||||
|
||||
public ProgramActionContext(ComponentProvider provider, Program program) {
|
||||
|
|
|
@ -105,28 +105,28 @@ public class AutoAnalysisPlugin extends Plugin implements AutoAnalysisManagerLis
|
|||
// they are inserted
|
||||
int subGroupIndex = 0;
|
||||
|
||||
//@formatter:off
|
||||
autoAnalyzeAction =
|
||||
new ActionBuilder("Auto Analyze", getName())
|
||||
.supportsDefaultToolContext(true)
|
||||
autoAnalyzeAction = new ActionBuilder("Auto Analyze", getName())
|
||||
.menuPath("&Analysis", "&Auto Analyze...")
|
||||
.menuGroup(ANALYZE_GROUP_NAME, "" + subGroupIndex++)
|
||||
.keyBinding("A")
|
||||
.validContextWhen(ac -> {
|
||||
updateActionName(ac);
|
||||
return ac instanceof ListingActionContext;
|
||||
})
|
||||
.withContext(ListingActionContext.class, true)
|
||||
.onAction(this::analyzeCallback)
|
||||
.buildAndInstall(tool);
|
||||
|
||||
// we need to specially override the validContextWhen so that as a side effect, we
|
||||
// can change the action name to not include a program name when the action is
|
||||
// actually invalid.
|
||||
autoAnalyzeAction.validContextWhen(ac -> {
|
||||
updateActionName(ac);
|
||||
return ac instanceof ListingActionContext;
|
||||
});
|
||||
|
||||
new ActionBuilder("Analyze All Open", getName())
|
||||
.supportsDefaultToolContext(true)
|
||||
.menuPath("&Analysis", "Analyze All &Open...")
|
||||
.menuGroup(ANALYZE_GROUP_NAME, "" + subGroupIndex++)
|
||||
.withContext(ListingActionContext.class, true)
|
||||
.onAction(c -> analyzeAllCallback())
|
||||
.validContextWhen(ac -> ac instanceof ListingActionContext)
|
||||
.buildAndInstall(tool);
|
||||
//@formatter:on
|
||||
|
||||
tool.setMenuGroup(new String[] { "Analysis", "One Shot" }, ANALYZE_GROUP_NAME);
|
||||
|
||||
|
@ -326,7 +326,7 @@ public class AutoAnalysisPlugin extends Plugin implements AutoAnalysisManagerLis
|
|||
null, ANALYZE_GROUP_NAME));
|
||||
setHelpLocation(new HelpLocation("AutoAnalysisPlugin", "Auto_Analyzers"));
|
||||
|
||||
setSupportsDefaultToolContext(true);
|
||||
setContextClass(ListingActionContext.class, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -25,6 +25,7 @@ import docking.action.MenuData;
|
|||
import docking.action.builder.ActionBuilder;
|
||||
import docking.tool.ToolConstants;
|
||||
import ghidra.app.CorePluginPackage;
|
||||
import ghidra.app.context.ListingActionContext;
|
||||
import ghidra.app.context.NavigatableActionContext;
|
||||
import ghidra.app.events.ProgramClosedPluginEvent;
|
||||
import ghidra.app.events.ProgramSelectionPluginEvent;
|
||||
|
@ -100,10 +101,9 @@ public class FindPossibleReferencesPlugin extends Plugin {
|
|||
action = new ActionBuilder(SEARCH_DIRECT_REFS_ACTION_NAME, getName())
|
||||
.menuPath(ToolConstants.MENU_SEARCH, "For Direct References")
|
||||
.menuGroup("search for")
|
||||
.supportsDefaultToolContext(true)
|
||||
.helpLocation(new HelpLocation(HelpTopics.SEARCH, SEARCH_DIRECT_REFS_ACTION_NAME))
|
||||
.description(getPluginDescription().getDescription())
|
||||
.withContext(NavigatableActionContext.class)
|
||||
.withContext(ListingActionContext.class, true)
|
||||
.inWindow(ActionBuilder.When.CONTEXT_MATCHES)
|
||||
.onAction(this::findReferences)
|
||||
.enabledWhen(this::hasCorrectAddressSize)
|
||||
|
|
|
@ -23,8 +23,7 @@ import java.util.concurrent.atomic.AtomicInteger;
|
|||
import javax.swing.*;
|
||||
import javax.swing.tree.TreePath;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.WindowPosition;
|
||||
import docking.*;
|
||||
import docking.action.*;
|
||||
import docking.resources.icons.NumberIcon;
|
||||
import docking.widgets.dialogs.NumberInputDialog;
|
||||
|
@ -712,7 +711,7 @@ public class CallTreeProvider extends ComponentProviderAdapter implements Domain
|
|||
@Override
|
||||
public ActionContext getActionContext(MouseEvent e) {
|
||||
if (e == null) {
|
||||
return new ActionContext(this, getActiveComponent());
|
||||
return new DefaultActionContext(this, getActiveComponent());
|
||||
}
|
||||
|
||||
Object source = e.getSource();
|
||||
|
@ -722,7 +721,7 @@ public class CallTreeProvider extends ComponentProviderAdapter implements Domain
|
|||
if (outgoingTree.isMyJTree(jTree)) {
|
||||
gTree = outgoingTree;
|
||||
}
|
||||
return new ActionContext(this, gTree);
|
||||
return new DefaultActionContext(this, gTree);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
|
|
@ -114,7 +114,6 @@ public abstract class AbstractCodeBrowserPlugin<P extends CodeViewerProvider> ex
|
|||
initMiscellaneousOptions();
|
||||
displayOptions.addOptionsChangeListener(this);
|
||||
fieldOptions.addOptionsChangeListener(this);
|
||||
tool.setDefaultComponent(connectedProvider);
|
||||
markerChangeListener = new MarkerChangeListener(connectedProvider);
|
||||
}
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@ import docking.widgets.fieldpanel.FieldPanel;
|
|||
import docking.widgets.fieldpanel.support.FieldSelection;
|
||||
import docking.widgets.fieldpanel.support.ViewerPosition;
|
||||
import ghidra.app.CorePluginPackage;
|
||||
import ghidra.app.context.*;
|
||||
import ghidra.app.events.*;
|
||||
import ghidra.app.plugin.PluginCategoryNames;
|
||||
import ghidra.app.services.*;
|
||||
|
@ -37,6 +38,7 @@ import ghidra.program.model.listing.Program;
|
|||
import ghidra.program.util.ProgramLocation;
|
||||
import ghidra.program.util.ProgramSelection;
|
||||
|
||||
//@formatter:off
|
||||
@PluginInfo(
|
||||
status = PluginStatus.RELEASED,
|
||||
packageName = CorePluginPackage.NAME,
|
||||
|
@ -59,6 +61,7 @@ import ghidra.program.util.ProgramSelection;
|
|||
ProgramClosedPluginEvent.class, ProgramLocationPluginEvent.class,
|
||||
ViewChangedPluginEvent.class, ProgramHighlightPluginEvent.class },
|
||||
eventsProduced = { ProgramLocationPluginEvent.class, ProgramSelectionPluginEvent.class })
|
||||
//@formatter:on
|
||||
public class CodeBrowserPlugin extends AbstractCodeBrowserPlugin<CodeViewerProvider> {
|
||||
|
||||
public CodeBrowserPlugin(PluginTool tool) {
|
||||
|
@ -66,6 +69,25 @@ public class CodeBrowserPlugin extends AbstractCodeBrowserPlugin<CodeViewerProvi
|
|||
|
||||
registerServiceProvided(FieldMouseHandlerService.class,
|
||||
connectedProvider.getFieldNavigator());
|
||||
|
||||
// sets the primary code viewer window as the default component to get focus
|
||||
tool.setDefaultComponent(connectedProvider);
|
||||
|
||||
// sets the primary code viewer window as the default context provider for actions
|
||||
// that use the specified context types.
|
||||
tool.registerDefaultContextProvider(ProgramActionContext.class, connectedProvider);
|
||||
tool.registerDefaultContextProvider(NavigatableActionContext.class, connectedProvider);
|
||||
tool.registerDefaultContextProvider(CodeViewerActionContext.class, connectedProvider);
|
||||
tool.registerDefaultContextProvider(ListingActionContext.class, connectedProvider);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dispose() {
|
||||
tool.unregisterDefaultContextProvider(ProgramActionContext.class, connectedProvider);
|
||||
tool.unregisterDefaultContextProvider(NavigatableActionContext.class, connectedProvider);
|
||||
tool.unregisterDefaultContextProvider(CodeViewerActionContext.class, connectedProvider);
|
||||
tool.unregisterDefaultContextProvider(ListingActionContext.class, connectedProvider);
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -68,9 +68,8 @@ public class CodeBrowserSelectionPlugin extends Plugin {
|
|||
.menuPath(ToolConstants.MENU_SELECTION, "&All in View")
|
||||
.menuGroup(SELECT_GROUP, "a")
|
||||
.keyBinding("ctrl A")
|
||||
.supportsDefaultToolContext(true)
|
||||
.helpLocation(new HelpLocation(HelpTopics.SELECTION, "Select All"))
|
||||
.withContext(CodeViewerActionContext.class)
|
||||
.withContext(CodeViewerActionContext.class, true)
|
||||
.inWindow(ActionBuilder.When.CONTEXT_MATCHES)
|
||||
.onAction(c -> ((CodeViewerProvider) c.getComponentProvider()).selectAll())
|
||||
.buildAndInstall(tool);
|
||||
|
@ -78,9 +77,8 @@ public class CodeBrowserSelectionPlugin extends Plugin {
|
|||
new ActionBuilder("Clear Selection", getName())
|
||||
.menuPath(ToolConstants.MENU_SELECTION, "&Clear Selection")
|
||||
.menuGroup(SELECT_GROUP, "b")
|
||||
.supportsDefaultToolContext(true)
|
||||
.helpLocation(new HelpLocation(HelpTopics.SELECTION, "Clear Selection"))
|
||||
.withContext(CodeViewerActionContext.class)
|
||||
.withContext(CodeViewerActionContext.class, true)
|
||||
.inWindow(ActionBuilder.When.CONTEXT_MATCHES)
|
||||
.onAction(c -> ((CodeViewerProvider) c.getComponentProvider())
|
||||
.setSelection(new ProgramSelection()))
|
||||
|
@ -89,9 +87,8 @@ public class CodeBrowserSelectionPlugin extends Plugin {
|
|||
new ActionBuilder("Select Complement", getName())
|
||||
.menuPath(ToolConstants.MENU_SELECTION, "&Complement")
|
||||
.menuGroup(SELECT_GROUP, "c")
|
||||
.supportsDefaultToolContext(true)
|
||||
.helpLocation(new HelpLocation(HelpTopics.SELECTION, "Select Complement"))
|
||||
.withContext(CodeViewerActionContext.class)
|
||||
.withContext(CodeViewerActionContext.class, true)
|
||||
.inWindow(ActionBuilder.When.CONTEXT_MATCHES)
|
||||
.onAction(c -> ((CodeViewerProvider) c.getComponentProvider()).selectComplement())
|
||||
.buildAndInstall(tool);
|
||||
|
@ -102,8 +99,7 @@ public class CodeBrowserSelectionPlugin extends Plugin {
|
|||
.menuPath(ToolConstants.MENU_SELECTION, "Create Table From Selection")
|
||||
.menuGroup("SelectUtils")
|
||||
.helpLocation(new HelpLocation("CodeBrowserPlugin", "Selection_Table"))
|
||||
.supportsDefaultToolContext(true)
|
||||
.withContext(CodeViewerActionContext.class)
|
||||
.withContext(CodeViewerActionContext.class, true)
|
||||
.inWindow(ActionBuilder.When.CONTEXT_MATCHES)
|
||||
.onAction(c -> createTable((CodeViewerProvider) c.getComponentProvider()))
|
||||
.buildAndInstall(tool);
|
||||
|
|
|
@ -53,7 +53,7 @@ public class MarkAndSelectionAction extends ToggleDockingAction {
|
|||
new ToolBarData(unarmedIcon, ToolConstants.TOOLBAR_GROUP_THREE, "Z"));
|
||||
|
||||
setHelpLocation((new HelpLocation(HelpTopics.SELECTION, "Mark_And_Select")));
|
||||
setSupportsDefaultToolContext(true);
|
||||
setContextClass(NavigatableActionContext.class, true);
|
||||
addToWindowWhen(NavigatableActionContext.class);
|
||||
|
||||
}
|
||||
|
|
|
@ -15,13 +15,13 @@
|
|||
*/
|
||||
package ghidra.app.plugin.core.commentwindow;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import ghidra.util.table.GhidraTable;
|
||||
|
||||
/*
|
||||
* This the action context for actions invoked from the Comment Window
|
||||
*/
|
||||
public class CommentWindowContext extends ActionContext {
|
||||
public class CommentWindowContext extends DefaultActionContext {
|
||||
|
||||
CommentWindowContext(CommentWindowProvider provider, GhidraTable commentTable) {
|
||||
super(provider, commentTable);
|
||||
|
|
|
@ -26,6 +26,7 @@ import javax.swing.plaf.UIResource;
|
|||
import com.google.common.base.Predicate;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import docking.widgets.DropDownSelectionTextField;
|
||||
import docking.widgets.OptionDialog;
|
||||
import docking.widgets.button.GButton;
|
||||
|
@ -757,7 +758,7 @@ public class BitFieldEditorPanel extends JPanel {
|
|||
return null;
|
||||
}
|
||||
|
||||
class BitFieldEditorContext extends ActionContext {
|
||||
class BitFieldEditorContext extends DefaultActionContext {
|
||||
|
||||
private int selectedBitOffset;
|
||||
private DataTypeComponent selectedDtc;
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
*/
|
||||
package ghidra.app.plugin.core.compositeeditor;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import ghidra.program.model.data.*;
|
||||
|
||||
/**
|
||||
|
@ -23,7 +23,7 @@ import ghidra.program.model.data.*;
|
|||
* composite with a single selected component, and the composite is associated with a
|
||||
* stand-alone archive.
|
||||
*/
|
||||
public class ComponentStandAloneActionContext extends ActionContext
|
||||
public class ComponentStandAloneActionContext extends DefaultActionContext
|
||||
implements ComponentContext {
|
||||
|
||||
private DataTypeComponent component;
|
||||
|
|
|
@ -19,8 +19,7 @@ import java.awt.event.MouseEvent;
|
|||
|
||||
import javax.swing.*;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.ComponentProvider;
|
||||
import docking.*;
|
||||
import docking.widgets.OptionDialog;
|
||||
import generic.theme.GIcon;
|
||||
import ghidra.app.context.ProgramActionContext;
|
||||
|
@ -189,7 +188,7 @@ public abstract class CompositeEditorProvider extends ComponentProviderAdapter
|
|||
else if (componentAt != null && (originalDTM instanceof StandAloneDataTypeManager)) {
|
||||
return new ComponentStandAloneActionContext(this, componentAt);
|
||||
}
|
||||
return new ActionContext(this, null);
|
||||
return new DefaultActionContext(this, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -26,8 +26,7 @@ import javax.swing.event.*;
|
|||
import javax.swing.event.HyperlinkEvent.EventType;
|
||||
import javax.swing.tree.TreePath;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DockingWindowManager;
|
||||
import docking.*;
|
||||
import docking.action.DockingAction;
|
||||
import docking.action.ToggleDockingAction;
|
||||
import docking.event.mouse.GMouseListenerAdapter;
|
||||
|
@ -348,7 +347,7 @@ public class DataTypesProvider extends ComponentProviderAdapter {
|
|||
Object source = event.getSource();
|
||||
if (source instanceof JTextField || source instanceof JTextPane) {
|
||||
Component component = (Component) source;
|
||||
return new ActionContext(this, source, component);
|
||||
return new DefaultActionContext(this, source, component);
|
||||
}
|
||||
|
||||
Point point = event.getPoint();
|
||||
|
|
|
@ -27,8 +27,7 @@ import javax.swing.table.TableCellEditor;
|
|||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.ComponentProvider;
|
||||
import docking.*;
|
||||
import docking.action.*;
|
||||
import docking.action.builder.ToggleActionBuilder;
|
||||
import docking.widgets.OptionDialog;
|
||||
|
@ -152,7 +151,7 @@ public class EnumEditorProvider extends ComponentProviderAdapter
|
|||
|
||||
@Override
|
||||
public ActionContext getActionContext(MouseEvent event) {
|
||||
return new ActionContext(this, editorPanel.getTable());
|
||||
return new DefaultActionContext(this, editorPanel.getTable());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -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,10 +15,10 @@
|
|||
*/
|
||||
package ghidra.app.plugin.core.datawindow;
|
||||
|
||||
import docking.DefaultActionContext;
|
||||
import ghidra.util.table.GhidraTable;
|
||||
import docking.ActionContext;
|
||||
|
||||
public class DataWindowContext extends ActionContext {
|
||||
public class DataWindowContext extends DefaultActionContext {
|
||||
|
||||
DataWindowContext(DataWindowProvider provider, GhidraTable dataTable) {
|
||||
super(provider, dataTable);
|
||||
|
|
|
@ -26,8 +26,7 @@ import javax.swing.event.DocumentListener;
|
|||
import javax.swing.text.Document;
|
||||
import javax.swing.undo.UndoableEdit;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.ComponentProvider;
|
||||
import docking.*;
|
||||
import docking.action.*;
|
||||
import docking.actions.KeyBindingUtils;
|
||||
import docking.options.editor.FontEditor;
|
||||
|
@ -256,7 +255,7 @@ public class TextEditorComponentProvider extends ComponentProviderAdapter {
|
|||
|
||||
ActionContextProvider acp = e -> {
|
||||
ComponentProvider p = TextEditorComponentProvider.this;
|
||||
return new ActionContext(p);
|
||||
return new DefaultActionContext(p);
|
||||
};
|
||||
|
||||
KeyBindingUtils.registerAction(textarea, saveAction, acp);
|
||||
|
|
|
@ -25,6 +25,7 @@ import javax.swing.*;
|
|||
import javax.swing.table.*;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import generic.theme.GIcon;
|
||||
import ghidra.app.services.GoToService;
|
||||
import ghidra.framework.plugintool.ComponentProviderAdapter;
|
||||
|
@ -77,7 +78,7 @@ public class FunctionWindowProvider extends ComponentProviderAdapter {
|
|||
|
||||
@Override
|
||||
public ActionContext getActionContext(MouseEvent event) {
|
||||
return new ActionContext(this, functionTable);
|
||||
return new DefaultActionContext(this, functionTable);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -116,7 +116,8 @@ public class AboutProgramPlugin extends Plugin implements ApplicationLevelPlugin
|
|||
}
|
||||
};
|
||||
aboutAction.addToWindowWhen(ProgramActionContext.class);
|
||||
aboutAction.setSupportsDefaultToolContext(true);
|
||||
// use the CodeBrowser as a backup context provider
|
||||
aboutAction.setContextClass(ProgramActionContext.class, true);
|
||||
|
||||
aboutAction.setMenuBarData(
|
||||
new MenuData(new String[] { ToolConstants.MENU_HELP, ACTION_NAME }, null, "ZZZ"));
|
||||
|
|
|
@ -53,8 +53,6 @@ public abstract class AbstractNextPreviousAction extends NavigatableContextActio
|
|||
public AbstractNextPreviousAction(PluginTool tool, String name, String owner, String subGroup) {
|
||||
super(name, owner);
|
||||
this.tool = tool;
|
||||
setSupportsDefaultToolContext(true);
|
||||
|
||||
ToolBarData toolBarData =
|
||||
new ToolBarData(getIcon(), ToolConstants.TOOLBAR_GROUP_FOUR);
|
||||
toolBarData.setToolBarSubGroup(subGroup);
|
||||
|
|
|
@ -66,8 +66,7 @@ public class NextPreviousBookmarkAction extends MultiStateDockingAction<String>
|
|||
public NextPreviousBookmarkAction(PluginTool tool, String owner, String subGroup) {
|
||||
super("Next Bookmark", owner);
|
||||
this.tool = tool;
|
||||
|
||||
setSupportsDefaultToolContext(true);
|
||||
setContextClass(NavigatableActionContext.class, true);
|
||||
|
||||
ToolBarData toolBarData =
|
||||
new ToolBarData(BOOKMARK_ICON, ToolConstants.TOOLBAR_GROUP_FOUR);
|
||||
|
|
|
@ -23,6 +23,7 @@ import javax.swing.*;
|
|||
import javax.swing.event.ChangeListener;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import docking.action.*;
|
||||
import docking.widgets.table.GTable;
|
||||
import generic.theme.GIcon;
|
||||
|
@ -402,7 +403,7 @@ public class LocationReferencesProvider extends ComponentProviderAdapter
|
|||
|
||||
@Override
|
||||
public ActionContext getActionContext(MouseEvent event) {
|
||||
return new ActionContext(this, referencesPanel.getTable());
|
||||
return new DefaultActionContext(this, referencesPanel.getTable());
|
||||
}
|
||||
|
||||
//==================================================================================================
|
||||
|
|
|
@ -23,6 +23,7 @@ import javax.swing.JComponent;
|
|||
import javax.swing.event.ChangeEvent;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import docking.action.DockingAction;
|
||||
import ghidra.app.events.ViewChangedPluginEvent;
|
||||
import ghidra.app.services.GoToService;
|
||||
|
@ -102,7 +103,7 @@ class TreeViewProvider implements ViewProviderService {
|
|||
|
||||
@Override
|
||||
public ActionContext getActionContext(MouseEvent event) {
|
||||
return new ActionContext().setContextObject(getActivePopupObject(event));
|
||||
return new DefaultActionContext().setContextObject(getActivePopupObject(event));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -24,6 +24,7 @@ import javax.swing.*;
|
|||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import docking.action.builder.ActionBuilder;
|
||||
import docking.widgets.dialogs.InputDialog;
|
||||
import docking.widgets.table.AbstractSortedTableModel;
|
||||
|
@ -148,7 +149,7 @@ public class ExternalReferencesProvider extends ComponentProviderAdapter {
|
|||
|
||||
@Override
|
||||
public ActionContext getActionContext(MouseEvent event) {
|
||||
return new ActionContext(this, table);
|
||||
return new DefaultActionContext(this, table);
|
||||
}
|
||||
|
||||
private JPanel buildMainPanel() {
|
||||
|
|
|
@ -15,13 +15,13 @@
|
|||
*/
|
||||
package ghidra.app.plugin.core.scalartable;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import ghidra.util.table.GhidraTable;
|
||||
|
||||
/**
|
||||
* Plugin context for the scalar plugin that will initialize an instance of ActionContext with the scalarTable
|
||||
*/
|
||||
public class ScalarSearchContext extends ActionContext {
|
||||
public class ScalarSearchContext extends DefaultActionContext {
|
||||
|
||||
ScalarSearchContext(ScalarSearchProvider provider, GhidraTable scalarTable) {
|
||||
super(provider, scalarTable);
|
||||
|
|
|
@ -15,17 +15,16 @@
|
|||
*/
|
||||
package ghidra.app.plugin.core.script;
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.event.*;
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.function.Supplier;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.event.*;
|
||||
import java.io.*;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.event.ChangeEvent;
|
||||
import javax.swing.event.ChangeListener;
|
||||
|
@ -38,6 +37,7 @@ import javax.swing.tree.TreeSelectionModel;
|
|||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import docking.action.KeyBindingData;
|
||||
import docking.event.mouse.GMouseListenerAdapter;
|
||||
import docking.widgets.OptionDialog;
|
||||
|
@ -1132,11 +1132,11 @@ public class GhidraScriptComponentProvider extends ComponentProviderAdapter {
|
|||
|
||||
int[] selectedRows = scriptTable.getSelectedRows();
|
||||
if (selectedRows.length != 1) {
|
||||
return new ActionContext(this, scriptTable); // can only work on one selection at a time
|
||||
return new DefaultActionContext(this, scriptTable); // can only work on one selection at a time
|
||||
}
|
||||
|
||||
ResourceFile script = tableModel.getRowObject(selectedRows[0]);
|
||||
return new ActionContext(this, script, scriptTable);
|
||||
return new DefaultActionContext(this, script, scriptTable);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -384,10 +384,9 @@ public class SearchTextPlugin extends ProgramPlugin implements OptionsChangeList
|
|||
.keyBinding("ctrl shift E")
|
||||
.description(DESCRIPTION)
|
||||
.helpLocation(new HelpLocation(HelpTopics.SEARCH, "Search Text"))
|
||||
.withContext(NavigatableActionContext.class)
|
||||
.withContext(NavigatableActionContext.class, true)
|
||||
.validContextWhen(c -> !(c instanceof RestrictedAddressSetContext))
|
||||
.inWindow(ActionBuilder.When.CONTEXT_MATCHES)
|
||||
.supportsDefaultToolContext(true)
|
||||
.onAction(c -> {
|
||||
setNavigatable(c.getNavigatable());
|
||||
displayDialog(c);
|
||||
|
@ -399,9 +398,8 @@ public class SearchTextPlugin extends ProgramPlugin implements OptionsChangeList
|
|||
.menuGroup("search", subGroup)
|
||||
.keyBinding("ctrl shift F3")
|
||||
.description(DESCRIPTION)
|
||||
.supportsDefaultToolContext(true)
|
||||
.helpLocation(new HelpLocation(HelpTopics.SEARCH, "Repeat Text Search"))
|
||||
.withContext(NavigatableActionContext.class)
|
||||
.withContext(NavigatableActionContext.class, true)
|
||||
.inWindow(ActionBuilder.When.CONTEXT_MATCHES)
|
||||
.enabledWhen(c -> searchedOnce)
|
||||
.onAction(c -> {
|
||||
|
|
|
@ -62,9 +62,7 @@ class SelectByFlowAction extends ListingContextAction {
|
|||
super(name, plugin.getName());
|
||||
this.selectByFlowPlugin = plugin;
|
||||
this.selectionType = selectionType;
|
||||
|
||||
// this is in the main tool menu, so make it a tool action
|
||||
setSupportsDefaultToolContext(true);
|
||||
setContextClass(ListingActionContext.class, true);
|
||||
|
||||
String[] menuPath = null;
|
||||
if (selectionType == SelectByFlowPlugin.SELECT_FUNCTIONS) {
|
||||
|
|
|
@ -18,14 +18,14 @@ package ghidra.app.plugin.core.strings;
|
|||
import java.util.List;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import ghidra.app.context.DataLocationListContext;
|
||||
import ghidra.program.model.listing.Data;
|
||||
import ghidra.program.model.listing.Program;
|
||||
import ghidra.program.util.ProgramLocation;
|
||||
import ghidra.util.table.GhidraTable;
|
||||
|
||||
public class ViewStringsContext extends ActionContext implements DataLocationListContext {
|
||||
public class ViewStringsContext extends DefaultActionContext implements DataLocationListContext {
|
||||
|
||||
private ViewStringsProvider viewStringsProvider;
|
||||
|
||||
|
|
|
@ -25,8 +25,7 @@ import javax.swing.*;
|
|||
import javax.swing.event.TableModelEvent;
|
||||
import javax.swing.event.TableModelListener;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.ComponentProviderActivationListener;
|
||||
import docking.*;
|
||||
import docking.action.DockingAction;
|
||||
import docking.action.MenuData;
|
||||
import docking.widgets.table.AbstractSortedTableModel;
|
||||
|
@ -394,7 +393,7 @@ public class TableComponentProvider<T> extends ComponentProviderAdapter
|
|||
|
||||
@Override
|
||||
public ActionContext getActionContext(MouseEvent event) {
|
||||
return new ActionContext(this, threadedPanel.getTable());
|
||||
return new DefaultActionContext(this, threadedPanel.getTable());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -42,7 +42,6 @@ import ghidra.program.util.ProgramSelection;
|
|||
*/
|
||||
@ServiceInfo(defaultProvider = CodeBrowserPlugin.class)
|
||||
public interface CodeViewerService {
|
||||
|
||||
/**
|
||||
* Add a provider that shows an overview of the program.
|
||||
* @param overviewProvider provider to add
|
||||
|
|
|
@ -2085,18 +2085,18 @@ public class ListingCodeComparisonPanel
|
|||
|
||||
Object leftMarginContext = getContextForMarginPanels(leftPanel, event);
|
||||
if (leftMarginContext != null) {
|
||||
return new ActionContext(provider).setContextObject(leftMarginContext);
|
||||
return new DefaultActionContext(provider).setContextObject(leftMarginContext);
|
||||
}
|
||||
Object rightMarginContext = getContextForMarginPanels(rightPanel, event);
|
||||
if (rightMarginContext != null) {
|
||||
return new ActionContext(provider).setContextObject(rightMarginContext);
|
||||
return new DefaultActionContext(provider).setContextObject(rightMarginContext);
|
||||
}
|
||||
|
||||
Object source = event.getSource();
|
||||
if (source instanceof FieldHeaderComp) {
|
||||
FieldHeaderLocation fieldHeaderLocation =
|
||||
leftPanel.getFieldHeader().getFieldHeaderLocation(event.getPoint());
|
||||
return new ActionContext(provider).setContextObject(fieldHeaderLocation);
|
||||
return new DefaultActionContext(provider).setContextObject(fieldHeaderLocation);
|
||||
}
|
||||
|
||||
Navigatable focusedNavigatable = dualListingPanel.getFocusedNavigatable();
|
||||
|
@ -2689,13 +2689,15 @@ public class ListingCodeComparisonPanel
|
|||
// Are we on a marker margin of the left listing? Return that margin's context.
|
||||
Object sourceMarginContextObject = getContextObjectForMarginPanels(sourcePanel, event);
|
||||
if (sourceMarginContextObject != null) {
|
||||
return new ActionContext(provider).setContextObject(sourceMarginContextObject);
|
||||
return new DefaultActionContext(provider)
|
||||
.setContextObject(sourceMarginContextObject);
|
||||
}
|
||||
// Are we on a marker margin of the right listing? Return that margin's context.
|
||||
Object destinationMarginContextObject =
|
||||
getContextObjectForMarginPanels(destinationPanel, event);
|
||||
if (destinationMarginContextObject != null) {
|
||||
return new ActionContext(provider).setContextObject(destinationMarginContextObject);
|
||||
return new DefaultActionContext(provider)
|
||||
.setContextObject(destinationMarginContextObject);
|
||||
}
|
||||
|
||||
// If the action is on the Field Header of the left listing panel return an
|
||||
|
@ -2703,7 +2705,7 @@ public class ListingCodeComparisonPanel
|
|||
if (sourceComponent instanceof FieldHeaderComp) {
|
||||
FieldHeaderLocation fieldHeaderLocation =
|
||||
sourcePanel.getFieldHeader().getFieldHeaderLocation(event.getPoint());
|
||||
return new ActionContext(provider).setContextObject(fieldHeaderLocation);
|
||||
return new DefaultActionContext(provider).setContextObject(fieldHeaderLocation);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
|
|
@ -25,6 +25,7 @@ import java.util.List;
|
|||
import javax.swing.*;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import docking.action.DockingActionIf;
|
||||
import docking.event.mouse.GMouseListenerAdapter;
|
||||
import docking.widgets.table.*;
|
||||
|
@ -402,7 +403,7 @@ public class OpenVersionedFileDialog<T extends DomainObject> extends DataTreeDia
|
|||
return context;
|
||||
}
|
||||
|
||||
ActionContext actionContext = new ActionContext(null, this, event.getComponent());
|
||||
ActionContext actionContext = new DefaultActionContext(null, this, event.getComponent());
|
||||
actionContext.setMouseEvent(event);
|
||||
|
||||
return actionContext;
|
||||
|
|
|
@ -22,7 +22,7 @@ import java.util.List;
|
|||
|
||||
import javax.swing.tree.TreePath;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import docking.widgets.tree.GTree;
|
||||
import docking.widgets.tree.GTreeNode;
|
||||
import ghidra.formats.gfilesystem.*;
|
||||
|
@ -30,7 +30,7 @@ import ghidra.formats.gfilesystem.*;
|
|||
/**
|
||||
* {@link FileSystemBrowserPlugin}-specific action.
|
||||
*/
|
||||
public class FSBActionContext extends ActionContext {
|
||||
public class FSBActionContext extends DefaultActionContext {
|
||||
|
||||
private GTree gTree;
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ import javax.swing.text.JTextComponent;
|
|||
|
||||
import org.junit.*;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import docking.action.DockingActionIf;
|
||||
import docking.widgets.filter.FilterOptions;
|
||||
import docking.widgets.table.*;
|
||||
|
@ -300,7 +300,7 @@ public class BookmarkPluginTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
selectRow(5, true);
|
||||
|
||||
DockingActionIf action = getAction(plugin, "Select Bookmark Locations");
|
||||
action.actionPerformed(new ActionContext());
|
||||
action.actionPerformed(new DefaultActionContext());
|
||||
|
||||
AddressSet set = new AddressSet();
|
||||
|
||||
|
@ -311,7 +311,7 @@ public class BookmarkPluginTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
|
||||
selectRow(0, false);
|
||||
selectRow(3, true);
|
||||
action.actionPerformed(new ActionContext());
|
||||
action.actionPerformed(new DefaultActionContext());
|
||||
sel = cbPlugin.getCurrentSelection();
|
||||
set.clear();
|
||||
set.addRange(addr("0x01001010"), addr("0x01001011"));
|
||||
|
|
|
@ -30,6 +30,7 @@ import org.apache.commons.collections4.map.LazyMap;
|
|||
import org.junit.*;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import docking.action.*;
|
||||
import docking.widgets.tree.*;
|
||||
import generic.test.AbstractGenericTest;
|
||||
|
@ -497,7 +498,7 @@ public class CallTreePluginTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
outgoingTree.setSelectedNode(child1);
|
||||
waitForTree(outgoingTree);
|
||||
|
||||
ActionContext actionContext = new ActionContext(provider, outgoingTree);
|
||||
ActionContext actionContext = new DefaultActionContext(provider, outgoingTree);
|
||||
DockingActionIf goToAction = getAction("Go To Destination");
|
||||
performAction(goToAction, actionContext, true);
|
||||
|
||||
|
@ -517,7 +518,7 @@ public class CallTreePluginTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
setProviderFunction("0x5000");
|
||||
|
||||
DockingActionIf selectSourceAction = getAction("Select Call Source");
|
||||
ActionContext context = new ActionContext(provider, outgoingTree);
|
||||
ActionContext context = new DefaultActionContext(provider, outgoingTree);
|
||||
|
||||
assertTrue("The selection action was enabled when no node was selected",
|
||||
!selectSourceAction.isEnabledForContext(context));
|
||||
|
@ -605,7 +606,7 @@ public class CallTreePluginTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
|
||||
ToggleDockingAction filterDuplicatesAction =
|
||||
(ToggleDockingAction) getAction("Filter Duplicates");
|
||||
setToggleActionSelected(filterDuplicatesAction, new ActionContext(), true);
|
||||
setToggleActionSelected(filterDuplicatesAction, new DefaultActionContext(), true);
|
||||
waitForTree(outgoingTree);
|
||||
|
||||
GTreeNode rootNode = getRootNode(outgoingTree);
|
||||
|
@ -638,7 +639,7 @@ public class CallTreePluginTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
ToggleDockingAction filterDuplicatesAction =
|
||||
(ToggleDockingAction) getAction("Filter Duplicates");
|
||||
|
||||
setToggleActionSelected(filterDuplicatesAction, new ActionContext(), true);
|
||||
setToggleActionSelected(filterDuplicatesAction, new DefaultActionContext(), true);
|
||||
|
||||
waitForTree(outgoingTree);
|
||||
GTreeNode rootNode = getRootNode(outgoingTree);
|
||||
|
@ -671,7 +672,7 @@ public class CallTreePluginTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
|
||||
ToggleDockingAction filterDuplicatesAction =
|
||||
(ToggleDockingAction) getAction("Filter Duplicates");
|
||||
setToggleActionSelected(filterDuplicatesAction, new ActionContext(), true);
|
||||
setToggleActionSelected(filterDuplicatesAction, new DefaultActionContext(), true);
|
||||
waitForTree(outgoingTree);
|
||||
|
||||
GTreeNode rootNode = getRootNode(outgoingTree);
|
||||
|
@ -714,7 +715,7 @@ public class CallTreePluginTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
|
||||
ToggleDockingAction filterDuplicatesAction =
|
||||
(ToggleDockingAction) getAction("Filter Duplicates");
|
||||
setToggleActionSelected(filterDuplicatesAction, new ActionContext(), true);
|
||||
setToggleActionSelected(filterDuplicatesAction, new DefaultActionContext(), true);
|
||||
waitForTree(incomingTree);
|
||||
|
||||
// copy the names of the children into a map so that we can verify no duplicates
|
||||
|
@ -1071,13 +1072,13 @@ public class CallTreePluginTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
|
||||
private void fullyExpandIncomingNode(GTreeNode node) {
|
||||
DockingActionIf expandAction = getLocalAction(provider, "Fully Expand Selected Nodes");
|
||||
performAction(expandAction, new ActionContext(provider, incomingTree), false);
|
||||
performAction(expandAction, new DefaultActionContext(provider, incomingTree), false);
|
||||
waitForTree(node.getTree());
|
||||
}
|
||||
|
||||
private void fullyExpandOutgoingNode(GTreeNode node) {
|
||||
DockingActionIf expandAction = getLocalAction(provider, "Fully Expand Selected Nodes");
|
||||
performAction(expandAction, new ActionContext(provider, outgoingTree), false);
|
||||
performAction(expandAction, new DefaultActionContext(provider, outgoingTree), false);
|
||||
waitForTree(node.getTree());
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ import java.util.List;
|
|||
|
||||
import org.junit.*;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import ghidra.GhidraOptions;
|
||||
import ghidra.app.cmd.data.CreateDataCmd;
|
||||
import ghidra.app.plugin.core.navigation.NextPrevAddressPlugin;
|
||||
|
@ -275,13 +275,13 @@ public class HeaderTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
public void testInsertDeleteRow() {
|
||||
FieldFormatModel model = header.getHeaderTab().getModel();
|
||||
InsertRowAction act = new InsertRowAction("Test", header);
|
||||
act.isEnabledForContext(new ActionContext(cb.getProvider()).setContextObject(
|
||||
act.isEnabledForContext(new DefaultActionContext(cb.getProvider()).setContextObject(
|
||||
new FieldHeaderLocation(model, null, 0, 0)));
|
||||
performAction(act, true);
|
||||
assertEquals(8, model.getNumRows());
|
||||
assertEquals(0, model.getNumFactorys(0));
|
||||
RemoveRowAction act2 = new RemoveRowAction("Test", header);
|
||||
act2.isEnabledForContext(new ActionContext(cb.getProvider()).setContextObject(
|
||||
act2.isEnabledForContext(new DefaultActionContext(cb.getProvider()).setContextObject(
|
||||
new FieldHeaderLocation(model, null, 0, 0)));
|
||||
performAction(act2, true);
|
||||
assertEquals(7, model.getNumRows());
|
||||
|
@ -294,7 +294,7 @@ public class HeaderTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
ListingField bf = cb.getCurrentField();
|
||||
int startX = bf.getStartX();
|
||||
InsertRowAction act = new InsertRowAction("Test", header);
|
||||
act.isEnabledForContext(new ActionContext(cb.getProvider()).setContextObject(
|
||||
act.isEnabledForContext(new DefaultActionContext(cb.getProvider()).setContextObject(
|
||||
new FieldHeaderLocation(model, null, 0, 0)));
|
||||
performAction(act, true);
|
||||
int width = bf.getWidth();
|
||||
|
|
|
@ -27,6 +27,7 @@ import javax.swing.JButton;
|
|||
import org.junit.*;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import docking.action.DockingActionIf;
|
||||
import docking.options.editor.GhidraColorChooser;
|
||||
import docking.widgets.EventTrigger;
|
||||
|
@ -635,7 +636,7 @@ public class ColorizingPluginTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
private ActionContext getActionContext() {
|
||||
ActionContext context = cb.getProvider().getActionContext(null);
|
||||
if (context == null) {
|
||||
context = new ActionContext();
|
||||
context = new DefaultActionContext();
|
||||
}
|
||||
return context;
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ import javax.swing.tree.TreePath;
|
|||
|
||||
import org.junit.*;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import docking.DockingDialog;
|
||||
import docking.action.DockingActionIf;
|
||||
import docking.widgets.dialogs.NumberInputDialog;
|
||||
|
@ -320,7 +320,7 @@ public abstract class AbstractEditorTest extends AbstractGhidraHeadedIntegration
|
|||
Msg.debug(this, "Calling actionPerformed() on a disabled action: " + action.getName(),
|
||||
ReflectionUtilities.createJavaFilteredThrowable());
|
||||
}
|
||||
runSwing(() -> action.actionPerformed(new ActionContext()), wait);
|
||||
runSwing(() -> action.actionPerformed(new DefaultActionContext()), wait);
|
||||
waitForSwing();
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ import java.awt.Window;
|
|||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import docking.action.DockingActionIf;
|
||||
import docking.action.ToggleDockingActionIf;
|
||||
import ghidra.framework.options.Options;
|
||||
|
@ -118,7 +118,7 @@ public class StructureEditorProviderTest extends AbstractStructureEditorTest {
|
|||
runSwingLater(() -> {
|
||||
getTable().requestFocus();
|
||||
setSelection(new int[] { 4, 5 });
|
||||
deleteAction.actionPerformed(new ActionContext());
|
||||
deleteAction.actionPerformed(new DefaultActionContext());
|
||||
try {
|
||||
model.add(new WordDataType());
|
||||
}
|
||||
|
@ -137,8 +137,8 @@ public class StructureEditorProviderTest extends AbstractStructureEditorTest {
|
|||
runSwingLater(() -> {
|
||||
getTable().requestFocus();
|
||||
setSelection(new int[] { 1 });
|
||||
clearAction.actionPerformed(new ActionContext());
|
||||
deleteAction.actionPerformed(new ActionContext());// Must be undefined before it can delete.
|
||||
clearAction.actionPerformed(new DefaultActionContext());
|
||||
deleteAction.actionPerformed(new DefaultActionContext());// Must be undefined before it can delete.
|
||||
});
|
||||
waitForSwing();
|
||||
assertFalse(complexStructure.isEquivalent(model.viewComposite));
|
||||
|
@ -454,7 +454,7 @@ public class StructureEditorProviderTest extends AbstractStructureEditorTest {
|
|||
runSwingLater(() -> {
|
||||
getTable().requestFocus();
|
||||
setSelection(new int[] { 4, 5 });
|
||||
deleteAction.actionPerformed(new ActionContext());
|
||||
deleteAction.actionPerformed(new DefaultActionContext());
|
||||
try {
|
||||
model.add(new WordDataType());
|
||||
}
|
||||
|
@ -509,7 +509,7 @@ public class StructureEditorProviderTest extends AbstractStructureEditorTest {
|
|||
runSwingLater(() -> {
|
||||
getTable().requestFocus();
|
||||
setSelection(new int[] { 4, 5 });
|
||||
deleteAction.actionPerformed(new ActionContext());
|
||||
deleteAction.actionPerformed(new DefaultActionContext());
|
||||
try {
|
||||
model.add(new WordDataType());
|
||||
}
|
||||
|
@ -545,7 +545,7 @@ public class StructureEditorProviderTest extends AbstractStructureEditorTest {
|
|||
runSwing(() -> {
|
||||
getTable().requestFocus();
|
||||
setSelection(new int[] { 4, 5 });
|
||||
deleteAction.actionPerformed(new ActionContext());
|
||||
deleteAction.actionPerformed(new DefaultActionContext());
|
||||
try {
|
||||
model.add(new WordDataType());
|
||||
}
|
||||
|
@ -571,7 +571,7 @@ public class StructureEditorProviderTest extends AbstractStructureEditorTest {
|
|||
runSwingLater(() -> {
|
||||
getTable().requestFocus();
|
||||
setSelection(new int[] { 4, 5 });
|
||||
deleteAction.actionPerformed(new ActionContext());
|
||||
deleteAction.actionPerformed(new DefaultActionContext());
|
||||
try {
|
||||
model.add(new WordDataType());
|
||||
}
|
||||
|
@ -705,7 +705,7 @@ public class StructureEditorProviderTest extends AbstractStructureEditorTest {
|
|||
assertEquals("0x145", model.getLengthAsString());
|
||||
|
||||
DockingActionIf action = getAction(plugin, "Editor: Show Numbers In Hex");
|
||||
setToggleActionSelected((ToggleDockingActionIf) action, new ActionContext(), false);
|
||||
setToggleActionSelected((ToggleDockingActionIf) action, new DefaultActionContext(), false);
|
||||
|
||||
assertEquals(false, model.isShowingNumbersInHex());
|
||||
assertEquals("47", model.getValueAt(15, model.getOffsetColumn()));
|
||||
|
|
|
@ -22,7 +22,7 @@ import java.awt.Window;
|
|||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import docking.action.DockingActionIf;
|
||||
import docking.action.ToggleDockingActionIf;
|
||||
import ghidra.framework.options.Options;
|
||||
|
@ -346,7 +346,7 @@ public class UnionEditorProviderTest extends AbstractUnionEditorTest {
|
|||
assertEquals("0x57", model.getLengthAsString());
|
||||
|
||||
DockingActionIf action = getAction(plugin, "Editor: Show Numbers In Hex");
|
||||
setToggleActionSelected((ToggleDockingActionIf) action, new ActionContext(), false);
|
||||
setToggleActionSelected((ToggleDockingActionIf) action, new DefaultActionContext(), false);
|
||||
|
||||
assertEquals(false, model.isShowingNumbersInHex());
|
||||
assertEquals("29", model.getValueAt(15, model.getLengthColumn()));
|
||||
|
@ -358,7 +358,7 @@ public class UnionEditorProviderTest extends AbstractUnionEditorTest {
|
|||
|
||||
getTable().requestFocus();
|
||||
model.setSelection(rows);
|
||||
deleteAction.actionPerformed(new ActionContext());
|
||||
deleteAction.actionPerformed(new DefaultActionContext());
|
||||
}
|
||||
|
||||
protected UnionEditorProvider edit(DataType dt) {
|
||||
|
|
|
@ -27,6 +27,7 @@ import javax.swing.table.TableCellEditor;
|
|||
import org.junit.*;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import docking.action.DockingActionIf;
|
||||
import docking.action.MenuData;
|
||||
import docking.widgets.combobox.GhidraComboBox;
|
||||
|
@ -1634,7 +1635,7 @@ public abstract class AbstractDataActionTest extends AbstractGhidraHeadedIntegra
|
|||
cb.updateNow();
|
||||
ActionContext context = cb.getProvider().getActionContext(null);
|
||||
if (context == null) {
|
||||
context = new ActionContext();
|
||||
context = new DefaultActionContext();
|
||||
}
|
||||
return context;
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ import javax.swing.table.TableCellEditor;
|
|||
|
||||
import org.junit.*;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import docking.action.DockingActionIf;
|
||||
import docking.widgets.OptionDialog;
|
||||
import generic.stl.Pair;
|
||||
|
@ -167,7 +167,7 @@ public class EnumEditor1Test extends AbstractGhidraHeadedIntegrationTest {
|
|||
assertEquals(5L, model.getValueAt(2, VALUE_COL));
|
||||
|
||||
// apply the change
|
||||
runSwing(() -> applyAction.actionPerformed(new ActionContext()));
|
||||
runSwing(() -> applyAction.actionPerformed(new DefaultActionContext()));
|
||||
program.flushEvents();
|
||||
waitForSwing();
|
||||
|
||||
|
@ -390,7 +390,7 @@ public class EnumEditor1Test extends AbstractGhidraHeadedIntegrationTest {
|
|||
int lastRow = model.getRowCount() - 1;
|
||||
table.addRowSelectionInterval(lastRow, lastRow);
|
||||
DockingActionIf addAction = getAction(plugin, "Add Enum Value");
|
||||
addAction.actionPerformed(new ActionContext());
|
||||
addAction.actionPerformed(new DefaultActionContext());
|
||||
});
|
||||
waitForSwing();
|
||||
|
||||
|
@ -1166,7 +1166,7 @@ public class EnumEditor1Test extends AbstractGhidraHeadedIntegrationTest {
|
|||
private void apply() {
|
||||
runSwing(() -> {
|
||||
DockingActionIf applyAction = getAction(plugin, "Apply Enum Changes");
|
||||
applyAction.actionPerformed(new ActionContext());
|
||||
applyAction.actionPerformed(new DefaultActionContext());
|
||||
}, false);
|
||||
program.flushEvents();
|
||||
waitForSwing();
|
||||
|
@ -1332,7 +1332,7 @@ public class EnumEditor1Test extends AbstractGhidraHeadedIntegrationTest {
|
|||
private void addEnumValue() {
|
||||
runSwing(() -> {
|
||||
DockingActionIf addAction = getAction(plugin, "Add Enum Value");
|
||||
addAction.actionPerformed(new ActionContext());
|
||||
addAction.actionPerformed(new DefaultActionContext());
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -275,14 +275,14 @@ public class EnumEditor2Test extends AbstractGhidraHeadedIntegrationTest {
|
|||
final DockingActionIf deleteAction = getAction(plugin, "Delete Enum Value");
|
||||
assertTrue(deleteAction.isEnabled());
|
||||
|
||||
runSwing(() -> deleteAction.actionPerformed(new ActionContext()));
|
||||
runSwing(() -> deleteAction.actionPerformed(new DefaultActionContext()));
|
||||
waitForSwing();
|
||||
assertTrue(table.isRowSelected(3));
|
||||
|
||||
final DockingActionIf applyAction = getAction(plugin, "Apply Enum Changes");
|
||||
assertTrue(applyAction.isEnabled());
|
||||
|
||||
runSwing(() -> applyAction.actionPerformed(new ActionContext()));
|
||||
runSwing(() -> applyAction.actionPerformed(new DefaultActionContext()));
|
||||
program.flushEvents();
|
||||
waitForSwing();
|
||||
|
||||
|
@ -304,7 +304,7 @@ public class EnumEditor2Test extends AbstractGhidraHeadedIntegrationTest {
|
|||
|
||||
for (int i = 0; i < count; i++) {
|
||||
|
||||
runSwing(() -> deleteAction.actionPerformed(new ActionContext()));
|
||||
runSwing(() -> deleteAction.actionPerformed(new DefaultActionContext()));
|
||||
waitForSwing();
|
||||
}
|
||||
assertEquals(0, model.getRowCount());
|
||||
|
@ -326,7 +326,7 @@ public class EnumEditor2Test extends AbstractGhidraHeadedIntegrationTest {
|
|||
|
||||
for (int i = 0; i < count; i++) {
|
||||
|
||||
runSwing(() -> deleteAction.actionPerformed(new ActionContext()));
|
||||
runSwing(() -> deleteAction.actionPerformed(new DefaultActionContext()));
|
||||
waitForSwing();
|
||||
}
|
||||
applyChanges(true);
|
||||
|
@ -352,7 +352,7 @@ public class EnumEditor2Test extends AbstractGhidraHeadedIntegrationTest {
|
|||
|
||||
for (int i = 0; i < count; i++) {
|
||||
|
||||
runSwing(() -> deleteAction.actionPerformed(new ActionContext()));
|
||||
runSwing(() -> deleteAction.actionPerformed(new DefaultActionContext()));
|
||||
waitForSwing();
|
||||
}
|
||||
|
||||
|
@ -387,7 +387,7 @@ public class EnumEditor2Test extends AbstractGhidraHeadedIntegrationTest {
|
|||
|
||||
for (int i = 0; i < count; i++) {
|
||||
|
||||
runSwing(() -> deleteAction.actionPerformed(new ActionContext()));
|
||||
runSwing(() -> deleteAction.actionPerformed(new DefaultActionContext()));
|
||||
waitForSwing();
|
||||
}
|
||||
|
||||
|
@ -416,7 +416,7 @@ public class EnumEditor2Test extends AbstractGhidraHeadedIntegrationTest {
|
|||
|
||||
for (int i = 0; i < count; i++) {
|
||||
|
||||
runSwing(() -> deleteAction.actionPerformed(new ActionContext()));
|
||||
runSwing(() -> deleteAction.actionPerformed(new DefaultActionContext()));
|
||||
waitForSwing();
|
||||
}
|
||||
|
||||
|
@ -448,7 +448,7 @@ public class EnumEditor2Test extends AbstractGhidraHeadedIntegrationTest {
|
|||
final DockingActionIf deleteAction = getAction(plugin, "Delete Enum Value");
|
||||
assertTrue(deleteAction.isEnabled());
|
||||
|
||||
runSwing(() -> deleteAction.actionPerformed(new ActionContext()));
|
||||
runSwing(() -> deleteAction.actionPerformed(new DefaultActionContext()));
|
||||
waitForSwing();
|
||||
|
||||
assertTrue(table.isRowSelected(0));
|
||||
|
@ -456,7 +456,7 @@ public class EnumEditor2Test extends AbstractGhidraHeadedIntegrationTest {
|
|||
final DockingActionIf applyAction = getAction(plugin, "Apply Enum Changes");
|
||||
assertTrue(applyAction.isEnabled());
|
||||
|
||||
runSwing(() -> applyAction.actionPerformed(new ActionContext()));
|
||||
runSwing(() -> applyAction.actionPerformed(new DefaultActionContext()));
|
||||
program.flushEvents();
|
||||
waitForSwing();
|
||||
|
||||
|
@ -635,7 +635,7 @@ public class EnumEditor2Test extends AbstractGhidraHeadedIntegrationTest {
|
|||
table.setRowSelectionInterval(0, 0);
|
||||
runSwing(() -> {
|
||||
DockingActionIf action = getAction(plugin, "Delete Enum Value");
|
||||
action.actionPerformed(new ActionContext());
|
||||
action.actionPerformed(new DefaultActionContext());
|
||||
});
|
||||
applyChanges(true);
|
||||
assertNull(enumDt.getName(0));
|
||||
|
@ -660,16 +660,16 @@ public class EnumEditor2Test extends AbstractGhidraHeadedIntegrationTest {
|
|||
int origRowCount = model.getRowCount();
|
||||
runSwing(() -> {
|
||||
DockingActionIf action = getAction(plugin, "Add Enum Value");
|
||||
action.actionPerformed(new ActionContext());
|
||||
action.actionPerformed(new ActionContext());
|
||||
action.actionPerformed(new DefaultActionContext());
|
||||
action.actionPerformed(new DefaultActionContext());
|
||||
});
|
||||
waitForSwing();
|
||||
applyChanges(true);
|
||||
// make more changes
|
||||
runSwing(() -> {
|
||||
DockingActionIf action = getAction(plugin, "Add Enum Value");
|
||||
action.actionPerformed(new ActionContext());
|
||||
action.actionPerformed(new ActionContext());
|
||||
action.actionPerformed(new DefaultActionContext());
|
||||
action.actionPerformed(new DefaultActionContext());
|
||||
});
|
||||
waitForSwing();
|
||||
undo(false);
|
||||
|
@ -698,8 +698,8 @@ public class EnumEditor2Test extends AbstractGhidraHeadedIntegrationTest {
|
|||
table.addRowSelectionInterval(lastRow, lastRow);
|
||||
}
|
||||
DockingActionIf action = getAction(plugin, "Add Enum Value");
|
||||
action.actionPerformed(new ActionContext());
|
||||
action.actionPerformed(new ActionContext());
|
||||
action.actionPerformed(new DefaultActionContext());
|
||||
action.actionPerformed(new DefaultActionContext());
|
||||
});
|
||||
waitForSwing();
|
||||
applyChanges(true);
|
||||
|
@ -710,8 +710,8 @@ public class EnumEditor2Test extends AbstractGhidraHeadedIntegrationTest {
|
|||
table.addRowSelectionInterval(lastRow, lastRow);
|
||||
}
|
||||
DockingActionIf action = getAction(plugin, "Add Enum Value");
|
||||
action.actionPerformed(new ActionContext());
|
||||
action.actionPerformed(new ActionContext());
|
||||
action.actionPerformed(new DefaultActionContext());
|
||||
action.actionPerformed(new DefaultActionContext());
|
||||
});
|
||||
waitForSwing();
|
||||
int rowCount = model.getRowCount();
|
||||
|
@ -784,7 +784,7 @@ public class EnumEditor2Test extends AbstractGhidraHeadedIntegrationTest {
|
|||
table.addRowSelectionInterval(lastRow, lastRow);
|
||||
}
|
||||
DockingActionIf addAction = getAction(plugin, "Add Enum Value");
|
||||
addAction.actionPerformed(new ActionContext());
|
||||
addAction.actionPerformed(new DefaultActionContext());
|
||||
});
|
||||
waitForSwing();
|
||||
final int newRow = model.getRowCount() - 1;
|
||||
|
@ -823,7 +823,7 @@ public class EnumEditor2Test extends AbstractGhidraHeadedIntegrationTest {
|
|||
|
||||
final DockingActionIf applyAction = getAction(plugin, "Apply Enum Changes");
|
||||
assertTrue(applyAction.isEnabled());
|
||||
Runnable r = () -> applyAction.actionPerformed(new ActionContext());
|
||||
Runnable r = () -> applyAction.actionPerformed(new DefaultActionContext());
|
||||
if (doWait) {
|
||||
runSwing(r);
|
||||
program.flushEvents();
|
||||
|
|
|
@ -24,8 +24,7 @@ import javax.swing.*;
|
|||
|
||||
import org.junit.*;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DialogComponentProvider;
|
||||
import docking.*;
|
||||
import docking.action.DockingActionIf;
|
||||
import docking.widgets.fieldpanel.*;
|
||||
import docking.widgets.fieldpanel.field.Field;
|
||||
|
@ -179,7 +178,7 @@ public class ClearTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
closeProgram();
|
||||
|
||||
assertFalse(isEnabled(clearAction, cb.getProvider()));
|
||||
assertFalse(clearAction.isEnabledForContext(new ActionContext()));
|
||||
assertFalse(clearAction.isEnabledForContext(new DefaultActionContext()));
|
||||
|
||||
showTool(tool);
|
||||
loadProgram("notepad");
|
||||
|
|
|
@ -20,6 +20,7 @@ import static org.junit.Assert.*;
|
|||
import org.junit.*;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import docking.action.DockingActionIf;
|
||||
import docking.widgets.EventTrigger;
|
||||
import docking.widgets.fieldpanel.FieldPanel;
|
||||
|
@ -453,7 +454,7 @@ public class DisassemblerPluginTest extends AbstractGhidraHeadedIntegrationTest
|
|||
|
||||
private ActionContext getContext() {
|
||||
ActionContext context = cb.getProvider().getActionContext(null);
|
||||
return context == null ? new ActionContext() : context;
|
||||
return context == null ? new DefaultActionContext() : context;
|
||||
}
|
||||
|
||||
private void setSelection(FieldPanel fp, FieldSelection sel) {
|
||||
|
|
|
@ -25,8 +25,7 @@ import javax.swing.table.TableModel;
|
|||
|
||||
import org.junit.*;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.ComponentProvider;
|
||||
import docking.*;
|
||||
import docking.action.DockingActionIf;
|
||||
import docking.action.MenuData;
|
||||
import docking.widgets.OptionDialog;
|
||||
|
@ -673,7 +672,7 @@ public class EquatePlugin1Test extends AbstractGhidraHeadedIntegrationTest {
|
|||
|
||||
env.close(program);
|
||||
|
||||
assertFalse(setAction.isEnabledForContext(new ActionContext()));
|
||||
assertFalse(setAction.isEnabledForContext(new DefaultActionContext()));
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -15,13 +15,14 @@
|
|||
*/
|
||||
package ghidra.app.plugin.core.fallthrough;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import org.junit.*;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import docking.action.DockingActionIf;
|
||||
import ghidra.app.LocationCallback;
|
||||
import ghidra.app.SampleLocationGenerator;
|
||||
|
@ -138,7 +139,7 @@ public class FallThroughActionTest extends AbstractGhidraHeadedIntegrationTest
|
|||
if (actionName.equals(name)) {
|
||||
ActionContext actionContext = cb.getProvider().getActionContext(null);
|
||||
if (actionContext == null) {
|
||||
actionContext = new ActionContext();
|
||||
actionContext = new DefaultActionContext();
|
||||
}
|
||||
boolean validContext = action.isAddToPopup(actionContext);
|
||||
assertEquals("Enablement: actionName = " + actionName + " [case: " + caseName + "]",
|
||||
|
|
|
@ -26,6 +26,7 @@ import javax.swing.*;
|
|||
import org.junit.*;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import docking.action.DockingActionIf;
|
||||
import docking.widgets.OptionDialog;
|
||||
import docking.widgets.combobox.GhidraComboBox;
|
||||
|
@ -100,7 +101,7 @@ public class Function1Test extends AbstractGhidraHeadedIntegrationTest {
|
|||
public void testEnablement() throws Exception {
|
||||
ActionContext actionContext = cb.getProvider().getActionContext(null);
|
||||
assertNull(actionContext);
|
||||
actionContext = new ActionContext();
|
||||
actionContext = new DefaultActionContext();
|
||||
assertFalse(createFunction.isEnabledForContext(actionContext));
|
||||
assertFalse(createThunk.isEnabledForContext(actionContext));
|
||||
assertFalse(editThunk.isEnabledForContext(actionContext));
|
||||
|
@ -176,7 +177,7 @@ public class Function1Test extends AbstractGhidraHeadedIntegrationTest {
|
|||
closeProgram();
|
||||
actionContext = cb.getProvider().getActionContext(null);
|
||||
assertNull(actionContext);
|
||||
actionContext = new ActionContext();
|
||||
actionContext = new DefaultActionContext();
|
||||
assertFalse(createFunction.isEnabledForContext(actionContext));
|
||||
assertFalse(deleteFunction.isEnabledForContext(actionContext));
|
||||
assertFalse(editThunk.isEnabledForContext(actionContext));
|
||||
|
|
|
@ -24,8 +24,7 @@ import javax.swing.table.*;
|
|||
|
||||
import org.junit.*;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.ComponentProvider;
|
||||
import docking.*;
|
||||
import docking.action.DockingActionIf;
|
||||
import docking.tool.ToolConstants;
|
||||
import docking.widgets.combobox.GComboBox;
|
||||
|
@ -148,7 +147,7 @@ public class FunctionWindowPluginTest extends AbstractGhidraHeadedIntegrationTes
|
|||
String signatureText = getRenderedTableCellValue(functionTable, row, column);
|
||||
|
||||
DockingActionIf copyAction = getAction(tool, ToolConstants.SHARED_OWNER, "Table Data Copy");
|
||||
ActionContext context = new ActionContext(provider, functionTable);
|
||||
ActionContext context = new DefaultActionContext(provider, functionTable);
|
||||
performAction(copyAction, context, true);
|
||||
|
||||
//
|
||||
|
|
|
@ -23,8 +23,7 @@ import javax.swing.table.TableModel;
|
|||
|
||||
import org.junit.*;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DialogComponentProvider;
|
||||
import docking.*;
|
||||
import docking.action.DockingActionIf;
|
||||
import generic.test.TestUtils;
|
||||
import ghidra.app.LocationCallback;
|
||||
|
@ -135,7 +134,7 @@ public class LabelActionTest extends AbstractGhidraHeadedIntegrationTest
|
|||
|
||||
@Test
|
||||
public void testNotepadLocations() {
|
||||
ActionContext context = new ActionContext();
|
||||
ActionContext context = new DefaultActionContext();
|
||||
assertFalse(addLabel.isEnabledForContext(context));
|
||||
|
||||
assertFalse(editLabel.isEnabledForContext(context));
|
||||
|
|
|
@ -28,6 +28,7 @@ import javax.swing.table.TableModel;
|
|||
import org.junit.*;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import docking.action.DockingActionIf;
|
||||
import ghidra.app.cmd.memory.*;
|
||||
import ghidra.app.plugin.core.codebrowser.CodeBrowserPlugin;
|
||||
|
@ -139,7 +140,7 @@ public class MemoryMapPluginTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
private ActionContext getActionContext() {
|
||||
ActionContext context = provider.getActionContext(null);
|
||||
if (context == null) {
|
||||
return new ActionContext();
|
||||
return new DefaultActionContext();
|
||||
}
|
||||
return context;
|
||||
}
|
||||
|
|
|
@ -25,6 +25,7 @@ import javax.swing.JCheckBox;
|
|||
import org.junit.*;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import docking.action.DockingActionIf;
|
||||
import docking.widgets.combobox.GhidraComboBox;
|
||||
import docking.widgets.table.GTable;
|
||||
|
@ -689,7 +690,7 @@ public class GoToAddressLabelPluginTest extends AbstractGhidraHeadedIntegrationT
|
|||
performOkCallback();
|
||||
assertEquals(addr("100493b"), cbPlugin.getCurrentAddress());
|
||||
|
||||
clear.actionPerformed(new ActionContext());
|
||||
clear.actionPerformed(new DefaultActionContext());
|
||||
assertFalse(clear.isEnabledForContext(provider.getActionContext(null)));
|
||||
assertFalse(next.isEnabledForContext(provider.getActionContext(null)));
|
||||
assertFalse(prev.isEnabledForContext(provider.getActionContext(null)));
|
||||
|
@ -702,13 +703,13 @@ public class GoToAddressLabelPluginTest extends AbstractGhidraHeadedIntegrationT
|
|||
assertFalse(next.isEnabledForContext(provider.getActionContext(null)));
|
||||
assertTrue(prev.isEnabledForContext(provider.getActionContext(null)));
|
||||
|
||||
prev.actionPerformed(new ActionContext());
|
||||
prev.actionPerformed(new DefaultActionContext());
|
||||
assertEquals(addr("100493b"), cbPlugin.getCurrentAddress());
|
||||
|
||||
assertTrue(next.isEnabledForContext(provider.getActionContext(null)));
|
||||
assertFalse(prev.isEnabledForContext(provider.getActionContext(null)));
|
||||
|
||||
next.actionPerformed(new ActionContext());
|
||||
next.actionPerformed(new DefaultActionContext());
|
||||
assertEquals(addr("1001000"), cbPlugin.getCurrentAddress());
|
||||
|
||||
setText("1001010");
|
||||
|
@ -718,8 +719,8 @@ public class GoToAddressLabelPluginTest extends AbstractGhidraHeadedIntegrationT
|
|||
assertFalse(next.isEnabledForContext(provider.getActionContext(null)));
|
||||
assertTrue(prev.isEnabledForContext(provider.getActionContext(null)));
|
||||
|
||||
prev.actionPerformed(new ActionContext());
|
||||
prev.actionPerformed(new ActionContext());
|
||||
prev.actionPerformed(new DefaultActionContext());
|
||||
prev.actionPerformed(new DefaultActionContext());
|
||||
|
||||
assertEquals(addr("100493b"), cbPlugin.getCurrentAddress());
|
||||
assertTrue(next.isEnabledForContext(provider.getActionContext(null)));
|
||||
|
@ -1029,7 +1030,7 @@ public class GoToAddressLabelPluginTest extends AbstractGhidraHeadedIntegrationT
|
|||
private ActionContext getActionContext() {
|
||||
ActionContext context = runSwing(() -> cbPlugin.getProvider().getActionContext(null));
|
||||
if (context == null) {
|
||||
context = new ActionContext();
|
||||
context = new DefaultActionContext();
|
||||
}
|
||||
return context;
|
||||
}
|
||||
|
|
|
@ -15,12 +15,12 @@
|
|||
*/
|
||||
package ghidra.app.plugin.core.navigation;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import org.junit.*;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import docking.action.DockingActionIf;
|
||||
import docking.widgets.EventTrigger;
|
||||
import docking.widgets.fieldpanel.FieldPanel;
|
||||
|
@ -310,7 +310,7 @@ public class NextPrevSelectionHighlightTest extends AbstractGhidraHeadedIntegrat
|
|||
ActionContext getActionContext() {
|
||||
ActionContext context = cb.getProvider().getActionContext(null);
|
||||
if (context == null) {
|
||||
context = new ActionContext();
|
||||
context = new DefaultActionContext();
|
||||
}
|
||||
return context;
|
||||
|
||||
|
|
|
@ -129,14 +129,14 @@ public class ProviderNavigationPluginTest extends AbstractProgramBasedTest {
|
|||
assertTrue(
|
||||
"'" + ProviderNavigationPlugin.GO_TO_LAST_ACTIVE_COMPONENT_ACTION_NAME + "'" +
|
||||
" should be enabled when there is a previous provider set",
|
||||
previousProviderAction.isEnabledForContext(new ActionContext()));
|
||||
previousProviderAction.isEnabledForContext(new DefaultActionContext()));
|
||||
}
|
||||
|
||||
private void assertPreviousProviderActionNotEnabled() {
|
||||
assertFalse(
|
||||
"'" + ProviderNavigationPlugin.GO_TO_LAST_ACTIVE_COMPONENT_ACTION_NAME + "'" +
|
||||
" should not be enabled when there is no previous provider set",
|
||||
previousProviderAction.isEnabledForContext(new ActionContext()));
|
||||
previousProviderAction.isEnabledForContext(new DefaultActionContext()));
|
||||
}
|
||||
|
||||
private ComponentProvider activateProvider(String name) {
|
||||
|
@ -152,7 +152,7 @@ public class ProviderNavigationPluginTest extends AbstractProgramBasedTest {
|
|||
}
|
||||
|
||||
private void forceActivate(ComponentProvider provider) {
|
||||
ActionContext context = new ActionContext(provider);
|
||||
ActionContext context = new DefaultActionContext(provider);
|
||||
for (DockingContextListener l : testContextListeners) {
|
||||
l.contextChanged(context);
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ import javax.swing.tree.TreePath;
|
|||
|
||||
import org.junit.*;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import docking.action.DockingActionIf;
|
||||
import generic.theme.GIcon;
|
||||
import ghidra.program.database.ProgramBuilder;
|
||||
|
@ -721,7 +721,7 @@ public class ProgramTreePlugin2Test extends AbstractProgramTreePluginTest {
|
|||
setSelectionPaths(new TreePath[] { rsrcNode.getTreePath(), textNode.getTreePath() });
|
||||
|
||||
// cut Strings
|
||||
runSwing(() -> cutAction.actionPerformed(new ActionContext()));
|
||||
runSwing(() -> cutAction.actionPerformed(new DefaultActionContext()));
|
||||
|
||||
// select Strings (has no fragments)
|
||||
ProgramNode stringsNode = root.getChild("Strings");
|
||||
|
|
|
@ -25,7 +25,7 @@ import javax.swing.*;
|
|||
|
||||
import org.junit.*;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import docking.EditWindow;
|
||||
import docking.action.DockingActionIf;
|
||||
import ghidra.app.plugin.core.codebrowser.CodeBrowserPlugin;
|
||||
|
@ -124,7 +124,8 @@ public class ViewManagerPluginTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
public void testCreateDefaultView() throws Exception {
|
||||
ProgramTreePlugin treePlugin = env.getPlugin(ProgramTreePlugin.class);
|
||||
final DockingActionIf createTreeAction = getAction(treePlugin, "Create Default Tree View");
|
||||
SwingUtilities.invokeAndWait(() -> createTreeAction.actionPerformed(new ActionContext()));
|
||||
SwingUtilities
|
||||
.invokeAndWait(() -> createTreeAction.actionPerformed(new DefaultActionContext()));
|
||||
program.flushEvents();
|
||||
|
||||
ViewProviderService vps = provider.getCurrentViewProvider();
|
||||
|
@ -134,7 +135,8 @@ public class ViewManagerPluginTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
assertEquals(treeNames.length, tabbedPane.getTabCount());
|
||||
assertEquals(PluginConstants.DEFAULT_TREE_NAME + "(1)", vps.getViewName());
|
||||
assertEquals(tabbedPane.getSelectedComponent(), vps.getViewComponent());
|
||||
SwingUtilities.invokeAndWait(() -> createTreeAction.actionPerformed(new ActionContext()));
|
||||
SwingUtilities
|
||||
.invokeAndWait(() -> createTreeAction.actionPerformed(new DefaultActionContext()));
|
||||
program.flushEvents();
|
||||
vps = provider.getCurrentViewProvider();
|
||||
treeNames = program.getListing().getTreeNames();
|
||||
|
@ -149,7 +151,8 @@ public class ViewManagerPluginTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
public void testUndoRedo() throws Exception {
|
||||
ProgramTreePlugin treePlugin = env.getPlugin(ProgramTreePlugin.class);
|
||||
final DockingActionIf createTreeAction = getAction(treePlugin, "Create Default Tree View");
|
||||
SwingUtilities.invokeAndWait(() -> createTreeAction.actionPerformed(new ActionContext()));
|
||||
SwingUtilities
|
||||
.invokeAndWait(() -> createTreeAction.actionPerformed(new DefaultActionContext()));
|
||||
program.flushEvents();
|
||||
env.showTool();
|
||||
ViewProviderService vps = provider.getCurrentViewProvider();
|
||||
|
@ -159,7 +162,8 @@ public class ViewManagerPluginTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
assertEquals(treeNames.length, tabbedPane.getTabCount());
|
||||
assertEquals(PluginConstants.DEFAULT_TREE_NAME + "(1)", vps.getViewName());
|
||||
assertEquals(tabbedPane.getSelectedComponent(), vps.getViewComponent());
|
||||
SwingUtilities.invokeAndWait(() -> createTreeAction.actionPerformed(new ActionContext()));
|
||||
SwingUtilities
|
||||
.invokeAndWait(() -> createTreeAction.actionPerformed(new DefaultActionContext()));
|
||||
program.flushEvents();
|
||||
vps = provider.getCurrentViewProvider();
|
||||
treeNames = program.getListing().getTreeNames();
|
||||
|
@ -232,7 +236,7 @@ public class ViewManagerPluginTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
public void testCloseView() throws Exception {
|
||||
// close "Program Tree"
|
||||
final DockingActionIf closeAction = getAction(plugin, "Close Tree View");
|
||||
SwingUtilities.invokeAndWait(() -> closeAction.actionPerformed(new ActionContext()));
|
||||
SwingUtilities.invokeAndWait(() -> closeAction.actionPerformed(new DefaultActionContext()));
|
||||
|
||||
String[] treeNames = program.getListing().getTreeNames();
|
||||
assertEquals(treeNames.length - 1, tabbedPane.getTabCount());
|
||||
|
@ -251,7 +255,8 @@ public class ViewManagerPluginTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
setCurrentViewProvider("Tree Two");
|
||||
|
||||
final DockingActionIf deleteAction = getAction(plugin, "Delete Tree View");
|
||||
SwingUtilities.invokeAndWait(() -> deleteAction.actionPerformed(new ActionContext()));
|
||||
SwingUtilities
|
||||
.invokeAndWait(() -> deleteAction.actionPerformed(new DefaultActionContext()));
|
||||
program.flushEvents();
|
||||
assertNull(program.getListing().getRootModule("Tree Two"));
|
||||
String[] treeNames = program.getListing().getTreeNames();
|
||||
|
@ -285,26 +290,31 @@ public class ViewManagerPluginTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
|
||||
setCurrentViewProvider("Main Tree");
|
||||
|
||||
SwingUtilities.invokeAndWait(() -> deleteAction.actionPerformed(new ActionContext()));
|
||||
SwingUtilities
|
||||
.invokeAndWait(() -> deleteAction.actionPerformed(new DefaultActionContext()));
|
||||
program.flushEvents();
|
||||
|
||||
setCurrentViewProvider("Tree One");
|
||||
|
||||
SwingUtilities.invokeAndWait(() -> deleteAction.actionPerformed(new ActionContext()));
|
||||
SwingUtilities
|
||||
.invokeAndWait(() -> deleteAction.actionPerformed(new DefaultActionContext()));
|
||||
program.flushEvents();
|
||||
|
||||
setCurrentViewProvider("Tree Two");
|
||||
|
||||
SwingUtilities.invokeAndWait(() -> deleteAction.actionPerformed(new ActionContext()));
|
||||
SwingUtilities
|
||||
.invokeAndWait(() -> deleteAction.actionPerformed(new DefaultActionContext()));
|
||||
program.flushEvents();
|
||||
|
||||
setCurrentViewProvider("Tree Three");
|
||||
|
||||
SwingUtilities.invokeAndWait(() -> deleteAction.actionPerformed(new ActionContext()));
|
||||
SwingUtilities
|
||||
.invokeAndWait(() -> deleteAction.actionPerformed(new DefaultActionContext()));
|
||||
program.flushEvents();
|
||||
|
||||
// attempt to delete the last view
|
||||
SwingUtilities.invokeAndWait(() -> deleteAction.actionPerformed(new ActionContext()));
|
||||
SwingUtilities
|
||||
.invokeAndWait(() -> deleteAction.actionPerformed(new DefaultActionContext()));
|
||||
program.flushEvents();
|
||||
|
||||
ViewProviderService vps = provider.getCurrentViewProvider();
|
||||
|
@ -321,18 +331,18 @@ public class ViewManagerPluginTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
final DockingActionIf closeAction = getAction(plugin, "Close Tree View");
|
||||
|
||||
setCurrentViewProvider(PluginConstants.DEFAULT_TREE_NAME);
|
||||
SwingUtilities.invokeAndWait(() -> closeAction.actionPerformed(new ActionContext()));
|
||||
SwingUtilities.invokeAndWait(() -> closeAction.actionPerformed(new DefaultActionContext()));
|
||||
|
||||
setCurrentViewProvider("Main Tree");
|
||||
SwingUtilities.invokeAndWait(() -> {
|
||||
closeAction.actionPerformed(new ActionContext());
|
||||
closeAction.actionPerformed(new DefaultActionContext());
|
||||
provider.setCurrentViewProvider("Tree One");
|
||||
closeAction.actionPerformed(new ActionContext());
|
||||
closeAction.actionPerformed(new DefaultActionContext());
|
||||
provider.setCurrentViewProvider("Tree Two");
|
||||
closeAction.actionPerformed(new ActionContext());
|
||||
closeAction.actionPerformed(new DefaultActionContext());
|
||||
provider.setCurrentViewProvider("Tree Three");
|
||||
DockingActionIf deleteAction = getAction(plugin, "Delete Tree View");
|
||||
deleteAction.actionPerformed(new ActionContext());
|
||||
deleteAction.actionPerformed(new DefaultActionContext());
|
||||
});
|
||||
// cannot delete the last view
|
||||
ViewProviderService vps = provider.getCurrentViewProvider();
|
||||
|
@ -355,7 +365,8 @@ public class ViewManagerPluginTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
waitForPostedSwingRunnables();
|
||||
|
||||
setCurrentViewProvider(PluginConstants.DEFAULT_TREE_NAME);
|
||||
SwingUtilities.invokeAndWait(() -> renameAction.actionPerformed(new ActionContext()));
|
||||
SwingUtilities
|
||||
.invokeAndWait(() -> renameAction.actionPerformed(new DefaultActionContext()));
|
||||
|
||||
EditWindow editWindow = findEditWindow(tool.getToolFrame());
|
||||
assertNotNull(editWindow);
|
||||
|
@ -397,7 +408,8 @@ public class ViewManagerPluginTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
waitForPostedSwingRunnables();
|
||||
|
||||
setCurrentViewProvider(PluginConstants.DEFAULT_TREE_NAME);
|
||||
SwingUtilities.invokeAndWait(() -> renameAction.actionPerformed(new ActionContext()));
|
||||
SwingUtilities
|
||||
.invokeAndWait(() -> renameAction.actionPerformed(new DefaultActionContext()));
|
||||
EditWindow editWindow = findEditWindow(tool.getToolFrame());
|
||||
assertNotNull(editWindow);
|
||||
final JTextField textField = (JTextField) getInstanceField("textField", editWindow);
|
||||
|
|
|
@ -36,7 +36,7 @@ import javax.swing.undo.UndoableEdit;
|
|||
|
||||
import org.junit.*;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import docking.action.DockingActionIf;
|
||||
import docking.widgets.OptionDialog;
|
||||
import docking.widgets.filter.FilterTextField;
|
||||
|
@ -307,7 +307,7 @@ public abstract class AbstractGhidraScriptMgrPluginTest
|
|||
|
||||
DockingActionIf runLastAction = getRunLastScriptAction();
|
||||
final AtomicReference<Boolean> ref = new AtomicReference<>();
|
||||
runSwing(() -> ref.set(runLastAction.isEnabledForContext(new ActionContext())));
|
||||
runSwing(() -> ref.set(runLastAction.isEnabledForContext(new DefaultActionContext())));
|
||||
assertEquals("Run Last Action not enabled as expected", enabled, ref.get());
|
||||
}
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@ import javax.swing.*;
|
|||
import org.junit.*;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import docking.action.DockingActionIf;
|
||||
import docking.widgets.textfield.IntegerTextField;
|
||||
import ghidra.app.plugin.core.blockmodel.BlockModelServicePlugin;
|
||||
|
@ -113,7 +114,7 @@ public class SelectBlockPluginTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
private ActionContext getContext() {
|
||||
ActionContext context = browser.getProvider().getActionContext(null);
|
||||
if (context == null) {
|
||||
context = new ActionContext();
|
||||
context = new DefaultActionContext();
|
||||
}
|
||||
return context;
|
||||
}
|
||||
|
|
|
@ -237,7 +237,7 @@ public class SymbolTablePluginTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
public void testFilter() throws Exception {
|
||||
openProgram("sample");
|
||||
|
||||
performAction(setFilterAction, new ActionContext(), false);
|
||||
performAction(setFilterAction, new DefaultActionContext(), false);
|
||||
waitForSwing();
|
||||
|
||||
final FilterDialog filterDialog1 = waitForDialogComponent(FilterDialog.class);
|
||||
|
@ -694,7 +694,7 @@ public class SymbolTablePluginTest extends AbstractGhidraHeadedIntegrationTest {
|
|||
public void testDefaultFunctionToNamedFunctionWithFilterOn() throws Exception {
|
||||
openProgram("sample");
|
||||
|
||||
performAction(setFilterAction, new ActionContext(), false);
|
||||
performAction(setFilterAction, new DefaultActionContext(), false);
|
||||
waitForSwing();
|
||||
|
||||
final FilterDialog filterDialog1 = waitForDialogComponent(FilterDialog.class);
|
||||
|
|
|
@ -24,6 +24,7 @@ import javax.swing.*;
|
|||
import javax.swing.tree.TreePath;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import docking.action.DockingAction;
|
||||
import docking.action.MenuData;
|
||||
import docking.tool.ToolConstants;
|
||||
|
@ -488,7 +489,7 @@ public class FunctionBitPatternsMainProvider extends ComponentProviderAdapter
|
|||
return super.getActionContext(event);
|
||||
}
|
||||
|
||||
class EvaluateContext extends ActionContext {
|
||||
class EvaluateContext extends DefaultActionContext {
|
||||
List<PatternInfoRowObject> selectedRows;
|
||||
|
||||
public EvaluateContext(List<PatternInfoRowObject> selectedRowObjects) {
|
||||
|
@ -510,7 +511,7 @@ public class FunctionBitPatternsMainProvider extends ComponentProviderAdapter
|
|||
}
|
||||
}
|
||||
|
||||
class ByteSequenceContext extends ActionContext {
|
||||
class ByteSequenceContext extends DefaultActionContext {
|
||||
ByteSequencePanelBuilder builder;
|
||||
List<ByteSequenceRowObject> selectedRows;
|
||||
|
||||
|
@ -532,7 +533,7 @@ public class FunctionBitPatternsMainProvider extends ComponentProviderAdapter
|
|||
}
|
||||
}
|
||||
|
||||
class InstructionTreeContext extends ActionContext {
|
||||
class InstructionTreeContext extends DefaultActionContext {
|
||||
private FunctionBitPatternsGTree tree;
|
||||
private TreePath path;
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ import java.util.Date;
|
|||
|
||||
import org.junit.*;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import docking.action.ToggleDockingAction;
|
||||
import docking.widgets.fieldpanel.support.FieldLocation;
|
||||
import ghidra.app.plugin.core.format.*;
|
||||
|
@ -153,7 +153,7 @@ public class ByteViewerConnectedToolBehaviorTest extends AbstractGhidraHeadedInt
|
|||
ByteViewerComponent c = panelOne.getCurrentComponent();
|
||||
c.setCursorPosition(loc.getIndex(), loc.getFieldNum(), 0, 0);
|
||||
action.setSelected(true);
|
||||
action.actionPerformed(new ActionContext());
|
||||
action.actionPerformed(new DefaultActionContext());
|
||||
});
|
||||
assertTrue(action.isSelected());
|
||||
final ByteViewerComponent c = panelOne.getCurrentComponent();
|
||||
|
@ -183,7 +183,7 @@ public class ByteViewerConnectedToolBehaviorTest extends AbstractGhidraHeadedInt
|
|||
ByteViewerComponent c = panelOne.getCurrentComponent();
|
||||
c.setCursorPosition(loc.getIndex(), loc.getFieldNum(), 0, 0);
|
||||
action.setSelected(true);
|
||||
action.actionPerformed(new ActionContext());
|
||||
action.actionPerformed(new DefaultActionContext());
|
||||
});
|
||||
assertTrue(action.isSelected());
|
||||
final ByteViewerComponent c = panelOne.getCurrentComponent();
|
||||
|
|
|
@ -819,7 +819,7 @@ public class ByteViewerPlugin1Test extends AbstractGhidraHeadedIntegrationTest {
|
|||
final DockingActionIf action = getAction(plugin, "Byte Viewer Options");
|
||||
assertTrue(action.isEnabled());
|
||||
|
||||
runSwing(() -> action.actionPerformed(new ActionContext()), false);
|
||||
runSwing(() -> action.actionPerformed(new DefaultActionContext()), false);
|
||||
waitForSwing();
|
||||
ByteViewerOptionsDialog d = waitForDialogComponent(ByteViewerOptionsDialog.class);
|
||||
return d;
|
||||
|
|
|
@ -28,7 +28,7 @@ import javax.swing.*;
|
|||
|
||||
import org.junit.*;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import docking.DockingUtils;
|
||||
import docking.action.DockingActionIf;
|
||||
import docking.action.ToggleDockingAction;
|
||||
|
@ -144,7 +144,7 @@ public class ByteViewerPlugin2Test extends AbstractGhidraHeadedIntegrationTest {
|
|||
ByteViewerComponent c = panel.getCurrentComponent();
|
||||
c.setCursorPosition(loc.getIndex(), loc.getFieldNum(), 0, 0);
|
||||
action.setSelected(true);
|
||||
action.actionPerformed(new ActionContext());
|
||||
action.actionPerformed(new DefaultActionContext());
|
||||
});
|
||||
assertTrue(action.isSelected());
|
||||
final ByteViewerComponent c = panel.getCurrentComponent();
|
||||
|
@ -162,7 +162,7 @@ public class ByteViewerPlugin2Test extends AbstractGhidraHeadedIntegrationTest {
|
|||
|
||||
SwingUtilities.invokeAndWait(() -> {
|
||||
action.setSelected(false);
|
||||
action.actionPerformed(new ActionContext());
|
||||
action.actionPerformed(new DefaultActionContext());
|
||||
});
|
||||
assertTrue(!action.isSelected());
|
||||
assertEquals(ByteViewerComponentProvider.CURSOR_ACTIVE_COLOR,
|
||||
|
@ -188,7 +188,7 @@ public class ByteViewerPlugin2Test extends AbstractGhidraHeadedIntegrationTest {
|
|||
ByteViewerComponent c = panel.getCurrentComponent();
|
||||
c.setCursorPosition(loc.getIndex(), loc.getFieldNum(), 0, 0);
|
||||
action.setSelected(true);
|
||||
action.actionPerformed(new ActionContext());
|
||||
action.actionPerformed(new DefaultActionContext());
|
||||
});
|
||||
assertTrue(action.isSelected());
|
||||
final ByteViewerComponent c = panel.getCurrentComponent();
|
||||
|
@ -237,7 +237,7 @@ public class ByteViewerPlugin2Test extends AbstractGhidraHeadedIntegrationTest {
|
|||
(ToggleDockingAction) getAction(plugin, "Enable/Disable Byteviewer Editing");
|
||||
SwingUtilities.invokeAndWait(() -> {
|
||||
action.setSelected(true);
|
||||
action.actionPerformed(new ActionContext());
|
||||
action.actionPerformed(new DefaultActionContext());
|
||||
});
|
||||
final ByteViewerComponent c = panel.getCurrentComponent();
|
||||
|
||||
|
@ -282,7 +282,7 @@ public class ByteViewerPlugin2Test extends AbstractGhidraHeadedIntegrationTest {
|
|||
(ToggleDockingAction) getAction(plugin, "Enable/Disable Byteviewer Editing");
|
||||
SwingUtilities.invokeAndWait(() -> {
|
||||
action.setSelected(true);
|
||||
action.actionPerformed(new ActionContext());
|
||||
action.actionPerformed(new DefaultActionContext());
|
||||
});
|
||||
final ByteViewerComponent c = panel.getCurrentComponent();
|
||||
|
||||
|
@ -325,7 +325,7 @@ public class ByteViewerPlugin2Test extends AbstractGhidraHeadedIntegrationTest {
|
|||
ByteViewerComponent c = panel.getCurrentComponent();
|
||||
c.setCursorPosition(loc.getIndex(), loc.getFieldNum(), 0, 0);
|
||||
action.setSelected(true);
|
||||
action.actionPerformed(new ActionContext());
|
||||
action.actionPerformed(new DefaultActionContext());
|
||||
});
|
||||
final ByteViewerComponent c = panel.getCurrentComponent();
|
||||
byte value = program.getMemory().getByte(addr);
|
||||
|
@ -378,7 +378,7 @@ public class ByteViewerPlugin2Test extends AbstractGhidraHeadedIntegrationTest {
|
|||
ByteViewerComponent c = panel.getCurrentComponent();
|
||||
c.setCursorPosition(loc.getIndex(), loc.getFieldNum(), 0, 0);
|
||||
action.setSelected(true);
|
||||
action.actionPerformed(new ActionContext());
|
||||
action.actionPerformed(new DefaultActionContext());
|
||||
});
|
||||
final ByteViewerComponent c = panel.getCurrentComponent();
|
||||
|
||||
|
@ -472,7 +472,7 @@ public class ByteViewerPlugin2Test extends AbstractGhidraHeadedIntegrationTest {
|
|||
currentComponent.setCursorPosition(loc.getIndex(), loc.getFieldNum(), loc.getRow(),
|
||||
loc.getCol());
|
||||
action.setSelected(true);
|
||||
action.actionPerformed(new ActionContext());
|
||||
action.actionPerformed(new DefaultActionContext());
|
||||
});
|
||||
byte value = program.getMemory().getByte(addr);
|
||||
SwingUtilities.invokeAndWait(() -> {
|
||||
|
@ -527,7 +527,7 @@ public class ByteViewerPlugin2Test extends AbstractGhidraHeadedIntegrationTest {
|
|||
ByteViewerComponent currentComponent = panel.getCurrentComponent();
|
||||
currentComponent.setCursorPosition(loc.getIndex(), loc.getFieldNum(), 0, 0);
|
||||
action.setSelected(true);
|
||||
action.actionPerformed(new ActionContext());
|
||||
action.actionPerformed(new DefaultActionContext());
|
||||
});
|
||||
|
||||
SwingUtilities.invokeAndWait(() -> {
|
||||
|
@ -589,7 +589,7 @@ public class ByteViewerPlugin2Test extends AbstractGhidraHeadedIntegrationTest {
|
|||
ByteViewerComponent c = panel.getCurrentComponent();
|
||||
c.setCursorPosition(loc.getIndex(), loc.getFieldNum(), 0, 0);
|
||||
action.setSelected(true);
|
||||
action.actionPerformed(new ActionContext());
|
||||
action.actionPerformed(new DefaultActionContext());
|
||||
});
|
||||
assertTrue(action.isSelected());
|
||||
final ByteViewerComponent c = panel.getCurrentComponent();
|
||||
|
@ -619,7 +619,7 @@ public class ByteViewerPlugin2Test extends AbstractGhidraHeadedIntegrationTest {
|
|||
ByteViewerComponent currentComponent = panel.getCurrentComponent();
|
||||
currentComponent.setCursorPosition(loc.getIndex(), loc.getFieldNum(), 0, 0);
|
||||
action.setSelected(true);
|
||||
action.actionPerformed(new ActionContext());
|
||||
action.actionPerformed(new DefaultActionContext());
|
||||
});
|
||||
waitForPostedSwingRunnables();
|
||||
assertTrue(action.isSelected());
|
||||
|
@ -638,7 +638,7 @@ public class ByteViewerPlugin2Test extends AbstractGhidraHeadedIntegrationTest {
|
|||
|
||||
SwingUtilities.invokeAndWait(() -> {
|
||||
action.setSelected(false);
|
||||
action.actionPerformed(new ActionContext());
|
||||
action.actionPerformed(new DefaultActionContext());
|
||||
});
|
||||
assertTrue(!action.isSelected());
|
||||
assertEquals(ByteViewerComponentProvider.CURSOR_ACTIVE_COLOR,
|
||||
|
@ -660,7 +660,7 @@ public class ByteViewerPlugin2Test extends AbstractGhidraHeadedIntegrationTest {
|
|||
ByteViewerComponent currentComponent = panel.getCurrentComponent();
|
||||
currentComponent.setCursorPosition(loc.getIndex(), loc.getFieldNum(), 0, 0);
|
||||
action.setSelected(true);
|
||||
action.actionPerformed(new ActionContext());
|
||||
action.actionPerformed(new DefaultActionContext());
|
||||
});
|
||||
assertTrue(action.isSelected());
|
||||
assertEquals(ByteViewerComponentProvider.CHANGED_VALUE_COLOR, c.getFocusedCursorColor());
|
||||
|
@ -680,7 +680,7 @@ public class ByteViewerPlugin2Test extends AbstractGhidraHeadedIntegrationTest {
|
|||
|
||||
SwingUtilities.invokeAndWait(() -> {
|
||||
action.setSelected(false);
|
||||
action.actionPerformed(new ActionContext());
|
||||
action.actionPerformed(new DefaultActionContext());
|
||||
});
|
||||
assertTrue(!action.isSelected());
|
||||
assertEquals(ByteViewerComponentProvider.CURSOR_ACTIVE_COLOR,
|
||||
|
@ -702,7 +702,7 @@ public class ByteViewerPlugin2Test extends AbstractGhidraHeadedIntegrationTest {
|
|||
ByteViewerComponent currentComponent = panel.getCurrentComponent();
|
||||
currentComponent.setCursorPosition(loc.getIndex(), loc.getFieldNum(), 0, 0);
|
||||
action.setSelected(true);
|
||||
action.actionPerformed(new ActionContext());
|
||||
action.actionPerformed(new DefaultActionContext());
|
||||
});
|
||||
assertTrue(action.isSelected());
|
||||
assertEquals(ByteViewerComponentProvider.CHANGED_VALUE_COLOR, c.getFocusedCursorColor());
|
||||
|
@ -732,7 +732,7 @@ public class ByteViewerPlugin2Test extends AbstractGhidraHeadedIntegrationTest {
|
|||
ByteViewerComponent currentComponent = panel.getCurrentComponent();
|
||||
currentComponent.setCursorPosition(loc.getIndex(), loc.getFieldNum(), 0, 0);
|
||||
action.setSelected(true);
|
||||
action.actionPerformed(new ActionContext());
|
||||
action.actionPerformed(new DefaultActionContext());
|
||||
});
|
||||
assertTrue(action.isSelected());
|
||||
assertEquals(ByteViewerComponentProvider.CHANGED_VALUE_COLOR, c.getFocusedCursorColor());
|
||||
|
@ -749,7 +749,7 @@ public class ByteViewerPlugin2Test extends AbstractGhidraHeadedIntegrationTest {
|
|||
|
||||
SwingUtilities.invokeAndWait(() -> {
|
||||
action.setSelected(false);
|
||||
action.actionPerformed(new ActionContext());
|
||||
action.actionPerformed(new DefaultActionContext());
|
||||
});
|
||||
assertTrue(!action.isSelected());
|
||||
assertEquals(ByteViewerComponentProvider.CURSOR_ACTIVE_COLOR,
|
||||
|
@ -765,7 +765,7 @@ public class ByteViewerPlugin2Test extends AbstractGhidraHeadedIntegrationTest {
|
|||
(ToggleDockingAction) getAction(plugin, "Enable/Disable Byteviewer Editing");
|
||||
SwingUtilities.invokeAndWait(() -> {
|
||||
action.setSelected(true);
|
||||
action.actionPerformed(new ActionContext());
|
||||
action.actionPerformed(new DefaultActionContext());
|
||||
});
|
||||
|
||||
// add a memory block
|
||||
|
@ -818,7 +818,7 @@ public class ByteViewerPlugin2Test extends AbstractGhidraHeadedIntegrationTest {
|
|||
(ToggleDockingAction) getAction(plugin, "Enable/Disable Byteviewer Editing");
|
||||
SwingUtilities.invokeAndWait(() -> {
|
||||
action.setSelected(true);
|
||||
action.actionPerformed(new ActionContext());
|
||||
action.actionPerformed(new DefaultActionContext());
|
||||
});
|
||||
|
||||
// first add a memory block
|
||||
|
@ -1176,7 +1176,7 @@ public class ByteViewerPlugin2Test extends AbstractGhidraHeadedIntegrationTest {
|
|||
ToggleDockingAction action =
|
||||
(ToggleDockingAction) getAction(plugin, "Enable/Disable Byteviewer Editing");
|
||||
action.setSelected(true);
|
||||
action.actionPerformed(new ActionContext());
|
||||
action.actionPerformed(new DefaultActionContext());
|
||||
});
|
||||
|
||||
// add the block
|
||||
|
@ -1292,7 +1292,7 @@ public class ByteViewerPlugin2Test extends AbstractGhidraHeadedIntegrationTest {
|
|||
ToggleDockingAction action =
|
||||
(ToggleDockingAction) getAction(plugin, "Enable/Disable Byteviewer Editing");
|
||||
action.setSelected(true);
|
||||
action.actionPerformed(new ActionContext());
|
||||
action.actionPerformed(new DefaultActionContext());
|
||||
|
||||
ByteViewerComponent c = panel.getCurrentComponent();
|
||||
|
||||
|
@ -1529,7 +1529,7 @@ public class ByteViewerPlugin2Test extends AbstractGhidraHeadedIntegrationTest {
|
|||
final DockingActionIf action = getAction(plugin, "Byte Viewer Options");
|
||||
assertTrue(action.isEnabled());
|
||||
|
||||
SwingUtilities.invokeLater(() -> action.actionPerformed(new ActionContext()));
|
||||
SwingUtilities.invokeLater(() -> action.actionPerformed(new DefaultActionContext()));
|
||||
waitForPostedSwingRunnables();
|
||||
ByteViewerOptionsDialog d = env.waitForDialogComponent(ByteViewerOptionsDialog.class, 2000);
|
||||
return d;
|
||||
|
|
|
@ -27,7 +27,7 @@ import javax.swing.*;
|
|||
|
||||
import org.junit.*;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import docking.action.DockingActionIf;
|
||||
import docking.action.ToggleDockingAction;
|
||||
import docking.widgets.fieldpanel.support.FieldLocation;
|
||||
|
@ -274,7 +274,7 @@ public class ByteViewerPluginFormatsTest extends AbstractGhidraHeadedIntegration
|
|||
ByteViewerComponent currentComponent = panel.getCurrentComponent();
|
||||
currentComponent.setCursorPosition(loc.getIndex(), loc.getFieldNum(), 0, 0);
|
||||
action.setSelected(true);
|
||||
action.actionPerformed(new ActionContext());
|
||||
action.actionPerformed(new DefaultActionContext());
|
||||
KeyEvent ev =
|
||||
new KeyEvent(currentComponent, 0, new Date().getTime(), 0, KeyEvent.VK_1, '1');
|
||||
currentComponent.keyPressed(ev, loc.getIndex(), loc.getFieldNum(), loc.getRow(),
|
||||
|
@ -417,7 +417,7 @@ public class ByteViewerPluginFormatsTest extends AbstractGhidraHeadedIntegration
|
|||
ByteViewerComponent currentComponent = panel.getCurrentComponent();
|
||||
currentComponent.setCursorPosition(loc.getIndex(), loc.getFieldNum(), 0, 0);
|
||||
action.setSelected(true);
|
||||
action.actionPerformed(new ActionContext());
|
||||
action.actionPerformed(new DefaultActionContext());
|
||||
|
||||
KeyEvent ev =
|
||||
new KeyEvent(currentComponent, 0, new Date().getTime(), 0, KeyEvent.VK_1, '1');
|
||||
|
@ -463,7 +463,7 @@ public class ByteViewerPluginFormatsTest extends AbstractGhidraHeadedIntegration
|
|||
|
||||
ByteViewerComponent currentComponent = panel.getCurrentComponent();
|
||||
currentComponent.setCursorPosition(loc.getIndex(), loc.getFieldNum(), 0, 0);
|
||||
action.actionPerformed(new ActionContext());
|
||||
action.actionPerformed(new DefaultActionContext());
|
||||
|
||||
KeyEvent ev =
|
||||
new KeyEvent(currentComponent, 0, new Date().getTime(), 0, KeyEvent.VK_1, '1');
|
||||
|
@ -821,7 +821,7 @@ public class ByteViewerPluginFormatsTest extends AbstractGhidraHeadedIntegration
|
|||
final DockingActionIf action = getAction(plugin, "Byte Viewer Options");
|
||||
assertTrue(action.isEnabled());
|
||||
|
||||
runSwing(() -> action.actionPerformed(new ActionContext()), false);
|
||||
runSwing(() -> action.actionPerformed(new DefaultActionContext()), false);
|
||||
waitForSwing();
|
||||
ByteViewerOptionsDialog d = waitForDialogComponent(ByteViewerOptionsDialog.class);
|
||||
return d;
|
||||
|
|
|
@ -17,8 +17,8 @@ package ghidra.app.decompiler.component;
|
|||
|
||||
import java.awt.Component;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.ComponentProvider;
|
||||
import docking.DefaultActionContext;
|
||||
import docking.widgets.fieldpanel.internal.FieldPanelCoordinator;
|
||||
import ghidra.app.context.RestrictedAddressSetContext;
|
||||
import ghidra.app.util.viewer.util.CodeComparisonPanel;
|
||||
|
@ -27,7 +27,7 @@ import ghidra.app.util.viewer.util.CodeComparisonPanelActionContext;
|
|||
/**
|
||||
* Action context for a dual decompiler panel.
|
||||
*/
|
||||
public class DualDecompilerActionContext extends ActionContext
|
||||
public class DualDecompilerActionContext extends DefaultActionContext
|
||||
implements RestrictedAddressSetContext, CodeComparisonPanelActionContext {
|
||||
|
||||
private CodeComparisonPanel<? extends FieldPanelCoordinator> codeComparisonPanel = null;
|
||||
|
|
|
@ -24,8 +24,7 @@ import javax.swing.JPanel;
|
|||
|
||||
import org.jdom.Element;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DialogComponentProvider;
|
||||
import docking.*;
|
||||
import docking.action.*;
|
||||
import docking.widgets.OptionDialog;
|
||||
import ghidra.app.util.viewer.format.*;
|
||||
|
@ -122,7 +121,7 @@ public class SetFormatDialogComponentProvider extends DialogComponentProvider {
|
|||
FieldHeader headerPanel = listingPanel.getFieldHeader();
|
||||
if (headerPanel != null && headerPanel.isAncestorOf(event.getComponent())) {
|
||||
FieldHeaderLocation fhLoc = headerPanel.getFieldHeaderLocation(event.getPoint());
|
||||
return new ActionContext().setContextObject(fhLoc);
|
||||
return new DefaultActionContext().setContextObject(fhLoc);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -15,11 +15,11 @@
|
|||
*/
|
||||
package ghidra.app.plugin.core.functiongraph.action;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import ghidra.app.plugin.core.functiongraph.FGProvider;
|
||||
import ghidra.graph.viewer.actions.VisualGraphSatelliteActionContext;
|
||||
|
||||
public class FunctionGraphSatelliteViewerActionContext extends ActionContext
|
||||
public class FunctionGraphSatelliteViewerActionContext extends DefaultActionContext
|
||||
implements VisualGraphSatelliteActionContext {
|
||||
|
||||
public FunctionGraphSatelliteViewerActionContext(FGProvider functionGraphProvider) {
|
||||
|
|
|
@ -455,7 +455,7 @@ public abstract class AbstractFunctionGraphTest extends AbstractGhidraHeadedInte
|
|||
Object actionManager = getInstanceField("actionManager", graphProvider);
|
||||
final MultiStateDockingAction<?> action =
|
||||
(MultiStateDockingAction<?>) getInstanceField("layoutAction", actionManager);
|
||||
runSwing(() -> action.actionPerformed(new ActionContext()));
|
||||
runSwing(() -> action.actionPerformed(new DefaultActionContext()));
|
||||
|
||||
// wait for the threaded graph layout code
|
||||
FGController controller = getFunctionGraphController();
|
||||
|
@ -2297,7 +2297,7 @@ public abstract class AbstractFunctionGraphTest extends AbstractGhidraHeadedInte
|
|||
|
||||
DockingActionIf action = getAction(tool, "FunctionGraphPlugin", name);
|
||||
ToggleDockingAction displayAction = (ToggleDockingAction) action;
|
||||
setToggleActionSelected(displayAction, new ActionContext(), expectedVisible);
|
||||
setToggleActionSelected(displayAction, new DefaultActionContext(), expectedVisible);
|
||||
//
|
||||
// // make sure the action is not already in the state we expect
|
||||
// assertEquals(name + " action is not selected as expected", !expectedVisible,
|
||||
|
|
|
@ -15,14 +15,14 @@
|
|||
*/
|
||||
package functioncalls.plugin.context;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import functioncalls.graph.FunctionCallGraph;
|
||||
import functioncalls.plugin.FcgProvider;
|
||||
|
||||
/**
|
||||
* Context for the {@link FunctionCallGraph}
|
||||
*/
|
||||
public class FcgActionContext extends ActionContext {
|
||||
public class FcgActionContext extends DefaultActionContext {
|
||||
|
||||
public FcgActionContext(FcgProvider provider) {
|
||||
this(provider, null);
|
||||
|
|
|
@ -75,8 +75,7 @@ public class PdbPlugin extends Plugin {
|
|||
|
||||
private void createActions() {
|
||||
new ActionBuilder("Load PDB File", this.getName())
|
||||
.supportsDefaultToolContext(true)
|
||||
.withContext(ProgramActionContext.class)
|
||||
.withContext(ProgramActionContext.class, true)
|
||||
.validContextWhen(pac -> pac.getProgram() != null &&
|
||||
PdbAnalyzerCommon.canAnalyzeProgram(pac.getProgram()))
|
||||
.menuPath(ToolConstants.MENU_FILE, "Load PDB File...")
|
||||
|
|
|
@ -21,7 +21,7 @@ import java.awt.Window;
|
|||
|
||||
import org.junit.*;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import docking.action.DockingActionIf;
|
||||
import docking.action.ToggleDockingAction;
|
||||
import docking.util.image.ToolIconURL;
|
||||
|
@ -176,8 +176,7 @@ public class DiffSaveSettingsTest extends DiffApplyTestAdapter {
|
|||
ProgramManagerPlugin pm = getPlugin(tool, ProgramManagerPlugin.class);
|
||||
DockingActionIf closeAllProgramAction = getAction(pm, "Close All");
|
||||
assertNotNull(closeAllProgramAction);
|
||||
ActionContext defaultContext = tool.getDefaultToolContext();
|
||||
performAction(closeAllProgramAction, defaultContext, true);
|
||||
performAction(closeAllProgramAction, new DefaultActionContext(), true);
|
||||
|
||||
openProgram(p3);
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ import javax.swing.tree.TreePath;
|
|||
|
||||
import org.junit.Test;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import docking.DialogComponentProvider;
|
||||
import docking.action.DockingActionIf;
|
||||
import docking.widgets.fieldpanel.FieldPanel;
|
||||
|
@ -456,7 +456,7 @@ public class DiffTest extends DiffTestAdapter {
|
|||
JTree tree = getProgramTree();
|
||||
selectTreeNodeByText(tree, ".data");
|
||||
|
||||
runSwing(() -> replaceView.actionPerformed(new ActionContext()));
|
||||
runSwing(() -> replaceView.actionPerformed(new DefaultActionContext()));
|
||||
|
||||
topOfFile(fp1);
|
||||
assertEquals(addr("1008000"), cb.getCurrentAddress());
|
||||
|
@ -482,11 +482,11 @@ public class DiffTest extends DiffTestAdapter {
|
|||
JTree tree = getProgramTree();
|
||||
selectTreeNodeByText(tree, ".data");
|
||||
|
||||
runSwing(() -> replaceView.actionPerformed(new ActionContext()));
|
||||
runSwing(() -> replaceView.actionPerformed(new DefaultActionContext()));
|
||||
|
||||
selectTreeNodeByText(tree, ".rsrc");
|
||||
|
||||
runSwing(() -> goToView.actionPerformed(new ActionContext()));
|
||||
runSwing(() -> goToView.actionPerformed(new DefaultActionContext()));
|
||||
|
||||
topOfFile(fp1);
|
||||
assertEquals(addr("1008000"), cb.getCurrentAddress());
|
||||
|
@ -874,7 +874,7 @@ public class DiffTest extends DiffTestAdapter {
|
|||
private void clickDiffButton() {
|
||||
runSwing(() -> {
|
||||
openClosePgm2.setSelected(!openClosePgm2.isSelected());
|
||||
openClosePgm2.actionPerformed(new ActionContext());
|
||||
openClosePgm2.actionPerformed(new DefaultActionContext());
|
||||
}, false);
|
||||
waitForSwing();
|
||||
}
|
||||
|
|
|
@ -720,11 +720,11 @@ public class DiffTestAdapter extends AbstractGhidraHeadedIntegrationTest {
|
|||
}
|
||||
|
||||
void launchDiffByAction() {
|
||||
setToggleActionSelected(openClosePgm2, new ActionContext(), true, false);
|
||||
setToggleActionSelected(openClosePgm2, new DefaultActionContext(), true, false);
|
||||
}
|
||||
|
||||
void closeDiffByAction() {
|
||||
setToggleActionSelected(openClosePgm2, new ActionContext(), false, false);
|
||||
setToggleActionSelected(openClosePgm2, new DefaultActionContext(), false, false);
|
||||
}
|
||||
|
||||
void invokeAndWait(DockingActionIf action) {
|
||||
|
|
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