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