mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-05-26 06:56:09 +08: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:
+2
-2
@@ -15,10 +15,10 @@
|
||||
*/
|
||||
package ghidra.app.plugin.core.debug.gui;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import ghidra.trace.model.Trace;
|
||||
|
||||
public class DebuggerSnapActionContext extends ActionContext {
|
||||
public class DebuggerSnapActionContext extends DefaultActionContext {
|
||||
private final Trace trace;
|
||||
private final long snap;
|
||||
|
||||
|
||||
+2
-2
@@ -18,10 +18,10 @@ package ghidra.app.plugin.core.debug.gui.breakpoint;
|
||||
import java.util.Collection;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import ghidra.trace.model.breakpoint.TraceBreakpoint;
|
||||
|
||||
public class DebuggerBreakpointLocationsActionContext extends ActionContext {
|
||||
public class DebuggerBreakpointLocationsActionContext extends DefaultActionContext {
|
||||
private final Collection<BreakpointLocationRow> selection;
|
||||
|
||||
public DebuggerBreakpointLocationsActionContext(Collection<BreakpointLocationRow> selection) {
|
||||
|
||||
+4
-4
@@ -18,10 +18,10 @@ package ghidra.app.plugin.core.debug.gui.breakpoint;
|
||||
import java.util.Collection;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import ghidra.app.services.LogicalBreakpoint;
|
||||
|
||||
public class DebuggerLogicalBreakpointsActionContext extends ActionContext {
|
||||
public class DebuggerLogicalBreakpointsActionContext extends DefaultActionContext {
|
||||
private final Collection<LogicalBreakpointRow> selection;
|
||||
|
||||
public DebuggerLogicalBreakpointsActionContext(Collection<LogicalBreakpointRow> selection) {
|
||||
@@ -34,7 +34,7 @@ public class DebuggerLogicalBreakpointsActionContext extends ActionContext {
|
||||
|
||||
public Collection<LogicalBreakpoint> getBreakpoints() {
|
||||
return selection.stream()
|
||||
.map(row -> row.getLogicalBreakpoint())
|
||||
.collect(Collectors.toList());
|
||||
.map(row -> row.getLogicalBreakpoint())
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -15,9 +15,9 @@
|
||||
*/
|
||||
package ghidra.app.plugin.core.debug.gui.breakpoint;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
|
||||
// TODO: Any granularity, or just one suggested action on the global tool?
|
||||
public class DebuggerMakeBreakpointsEffectiveActionContext extends ActionContext {
|
||||
public class DebuggerMakeBreakpointsEffectiveActionContext extends DefaultActionContext {
|
||||
// Nothing to add
|
||||
}
|
||||
|
||||
+2
-2
@@ -15,8 +15,8 @@
|
||||
*/
|
||||
package ghidra.app.plugin.core.debug.gui.console;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
|
||||
public class LogRowConsoleActionContext extends ActionContext {
|
||||
public class LogRowConsoleActionContext extends DefaultActionContext {
|
||||
|
||||
}
|
||||
|
||||
+2
-2
@@ -17,10 +17,10 @@ package ghidra.app.plugin.core.debug.gui.listing;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import ghidra.framework.model.DomainFile;
|
||||
|
||||
public class DebuggerOpenProgramActionContext extends ActionContext {
|
||||
public class DebuggerOpenProgramActionContext extends DefaultActionContext {
|
||||
private final DomainFile df;
|
||||
private final int hashCode;
|
||||
|
||||
|
||||
+2
-2
@@ -18,10 +18,10 @@ package ghidra.app.plugin.core.debug.gui.memory;
|
||||
import java.util.Collection;
|
||||
import java.util.Set;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import docking.widgets.table.GTable;
|
||||
|
||||
public class DebuggerRegionActionContext extends ActionContext {
|
||||
public class DebuggerRegionActionContext extends DefaultActionContext {
|
||||
private final Set<RegionRow> selectedRegions;
|
||||
|
||||
public DebuggerRegionActionContext(DebuggerRegionsProvider provider,
|
||||
|
||||
+21
-20
@@ -23,6 +23,7 @@ import java.util.List;
|
||||
import javax.swing.*;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import docking.action.DockingAction;
|
||||
import docking.action.builder.ToggleActionBuilder;
|
||||
import ghidra.app.plugin.core.debug.DebuggerPluginPackage;
|
||||
@@ -96,27 +97,27 @@ public class MemviewProvider extends ComponentProviderAdapter {
|
||||
tool.addLocalAction(this, zoomOutTAction);
|
||||
|
||||
new ToggleActionBuilder("Toggle Layout", plugin.getName()) //
|
||||
//.menuPath("&Toggle layout") //
|
||||
.toolBarIcon(AbstractRefreshAction.ICON)
|
||||
.helpLocation(new HelpLocation(plugin.getName(), "toggle_layout")) //
|
||||
.onAction(ctx -> performToggleLayout(ctx))
|
||||
.buildAndInstallLocal(this);
|
||||
//.menuPath("&Toggle layout") //
|
||||
.toolBarIcon(AbstractRefreshAction.ICON)
|
||||
.helpLocation(new HelpLocation(plugin.getName(), "toggle_layout")) //
|
||||
.onAction(ctx -> performToggleLayout(ctx))
|
||||
.buildAndInstallLocal(this);
|
||||
|
||||
new ToggleActionBuilder("Toggle Process Trace", plugin.getName()) //
|
||||
//.menuPath("&Toggle layout") //
|
||||
.toolBarIcon(DebuggerResources.ICON_SYNC)
|
||||
.helpLocation(new HelpLocation(plugin.getName(), "toggle_process_trace")) //
|
||||
.onAction(ctx -> performToggleTrace(ctx))
|
||||
.selected(false)
|
||||
.buildAndInstallLocal(this);
|
||||
//.menuPath("&Toggle layout") //
|
||||
.toolBarIcon(DebuggerResources.ICON_SYNC)
|
||||
.helpLocation(new HelpLocation(plugin.getName(), "toggle_process_trace")) //
|
||||
.onAction(ctx -> performToggleTrace(ctx))
|
||||
.selected(false)
|
||||
.buildAndInstallLocal(this);
|
||||
|
||||
new ToggleActionBuilder("Apply Filter To Panel", plugin.getName()) //
|
||||
//.menuPath("&Toggle layout") //
|
||||
.toolBarIcon(DebuggerResources.ICON_FILTER)
|
||||
.helpLocation(new HelpLocation(plugin.getName(), "apply_to_panel")) //
|
||||
.onAction(ctx -> performApplyFilterToPanel(ctx))
|
||||
.selected(true)
|
||||
.buildAndInstallLocal(this);
|
||||
//.menuPath("&Toggle layout") //
|
||||
.toolBarIcon(DebuggerResources.ICON_FILTER)
|
||||
.helpLocation(new HelpLocation(plugin.getName(), "apply_to_panel")) //
|
||||
.onAction(ctx -> performApplyFilterToPanel(ctx))
|
||||
.selected(true)
|
||||
.buildAndInstallLocal(this);
|
||||
|
||||
}
|
||||
|
||||
@@ -176,10 +177,10 @@ public class MemviewProvider extends ComponentProviderAdapter {
|
||||
@Override
|
||||
public ActionContext getActionContext(MouseEvent event) {
|
||||
if (event != null && event.getSource() == mainPanel) {
|
||||
return new ActionContext(this, mainPanel);
|
||||
return new DefaultActionContext(this, mainPanel);
|
||||
}
|
||||
if (event != null && event.getSource() == memviewPanel) {
|
||||
return new ActionContext(this, memviewPanel);
|
||||
return new DefaultActionContext(this, memviewPanel);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -217,7 +218,7 @@ public class MemviewProvider extends ComponentProviderAdapter {
|
||||
public void goTo(int x, int y) {
|
||||
Rectangle bounds = scrollPane.getBounds();
|
||||
scrollPane.getViewport()
|
||||
.scrollRectToVisible(new Rectangle(x, y, bounds.width, bounds.height));
|
||||
.scrollRectToVisible(new Rectangle(x, y, bounds.width, bounds.height));
|
||||
scrollPane.getViewport().doLayout();
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -19,11 +19,11 @@ import java.awt.Component;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.ComponentProvider;
|
||||
import docking.DefaultActionContext;
|
||||
import ghidra.trace.model.target.TraceObjectValue;
|
||||
|
||||
public class DebuggerObjectActionContext extends ActionContext {
|
||||
public class DebuggerObjectActionContext extends DefaultActionContext {
|
||||
private final List<TraceObjectValue> objectValues;
|
||||
|
||||
public DebuggerObjectActionContext(Collection<TraceObjectValue> objectValues,
|
||||
|
||||
+2
-2
@@ -17,10 +17,10 @@ package ghidra.app.plugin.core.debug.gui.modules;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import ghidra.trace.model.modules.TraceModule;
|
||||
|
||||
public class DebuggerMissingModuleActionContext extends ActionContext {
|
||||
public class DebuggerMissingModuleActionContext extends DefaultActionContext {
|
||||
private final TraceModule module;
|
||||
private final int hashCode;
|
||||
|
||||
|
||||
+2
-2
@@ -18,10 +18,10 @@ package ghidra.app.plugin.core.debug.gui.modules;
|
||||
import java.util.Collection;
|
||||
import java.util.Set;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import docking.widgets.table.GTable;
|
||||
|
||||
public class DebuggerModuleActionContext extends ActionContext {
|
||||
public class DebuggerModuleActionContext extends DefaultActionContext {
|
||||
private final Set<ModuleRow> selectedModules;
|
||||
|
||||
public DebuggerModuleActionContext(DebuggerModulesProvider provider,
|
||||
|
||||
+2
-2
@@ -18,10 +18,10 @@ package ghidra.app.plugin.core.debug.gui.modules;
|
||||
import java.util.Collection;
|
||||
import java.util.Set;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import docking.widgets.table.GTable;
|
||||
|
||||
public class DebuggerSectionActionContext extends ActionContext {
|
||||
public class DebuggerSectionActionContext extends DefaultActionContext {
|
||||
private final Set<SectionRow> selectedSections;
|
||||
//private final Set<ModuleRecord> involvedModules;
|
||||
|
||||
|
||||
+2
-2
@@ -18,10 +18,10 @@ package ghidra.app.plugin.core.debug.gui.modules;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import docking.widgets.table.GTable;
|
||||
|
||||
public class DebuggerStaticMappingActionContext extends ActionContext {
|
||||
public class DebuggerStaticMappingActionContext extends DefaultActionContext {
|
||||
private final Collection<StaticMappingRow> selected;
|
||||
|
||||
public DebuggerStaticMappingActionContext(DebuggerStaticMappingProvider provider,
|
||||
|
||||
+15
-104
@@ -20,14 +20,8 @@ import java.awt.Color;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.io.PrintWriter;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
@@ -40,12 +34,8 @@ import javax.swing.tree.TreePath;
|
||||
import org.apache.commons.collections4.map.LinkedMap;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.WindowPosition;
|
||||
import docking.action.DockingAction;
|
||||
import docking.action.DockingActionIf;
|
||||
import docking.action.MenuData;
|
||||
import docking.action.ToggleDockingAction;
|
||||
import docking.*;
|
||||
import docking.action.*;
|
||||
import docking.action.builder.ActionBuilder;
|
||||
import docking.action.builder.ToggleActionBuilder;
|
||||
import docking.widgets.OptionDialog;
|
||||
@@ -56,107 +46,30 @@ import generic.theme.GColor;
|
||||
import ghidra.app.plugin.core.debug.DebuggerCoordinates;
|
||||
import ghidra.app.plugin.core.debug.DebuggerPluginPackage;
|
||||
import ghidra.app.plugin.core.debug.gui.DebuggerResources;
|
||||
import ghidra.app.plugin.core.debug.gui.DebuggerResources.AbstractAttachAction;
|
||||
import ghidra.app.plugin.core.debug.gui.DebuggerResources.AbstractConsoleAction;
|
||||
import ghidra.app.plugin.core.debug.gui.DebuggerResources.AbstractDetachAction;
|
||||
import ghidra.app.plugin.core.debug.gui.DebuggerResources.AbstractInterruptAction;
|
||||
import ghidra.app.plugin.core.debug.gui.DebuggerResources.AbstractKillAction;
|
||||
import ghidra.app.plugin.core.debug.gui.DebuggerResources.AbstractLaunchAction;
|
||||
import ghidra.app.plugin.core.debug.gui.DebuggerResources.AbstractQuickLaunchAction;
|
||||
import ghidra.app.plugin.core.debug.gui.DebuggerResources.AbstractRecordAction;
|
||||
import ghidra.app.plugin.core.debug.gui.DebuggerResources.AbstractRefreshAction;
|
||||
import ghidra.app.plugin.core.debug.gui.DebuggerResources.AbstractResumeAction;
|
||||
import ghidra.app.plugin.core.debug.gui.DebuggerResources.AbstractSetBreakpointAction;
|
||||
import ghidra.app.plugin.core.debug.gui.DebuggerResources.AbstractStepFinishAction;
|
||||
import ghidra.app.plugin.core.debug.gui.DebuggerResources.AbstractStepIntoAction;
|
||||
import ghidra.app.plugin.core.debug.gui.DebuggerResources.AbstractStepLastAction;
|
||||
import ghidra.app.plugin.core.debug.gui.DebuggerResources.AbstractStepOverAction;
|
||||
import ghidra.app.plugin.core.debug.gui.DebuggerResources.AbstractToggleAction;
|
||||
import ghidra.app.plugin.core.debug.gui.objects.actions.DisplayAsGraphAction;
|
||||
import ghidra.app.plugin.core.debug.gui.objects.actions.DisplayAsTableAction;
|
||||
import ghidra.app.plugin.core.debug.gui.objects.actions.DisplayAsTreeAction;
|
||||
import ghidra.app.plugin.core.debug.gui.objects.actions.DisplayAsXMLAction;
|
||||
import ghidra.app.plugin.core.debug.gui.objects.actions.DisplayFilteredGraphAction;
|
||||
import ghidra.app.plugin.core.debug.gui.objects.actions.DisplayFilteredTableAction;
|
||||
import ghidra.app.plugin.core.debug.gui.objects.actions.DisplayFilteredTreeAction;
|
||||
import ghidra.app.plugin.core.debug.gui.objects.actions.DisplayFilteredXMLAction;
|
||||
import ghidra.app.plugin.core.debug.gui.objects.actions.DisplayMethodsAction;
|
||||
import ghidra.app.plugin.core.debug.gui.objects.actions.ExportAsFactsAction;
|
||||
import ghidra.app.plugin.core.debug.gui.objects.actions.ExportAsXMLAction;
|
||||
import ghidra.app.plugin.core.debug.gui.objects.actions.ImportFromFactsAction;
|
||||
import ghidra.app.plugin.core.debug.gui.objects.actions.ImportFromXMLAction;
|
||||
import ghidra.app.plugin.core.debug.gui.objects.actions.OpenWinDbgTraceAction;
|
||||
import ghidra.app.plugin.core.debug.gui.objects.actions.SetTimeoutAction;
|
||||
import ghidra.app.plugin.core.debug.gui.objects.components.DebuggerAttachDialog;
|
||||
import ghidra.app.plugin.core.debug.gui.objects.components.DebuggerBreakpointDialog;
|
||||
import ghidra.app.plugin.core.debug.gui.objects.components.DebuggerMethodInvocationDialog;
|
||||
import ghidra.app.plugin.core.debug.gui.objects.components.DummyTargetObject;
|
||||
import ghidra.app.plugin.core.debug.gui.objects.components.GenericDebuggerProgramLaunchOffer;
|
||||
import ghidra.app.plugin.core.debug.gui.objects.components.ObjectAttributeColumn;
|
||||
import ghidra.app.plugin.core.debug.gui.objects.components.ObjectAttributeRow;
|
||||
import ghidra.app.plugin.core.debug.gui.objects.components.ObjectElementColumn;
|
||||
import ghidra.app.plugin.core.debug.gui.objects.components.ObjectElementRow;
|
||||
import ghidra.app.plugin.core.debug.gui.objects.components.ObjectEnumeratedColumnTableModel;
|
||||
import ghidra.app.plugin.core.debug.gui.objects.components.ObjectNode;
|
||||
import ghidra.app.plugin.core.debug.gui.objects.components.ObjectPane;
|
||||
import ghidra.app.plugin.core.debug.gui.objects.components.ObjectTable;
|
||||
import ghidra.app.plugin.core.debug.gui.objects.components.ObjectTree;
|
||||
import ghidra.app.plugin.core.debug.gui.DebuggerResources.*;
|
||||
import ghidra.app.plugin.core.debug.gui.objects.actions.*;
|
||||
import ghidra.app.plugin.core.debug.gui.objects.components.*;
|
||||
import ghidra.app.plugin.core.debug.mapping.DebuggerMemoryMapper;
|
||||
import ghidra.app.script.GhidraScript;
|
||||
import ghidra.app.script.GhidraScriptLoadException;
|
||||
import ghidra.app.script.GhidraScriptProvider;
|
||||
import ghidra.app.script.GhidraScriptUtil;
|
||||
import ghidra.app.script.GhidraState;
|
||||
import ghidra.app.services.ConsoleService;
|
||||
import ghidra.app.services.DebuggerListingService;
|
||||
import ghidra.app.services.DebuggerModelService;
|
||||
import ghidra.app.services.DebuggerStaticMappingService;
|
||||
import ghidra.app.services.DebuggerTraceManagerService;
|
||||
import ghidra.app.script.*;
|
||||
import ghidra.app.services.*;
|
||||
import ghidra.app.services.DebuggerTraceManagerService.ActivationCause;
|
||||
import ghidra.app.services.GraphDisplayBroker;
|
||||
import ghidra.app.services.TraceRecorder;
|
||||
import ghidra.async.AsyncFence;
|
||||
import ghidra.async.AsyncUtils;
|
||||
import ghidra.async.TypeSpec;
|
||||
import ghidra.dbg.AnnotatedDebuggerAttributeListener;
|
||||
import ghidra.dbg.DebugModelConventions;
|
||||
import ghidra.dbg.DebuggerModelListener;
|
||||
import ghidra.dbg.DebuggerObjectModel;
|
||||
import ghidra.async.*;
|
||||
import ghidra.dbg.*;
|
||||
import ghidra.dbg.DebuggerObjectModel.RefreshBehavior;
|
||||
import ghidra.dbg.error.DebuggerMemoryAccessException;
|
||||
import ghidra.dbg.target.TargetAccessConditioned;
|
||||
import ghidra.dbg.target.TargetAttachable;
|
||||
import ghidra.dbg.target.TargetAttacher;
|
||||
import ghidra.dbg.target.TargetBreakpointSpec;
|
||||
import ghidra.dbg.target.TargetBreakpointSpecContainer;
|
||||
import ghidra.dbg.target.TargetConfigurable;
|
||||
import ghidra.dbg.target.*;
|
||||
import ghidra.dbg.target.TargetConsole.Channel;
|
||||
import ghidra.dbg.target.TargetDetachable;
|
||||
import ghidra.dbg.target.TargetExecutionStateful;
|
||||
import ghidra.dbg.target.TargetExecutionStateful.TargetExecutionState;
|
||||
import ghidra.dbg.target.TargetFocusScope;
|
||||
import ghidra.dbg.target.TargetInterpreter;
|
||||
import ghidra.dbg.target.TargetInterruptible;
|
||||
import ghidra.dbg.target.TargetKillable;
|
||||
import ghidra.dbg.target.TargetLauncher;
|
||||
import ghidra.dbg.target.TargetMethod;
|
||||
import ghidra.dbg.target.TargetMethod.ParameterDescription;
|
||||
import ghidra.dbg.target.TargetMethod.TargetParameterMap;
|
||||
import ghidra.dbg.target.TargetObject;
|
||||
import ghidra.dbg.target.TargetProcess;
|
||||
import ghidra.dbg.target.TargetResumable;
|
||||
import ghidra.dbg.target.TargetSteppable;
|
||||
import ghidra.dbg.target.TargetSteppable.TargetStepKind;
|
||||
import ghidra.dbg.target.TargetTogglable;
|
||||
import ghidra.dbg.util.DebuggerCallbackReorderer;
|
||||
import ghidra.dbg.util.PathUtils;
|
||||
import ghidra.framework.model.Project;
|
||||
import ghidra.framework.options.AutoOptions;
|
||||
import ghidra.framework.options.SaveState;
|
||||
import ghidra.framework.options.annotation.AutoOptionDefined;
|
||||
import ghidra.framework.plugintool.AutoConfigState;
|
||||
import ghidra.framework.plugintool.AutoService;
|
||||
import ghidra.framework.plugintool.ComponentProviderAdapter;
|
||||
import ghidra.framework.plugintool.*;
|
||||
import ghidra.framework.plugintool.annotation.AutoConfigStateField;
|
||||
import ghidra.framework.plugintool.annotation.AutoServiceConsumed;
|
||||
import ghidra.program.model.address.Address;
|
||||
@@ -166,9 +79,7 @@ import ghidra.program.util.ProgramLocation;
|
||||
import ghidra.program.util.ProgramSelection;
|
||||
import ghidra.trace.model.Trace;
|
||||
import ghidra.trace.model.thread.TraceThread;
|
||||
import ghidra.util.HelpLocation;
|
||||
import ghidra.util.Msg;
|
||||
import ghidra.util.Swing;
|
||||
import ghidra.util.*;
|
||||
import ghidra.util.datastruct.PrivatelyQueuedListener;
|
||||
import ghidra.util.table.GhidraTable;
|
||||
import ghidra.util.task.TaskMonitor;
|
||||
@@ -793,7 +704,7 @@ public class DebuggerObjectsProvider extends ComponentProviderAdapter
|
||||
plugin.fireObjectUpdated(object);
|
||||
}
|
||||
|
||||
class ObjectActionContext extends ActionContext {
|
||||
class ObjectActionContext extends DefaultActionContext {
|
||||
|
||||
private DebuggerObjectsProvider provider;
|
||||
|
||||
@@ -1766,7 +1677,7 @@ public class DebuggerObjectsProvider extends ComponentProviderAdapter
|
||||
TargetObject result = null;
|
||||
try {
|
||||
result = DebugModelConventions.findSuitable(TargetExecutionStateful.class, object)
|
||||
.get(100, TimeUnit.MILLISECONDS);
|
||||
.get(100, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
catch (Exception e) {
|
||||
// IGNORE
|
||||
|
||||
+2
-2
@@ -17,9 +17,9 @@ package ghidra.app.plugin.core.debug.gui.register;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
|
||||
public class DebuggerAvailableRegistersActionContext extends ActionContext {
|
||||
public class DebuggerAvailableRegistersActionContext extends DefaultActionContext {
|
||||
private final Collection<AvailableRegisterRow> selection;
|
||||
|
||||
public DebuggerAvailableRegistersActionContext(Collection<AvailableRegisterRow> selection) {
|
||||
|
||||
+2
-2
@@ -15,10 +15,10 @@
|
||||
*/
|
||||
package ghidra.app.plugin.core.debug.gui.register;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import docking.widgets.table.GTable;
|
||||
|
||||
public class DebuggerRegisterActionContext extends ActionContext {
|
||||
public class DebuggerRegisterActionContext extends DefaultActionContext {
|
||||
private final RegisterRow selected;
|
||||
|
||||
public DebuggerRegisterActionContext(DebuggerRegistersProvider provider, RegisterRow selected,
|
||||
|
||||
+2
-2
@@ -17,9 +17,9 @@ package ghidra.app.plugin.core.debug.gui.stack;
|
||||
|
||||
import java.awt.Component;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
|
||||
public class DebuggerStackActionContext extends ActionContext {
|
||||
public class DebuggerStackActionContext extends DefaultActionContext {
|
||||
|
||||
private final StackFrameRow frame;
|
||||
|
||||
|
||||
+2
-2
@@ -19,14 +19,14 @@ import java.util.function.Function;
|
||||
|
||||
import javax.swing.tree.TreePath;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.ComponentProvider;
|
||||
import docking.DefaultActionContext;
|
||||
import docking.widgets.tree.GTree;
|
||||
import docking.widgets.tree.GTreeNode;
|
||||
import ghidra.app.services.DebuggerModelService;
|
||||
import ghidra.dbg.DebuggerObjectModel;
|
||||
|
||||
public class DebuggerModelActionContext extends ActionContext {
|
||||
public class DebuggerModelActionContext extends DefaultActionContext {
|
||||
private final TreePath path;
|
||||
|
||||
DebuggerModelActionContext(ComponentProvider provider, TreePath path, GTree tree) {
|
||||
|
||||
+2
-2
@@ -15,11 +15,11 @@
|
||||
*/
|
||||
package ghidra.app.plugin.core.debug.gui.thread;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import ghidra.trace.model.Trace;
|
||||
import ghidra.trace.model.thread.TraceThread;
|
||||
|
||||
public class DebuggerThreadActionContext extends ActionContext {
|
||||
public class DebuggerThreadActionContext extends DefaultActionContext {
|
||||
private final Trace trace;
|
||||
private final TraceThread thread;
|
||||
|
||||
|
||||
+3
-3
@@ -15,16 +15,16 @@
|
||||
*/
|
||||
package ghidra.app.plugin.core.debug.gui.thread;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import ghidra.trace.model.Trace;
|
||||
|
||||
public class DebuggerTraceFileActionContext extends ActionContext {
|
||||
public class DebuggerTraceFileActionContext extends DefaultActionContext {
|
||||
private final Trace trace;
|
||||
|
||||
public DebuggerTraceFileActionContext(Trace trace) {
|
||||
this.trace = trace;
|
||||
}
|
||||
|
||||
|
||||
public Trace getTrace() {
|
||||
return trace;
|
||||
}
|
||||
|
||||
+2
-2
@@ -19,9 +19,9 @@ import java.awt.Component;
|
||||
import java.util.Collection;
|
||||
import java.util.Set;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
|
||||
public class DebuggerWatchActionContext extends ActionContext {
|
||||
public class DebuggerWatchActionContext extends DefaultActionContext {
|
||||
private final Set<WatchRow> sel;
|
||||
|
||||
public DebuggerWatchActionContext(DebuggerWatchesProvider provider,
|
||||
|
||||
+18
-17
@@ -15,12 +15,13 @@
|
||||
*/
|
||||
package ghidra.app.plugin.core.debug.gui.console;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import org.junit.*;
|
||||
import org.junit.rules.TestName;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import docking.action.builder.ActionBuilder;
|
||||
import ghidra.app.plugin.core.debug.gui.AbstractGhidraHeadedDebuggerGUITest;
|
||||
import ghidra.app.plugin.core.debug.gui.DebuggerResources;
|
||||
@@ -29,7 +30,7 @@ import help.screenshot.GhidraScreenShotGenerator;
|
||||
|
||||
public class DebuggerConsolePluginScreenShots extends GhidraScreenShotGenerator {
|
||||
|
||||
public static class ScreenShotActionContext extends ActionContext {
|
||||
public static class ScreenShotActionContext extends DefaultActionContext {
|
||||
}
|
||||
|
||||
DebuggerConsolePlugin consolePlugin;
|
||||
@@ -44,21 +45,21 @@ public class DebuggerConsolePluginScreenShots extends GhidraScreenShotGenerator
|
||||
consoleProvider = waitForComponentProvider(DebuggerConsoleProvider.class);
|
||||
|
||||
consolePlugin.addResolutionAction(new ActionBuilder("Import", name.getMethodName())
|
||||
.toolBarIcon(DebuggerResources.ICON_IMPORT)
|
||||
.popupMenuIcon(DebuggerResources.ICON_IMPORT)
|
||||
.popupMenuPath("Map")
|
||||
.description("Import")
|
||||
.withContext(ScreenShotActionContext.class)
|
||||
.onAction(ctx -> Msg.info(this, "Import clicked"))
|
||||
.build());
|
||||
.toolBarIcon(DebuggerResources.ICON_IMPORT)
|
||||
.popupMenuIcon(DebuggerResources.ICON_IMPORT)
|
||||
.popupMenuPath("Map")
|
||||
.description("Import")
|
||||
.withContext(ScreenShotActionContext.class)
|
||||
.onAction(ctx -> Msg.info(this, "Import clicked"))
|
||||
.build());
|
||||
consolePlugin.addResolutionAction(new ActionBuilder("Map", name.getMethodName())
|
||||
.toolBarIcon(DebuggerResources.ICON_MODULES)
|
||||
.popupMenuIcon(DebuggerResources.ICON_MODULES)
|
||||
.popupMenuPath("Map")
|
||||
.description("Map")
|
||||
.withContext(ScreenShotActionContext.class)
|
||||
.onAction(ctx -> Msg.info(this, "Map clicked"))
|
||||
.build());
|
||||
.toolBarIcon(DebuggerResources.ICON_MODULES)
|
||||
.popupMenuIcon(DebuggerResources.ICON_MODULES)
|
||||
.popupMenuPath("Map")
|
||||
.description("Map")
|
||||
.withContext(ScreenShotActionContext.class)
|
||||
.onAction(ctx -> Msg.info(this, "Map clicked"))
|
||||
.build());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -70,7 +71,7 @@ public class DebuggerConsolePluginScreenShots extends GhidraScreenShotGenerator
|
||||
new ScreenShotActionContext());
|
||||
|
||||
AbstractGhidraHeadedDebuggerGUITest
|
||||
.waitForPass(() -> assertEquals(3, consolePlugin.getRowCount(ActionContext.class)));
|
||||
.waitForPass(() -> assertEquals(3, consolePlugin.getRowCount(ActionContext.class)));
|
||||
|
||||
captureIsolatedProvider(consoleProvider, 600, 300);
|
||||
}
|
||||
|
||||
+10
-9
@@ -39,6 +39,7 @@ import org.junit.runner.Description;
|
||||
|
||||
import db.Transaction;
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import docking.action.ActionContextProvider;
|
||||
import docking.action.DockingActionIf;
|
||||
import docking.widgets.table.DynamicTableColumn;
|
||||
@@ -222,7 +223,7 @@ public abstract class AbstractGhidraHeadedDebuggerGUITest
|
||||
public static Language getToyBE64Language() {
|
||||
try {
|
||||
return DefaultLanguageService.getLanguageService()
|
||||
.getLanguage(new LanguageID(LANGID_TOYBE64));
|
||||
.getLanguage(new LanguageID(LANGID_TOYBE64));
|
||||
}
|
||||
catch (LanguageNotFoundException e) {
|
||||
throw new AssertionError("Why is the Toy language missing?", e);
|
||||
@@ -477,7 +478,7 @@ public abstract class AbstractGhidraHeadedDebuggerGUITest
|
||||
DockingActionIf action, boolean wait) {
|
||||
ActionContext context = waitForValue(() -> {
|
||||
ActionContext ctx = provider == null
|
||||
? new ActionContext()
|
||||
? new DefaultActionContext()
|
||||
: provider.getActionContext(null);
|
||||
if (!action.isEnabledForContext(ctx)) {
|
||||
return null;
|
||||
@@ -676,8 +677,8 @@ public abstract class AbstractGhidraHeadedDebuggerGUITest
|
||||
protected void intoProject(DomainObject obj) {
|
||||
waitForDomainObject(obj);
|
||||
DomainFolder rootFolder = tool.getProject()
|
||||
.getProjectData()
|
||||
.getRootFolder();
|
||||
.getProjectData()
|
||||
.getRootFolder();
|
||||
waitForCondition(() -> {
|
||||
try {
|
||||
rootFolder.createFile(obj.getName(), obj, monitor);
|
||||
@@ -818,8 +819,8 @@ public abstract class AbstractGhidraHeadedDebuggerGUITest
|
||||
// get() is not my favorite, but it'll do for testing
|
||||
// can't remove listener until observedTraceChange has completed.
|
||||
bank.writeRegistersNamed(values)
|
||||
.thenCompose(__ -> observedTraceChange)
|
||||
.get(timeoutMillis, TimeUnit.MILLISECONDS);
|
||||
.thenCompose(__ -> observedTraceChange)
|
||||
.get(timeoutMillis, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
finally {
|
||||
trace.removeListener(listener);
|
||||
@@ -835,8 +836,8 @@ public abstract class AbstractGhidraHeadedDebuggerGUITest
|
||||
|
||||
protected DomainFile unpack(File pack) throws Exception {
|
||||
return tool.getProject()
|
||||
.getProjectData()
|
||||
.getRootFolder()
|
||||
.createFile("Restored", pack, monitor);
|
||||
.getProjectData()
|
||||
.getRootFolder()
|
||||
.createFile("Restored", pack, monitor);
|
||||
}
|
||||
}
|
||||
|
||||
+14
-14
@@ -15,12 +15,12 @@
|
||||
*/
|
||||
package ghidra.app.plugin.core.debug.gui.console;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import docking.action.builder.ActionBuilder;
|
||||
import ghidra.app.plugin.core.debug.gui.AbstractGhidraHeadedDebuggerGUITest;
|
||||
import ghidra.app.plugin.core.debug.gui.DebuggerResources;
|
||||
@@ -36,25 +36,25 @@ public class DebuggerConsoleProviderTest extends AbstractGhidraHeadedDebuggerGUI
|
||||
consoleProvider = waitForComponentProvider(DebuggerConsoleProvider.class);
|
||||
}
|
||||
|
||||
public static class TestConsoleActionContext extends ActionContext {
|
||||
public static class TestConsoleActionContext extends DefaultActionContext {
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testActions() throws Exception {
|
||||
consolePlugin.addResolutionAction(new ActionBuilder("Add", name.getMethodName())
|
||||
.toolBarIcon(DebuggerResources.ICON_ADD)
|
||||
.description("Add")
|
||||
.withContext(TestConsoleActionContext.class)
|
||||
.onAction(ctx -> Msg.info(this, "Add clicked"))
|
||||
.build());
|
||||
.toolBarIcon(DebuggerResources.ICON_ADD)
|
||||
.description("Add")
|
||||
.withContext(TestConsoleActionContext.class)
|
||||
.onAction(ctx -> Msg.info(this, "Add clicked"))
|
||||
.build());
|
||||
consolePlugin.addResolutionAction(new ActionBuilder("Delete", name.getMethodName())
|
||||
.popupMenuIcon(DebuggerResources.ICON_DELETE)
|
||||
.popupMenuPath("Delete")
|
||||
.description("Delete")
|
||||
.withContext(TestConsoleActionContext.class)
|
||||
.onAction(ctx -> Msg.info(this, "Delete clicked"))
|
||||
.build());
|
||||
.popupMenuIcon(DebuggerResources.ICON_DELETE)
|
||||
.popupMenuPath("Delete")
|
||||
.description("Delete")
|
||||
.withContext(TestConsoleActionContext.class)
|
||||
.onAction(ctx -> Msg.info(this, "Delete clicked"))
|
||||
.build());
|
||||
|
||||
consolePlugin.log(DebuggerResources.ICON_DEBUGGER, "<html><b>Test message</b></html>",
|
||||
new TestConsoleActionContext());
|
||||
|
||||
+10
-11
@@ -205,17 +205,16 @@ public class RandomForestFunctionFinderPlugin extends ProgramPlugin
|
||||
private void createActions() {
|
||||
|
||||
new ActionBuilder(ACTION_NAME, getName())
|
||||
.menuPath(ToolConstants.MENU_SEARCH, MENU_PATH_ENTRY)
|
||||
.menuGroup("search for", null)
|
||||
.description("Train models to search for function starts")
|
||||
.helpLocation(new HelpLocation(getName(), getName()))
|
||||
.withContext(NavigatableActionContext.class)
|
||||
.validContextWhen(c -> !(c instanceof RestrictedAddressSetContext))
|
||||
.supportsDefaultToolContext(true)
|
||||
.onAction(c -> {
|
||||
displayDialog(c);
|
||||
})
|
||||
.buildAndInstall(tool);
|
||||
.menuPath(ToolConstants.MENU_SEARCH, MENU_PATH_ENTRY)
|
||||
.menuGroup("search for", null)
|
||||
.description("Train models to search for function starts")
|
||||
.helpLocation(new HelpLocation(getName(), getName()))
|
||||
.withContext(NavigatableActionContext.class, true)
|
||||
.validContextWhen(c -> !(c instanceof RestrictedAddressSetContext))
|
||||
.onAction(c -> {
|
||||
displayDialog(c);
|
||||
})
|
||||
.buildAndInstall(tool);
|
||||
}
|
||||
|
||||
private void displayDialog(NavigatableActionContext c) {
|
||||
|
||||
+2
-3
@@ -20,8 +20,7 @@ import java.awt.event.*;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.WindowPosition;
|
||||
import docking.*;
|
||||
import docking.action.*;
|
||||
import docking.widgets.EmptyBorderButton;
|
||||
import generic.theme.GIcon;
|
||||
@@ -132,7 +131,7 @@ public class HelloWorldComponentProvider extends ComponentProviderAdapter {
|
||||
if (event != null) {
|
||||
Object source = event.getSource();
|
||||
if (source == activeButtonObj) {
|
||||
return new ActionContext(this, activeButtonObj);
|
||||
return new DefaultActionContext(this, activeButtonObj);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -45,7 +45,7 @@ public abstract class NavigatableContextAction extends DockingAction {
|
||||
public NavigatableContextAction(String name, String owner,
|
||||
boolean supportsRestrictedAddressSetContext) {
|
||||
super(name, owner);
|
||||
setSupportsDefaultToolContext(true);
|
||||
setContextClass(NavigatableActionContext.class, true);
|
||||
this.supportsRestrictedAddressSetContext = supportsRestrictedAddressSetContext;
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ public abstract class NavigatableContextAction extends DockingAction {
|
||||
*/
|
||||
public NavigatableContextAction(String name, String owner, KeyBindingType type) {
|
||||
super(name, owner, type);
|
||||
setSupportsDefaultToolContext(true);
|
||||
setContextClass(NavigatableActionContext.class, true);
|
||||
this.supportsRestrictedAddressSetContext = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -18,11 +18,11 @@ package ghidra.app.context;
|
||||
import java.awt.Component;
|
||||
import java.awt.KeyboardFocusManager;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.ComponentProvider;
|
||||
import docking.DefaultActionContext;
|
||||
import ghidra.program.model.listing.Program;
|
||||
|
||||
public class ProgramActionContext extends ActionContext {
|
||||
public class ProgramActionContext extends DefaultActionContext {
|
||||
protected final Program program;
|
||||
|
||||
public ProgramActionContext(ComponentProvider provider, Program program) {
|
||||
|
||||
+23
-23
@@ -105,28 +105,28 @@ public class AutoAnalysisPlugin extends Plugin implements AutoAnalysisManagerLis
|
||||
// they are inserted
|
||||
int subGroupIndex = 0;
|
||||
|
||||
//@formatter:off
|
||||
autoAnalyzeAction =
|
||||
new ActionBuilder("Auto Analyze", getName())
|
||||
.supportsDefaultToolContext(true)
|
||||
.menuPath("&Analysis", "&Auto Analyze...")
|
||||
.menuGroup(ANALYZE_GROUP_NAME, "" + subGroupIndex++)
|
||||
.keyBinding("A")
|
||||
.validContextWhen(ac -> {
|
||||
updateActionName(ac);
|
||||
return ac instanceof ListingActionContext;
|
||||
})
|
||||
.onAction(this::analyzeCallback)
|
||||
.buildAndInstall(tool);
|
||||
autoAnalyzeAction = new ActionBuilder("Auto Analyze", getName())
|
||||
.menuPath("&Analysis", "&Auto Analyze...")
|
||||
.menuGroup(ANALYZE_GROUP_NAME, "" + subGroupIndex++)
|
||||
.keyBinding("A")
|
||||
.withContext(ListingActionContext.class, true)
|
||||
.onAction(this::analyzeCallback)
|
||||
.buildAndInstall(tool);
|
||||
|
||||
// we need to specially override the validContextWhen so that as a side effect, we
|
||||
// can change the action name to not include a program name when the action is
|
||||
// actually invalid.
|
||||
autoAnalyzeAction.validContextWhen(ac -> {
|
||||
updateActionName(ac);
|
||||
return ac instanceof ListingActionContext;
|
||||
});
|
||||
|
||||
new ActionBuilder("Analyze All Open", getName())
|
||||
.supportsDefaultToolContext(true)
|
||||
.menuPath("&Analysis", "Analyze All &Open...")
|
||||
.menuGroup(ANALYZE_GROUP_NAME, "" + subGroupIndex++)
|
||||
.onAction(c -> analyzeAllCallback())
|
||||
.validContextWhen(ac -> ac instanceof ListingActionContext)
|
||||
.buildAndInstall(tool);
|
||||
//@formatter:on
|
||||
.menuPath("&Analysis", "Analyze All &Open...")
|
||||
.menuGroup(ANALYZE_GROUP_NAME, "" + subGroupIndex++)
|
||||
.withContext(ListingActionContext.class, true)
|
||||
.onAction(c -> analyzeAllCallback())
|
||||
.buildAndInstall(tool);
|
||||
|
||||
tool.setMenuGroup(new String[] { "Analysis", "One Shot" }, ANALYZE_GROUP_NAME);
|
||||
|
||||
@@ -263,8 +263,8 @@ public class AutoAnalysisPlugin extends Plugin implements AutoAnalysisManagerLis
|
||||
|
||||
private void programActivated(Program program) {
|
||||
program.getOptions(StoredAnalyzerTimes.OPTIONS_LIST)
|
||||
.registerOption(StoredAnalyzerTimes.OPTION_NAME, OptionType.CUSTOM_TYPE, null, null,
|
||||
"Cumulative analysis task times", new StoredAnalyzerTimesPropertyEditor());
|
||||
.registerOption(StoredAnalyzerTimes.OPTION_NAME, OptionType.CUSTOM_TYPE, null, null,
|
||||
"Cumulative analysis task times", new StoredAnalyzerTimesPropertyEditor());
|
||||
|
||||
}
|
||||
|
||||
@@ -326,7 +326,7 @@ public class AutoAnalysisPlugin extends Plugin implements AutoAnalysisManagerLis
|
||||
null, ANALYZE_GROUP_NAME));
|
||||
setHelpLocation(new HelpLocation("AutoAnalysisPlugin", "Auto_Analyzers"));
|
||||
|
||||
setSupportsDefaultToolContext(true);
|
||||
setContextClass(ListingActionContext.class, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+13
-13
@@ -25,6 +25,7 @@ import docking.action.MenuData;
|
||||
import docking.action.builder.ActionBuilder;
|
||||
import docking.tool.ToolConstants;
|
||||
import ghidra.app.CorePluginPackage;
|
||||
import ghidra.app.context.ListingActionContext;
|
||||
import ghidra.app.context.NavigatableActionContext;
|
||||
import ghidra.app.events.ProgramClosedPluginEvent;
|
||||
import ghidra.app.events.ProgramSelectionPluginEvent;
|
||||
@@ -98,16 +99,15 @@ public class FindPossibleReferencesPlugin extends Plugin {
|
||||
|
||||
private void createActions() {
|
||||
action = new ActionBuilder(SEARCH_DIRECT_REFS_ACTION_NAME, getName())
|
||||
.menuPath(ToolConstants.MENU_SEARCH, "For Direct References")
|
||||
.menuGroup("search for")
|
||||
.supportsDefaultToolContext(true)
|
||||
.helpLocation(new HelpLocation(HelpTopics.SEARCH, SEARCH_DIRECT_REFS_ACTION_NAME))
|
||||
.description(getPluginDescription().getDescription())
|
||||
.withContext(NavigatableActionContext.class)
|
||||
.inWindow(ActionBuilder.When.CONTEXT_MATCHES)
|
||||
.onAction(this::findReferences)
|
||||
.enabledWhen(this::hasCorrectAddressSize)
|
||||
.buildAndInstall(tool);
|
||||
.menuPath(ToolConstants.MENU_SEARCH, "For Direct References")
|
||||
.menuGroup("search for")
|
||||
.helpLocation(new HelpLocation(HelpTopics.SEARCH, SEARCH_DIRECT_REFS_ACTION_NAME))
|
||||
.description(getPluginDescription().getDescription())
|
||||
.withContext(ListingActionContext.class, true)
|
||||
.inWindow(ActionBuilder.When.CONTEXT_MATCHES)
|
||||
.onAction(this::findReferences)
|
||||
.enabledWhen(this::hasCorrectAddressSize)
|
||||
.buildAndInstall(tool);
|
||||
|
||||
}
|
||||
|
||||
@@ -194,9 +194,9 @@ public class FindPossibleReferencesPlugin extends Plugin {
|
||||
return;
|
||||
}
|
||||
if (currentProgram.getMemory()
|
||||
.getBlock(
|
||||
fromAddr)
|
||||
.getType() == MemoryBlockType.BIT_MAPPED) {
|
||||
.getBlock(
|
||||
fromAddr)
|
||||
.getType() == MemoryBlockType.BIT_MAPPED) {
|
||||
Msg.showWarn(getClass(), null, "Search For Direct References",
|
||||
"Cannot search for direct references on bit memory!");
|
||||
return;
|
||||
|
||||
+10
-11
@@ -23,8 +23,7 @@ import java.util.concurrent.atomic.AtomicInteger;
|
||||
import javax.swing.*;
|
||||
import javax.swing.tree.TreePath;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.WindowPosition;
|
||||
import docking.*;
|
||||
import docking.action.*;
|
||||
import docking.resources.icons.NumberIcon;
|
||||
import docking.widgets.dialogs.NumberInputDialog;
|
||||
@@ -352,7 +351,7 @@ public class CallTreeProvider extends ComponentProviderAdapter implements Domain
|
||||
}
|
||||
};
|
||||
goToSourceAction
|
||||
.setPopupMenuData(new MenuData(new String[] { "Go To Call Source" }, goToMenu));
|
||||
.setPopupMenuData(new MenuData(new String[] { "Go To Call Source" }, goToMenu));
|
||||
goToSourceAction.setHelpLocation(
|
||||
new HelpLocation(plugin.getName(), "Call_Tree_Context_Action_Goto_Source"));
|
||||
tool.addLocalAction(this, goToSourceAction);
|
||||
@@ -367,11 +366,11 @@ public class CallTreeProvider extends ComponentProviderAdapter implements Domain
|
||||
}
|
||||
};
|
||||
filterDuplicates
|
||||
.setToolBarData(new ToolBarData(new GIcon("icon.plugin.calltree.filter.duplicates"),
|
||||
filterOptionsToolbarGroup, "1"));
|
||||
.setToolBarData(new ToolBarData(new GIcon("icon.plugin.calltree.filter.duplicates"),
|
||||
filterOptionsToolbarGroup, "1"));
|
||||
filterDuplicates.setSelected(true);
|
||||
filterDuplicates
|
||||
.setHelpLocation(new HelpLocation(plugin.getName(), "Call_Tree_Action_Filter"));
|
||||
.setHelpLocation(new HelpLocation(plugin.getName(), "Call_Tree_Action_Filter"));
|
||||
tool.addLocalAction(this, filterDuplicates);
|
||||
|
||||
//
|
||||
@@ -395,7 +394,7 @@ public class CallTreeProvider extends ComponentProviderAdapter implements Domain
|
||||
"<br> will go. Example operations include <b>Expand All</b> and filtering");
|
||||
recurseIcon = new NumberIcon(recurseDepth.get());
|
||||
recurseDepthAction
|
||||
.setToolBarData(new ToolBarData(recurseIcon, filterOptionsToolbarGroup, "2"));
|
||||
.setToolBarData(new ToolBarData(recurseIcon, filterOptionsToolbarGroup, "2"));
|
||||
recurseDepthAction.setHelpLocation(
|
||||
new HelpLocation(plugin.getName(), "Call_Tree_Action_Recurse_Depth"));
|
||||
|
||||
@@ -416,7 +415,7 @@ public class CallTreeProvider extends ComponentProviderAdapter implements Domain
|
||||
navigationOutgoingAction.setToolBarData(new ToolBarData(
|
||||
Icons.NAVIGATE_ON_OUTGOING_EVENT_ICON, navigationOptionsToolbarGroup, "1"));
|
||||
navigationOutgoingAction
|
||||
.setHelpLocation(new HelpLocation(plugin.getName(), "Call_Tree_Action_Navigation"));
|
||||
.setHelpLocation(new HelpLocation(plugin.getName(), "Call_Tree_Action_Navigation"));
|
||||
tool.addLocalAction(this, navigationOutgoingAction);
|
||||
|
||||
//
|
||||
@@ -597,7 +596,7 @@ public class CallTreeProvider extends ComponentProviderAdapter implements Domain
|
||||
refreshAction.setDescription("<html>Push at any time to refresh the current trees.<br>" +
|
||||
"This is highlighted when the data <i>may</i> be stale.<br>");
|
||||
refreshAction
|
||||
.setHelpLocation(new HelpLocation(plugin.getName(), "Call_Tree_Action_Refresh"));
|
||||
.setHelpLocation(new HelpLocation(plugin.getName(), "Call_Tree_Action_Refresh"));
|
||||
tool.addLocalAction(this, refreshAction);
|
||||
|
||||
//
|
||||
@@ -712,7 +711,7 @@ public class CallTreeProvider extends ComponentProviderAdapter implements Domain
|
||||
@Override
|
||||
public ActionContext getActionContext(MouseEvent e) {
|
||||
if (e == null) {
|
||||
return new ActionContext(this, getActiveComponent());
|
||||
return new DefaultActionContext(this, getActiveComponent());
|
||||
}
|
||||
|
||||
Object source = e.getSource();
|
||||
@@ -722,7 +721,7 @@ public class CallTreeProvider extends ComponentProviderAdapter implements Domain
|
||||
if (outgoingTree.isMyJTree(jTree)) {
|
||||
gTree = outgoingTree;
|
||||
}
|
||||
return new ActionContext(this, gTree);
|
||||
return new DefaultActionContext(this, gTree);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
+1
-2
@@ -114,7 +114,6 @@ public abstract class AbstractCodeBrowserPlugin<P extends CodeViewerProvider> ex
|
||||
initMiscellaneousOptions();
|
||||
displayOptions.addOptionsChangeListener(this);
|
||||
fieldOptions.addOptionsChangeListener(this);
|
||||
tool.setDefaultComponent(connectedProvider);
|
||||
markerChangeListener = new MarkerChangeListener(connectedProvider);
|
||||
}
|
||||
|
||||
@@ -775,7 +774,7 @@ public abstract class AbstractCodeBrowserPlugin<P extends CodeViewerProvider> ex
|
||||
public boolean goTo(ProgramLocation location, boolean centerOnScreen) {
|
||||
|
||||
return Swing
|
||||
.runNow(() -> connectedProvider.getListingPanel().goTo(location, centerOnScreen));
|
||||
.runNow(() -> connectedProvider.getListingPanel().goTo(location, centerOnScreen));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+22
@@ -23,6 +23,7 @@ import docking.widgets.fieldpanel.FieldPanel;
|
||||
import docking.widgets.fieldpanel.support.FieldSelection;
|
||||
import docking.widgets.fieldpanel.support.ViewerPosition;
|
||||
import ghidra.app.CorePluginPackage;
|
||||
import ghidra.app.context.*;
|
||||
import ghidra.app.events.*;
|
||||
import ghidra.app.plugin.PluginCategoryNames;
|
||||
import ghidra.app.services.*;
|
||||
@@ -37,6 +38,7 @@ import ghidra.program.model.listing.Program;
|
||||
import ghidra.program.util.ProgramLocation;
|
||||
import ghidra.program.util.ProgramSelection;
|
||||
|
||||
//@formatter:off
|
||||
@PluginInfo(
|
||||
status = PluginStatus.RELEASED,
|
||||
packageName = CorePluginPackage.NAME,
|
||||
@@ -59,6 +61,7 @@ import ghidra.program.util.ProgramSelection;
|
||||
ProgramClosedPluginEvent.class, ProgramLocationPluginEvent.class,
|
||||
ViewChangedPluginEvent.class, ProgramHighlightPluginEvent.class },
|
||||
eventsProduced = { ProgramLocationPluginEvent.class, ProgramSelectionPluginEvent.class })
|
||||
//@formatter:on
|
||||
public class CodeBrowserPlugin extends AbstractCodeBrowserPlugin<CodeViewerProvider> {
|
||||
|
||||
public CodeBrowserPlugin(PluginTool tool) {
|
||||
@@ -66,6 +69,25 @@ public class CodeBrowserPlugin extends AbstractCodeBrowserPlugin<CodeViewerProvi
|
||||
|
||||
registerServiceProvided(FieldMouseHandlerService.class,
|
||||
connectedProvider.getFieldNavigator());
|
||||
|
||||
// sets the primary code viewer window as the default component to get focus
|
||||
tool.setDefaultComponent(connectedProvider);
|
||||
|
||||
// sets the primary code viewer window as the default context provider for actions
|
||||
// that use the specified context types.
|
||||
tool.registerDefaultContextProvider(ProgramActionContext.class, connectedProvider);
|
||||
tool.registerDefaultContextProvider(NavigatableActionContext.class, connectedProvider);
|
||||
tool.registerDefaultContextProvider(CodeViewerActionContext.class, connectedProvider);
|
||||
tool.registerDefaultContextProvider(ListingActionContext.class, connectedProvider);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void dispose() {
|
||||
tool.unregisterDefaultContextProvider(ProgramActionContext.class, connectedProvider);
|
||||
tool.unregisterDefaultContextProvider(NavigatableActionContext.class, connectedProvider);
|
||||
tool.unregisterDefaultContextProvider(CodeViewerActionContext.class, connectedProvider);
|
||||
tool.unregisterDefaultContextProvider(ListingActionContext.class, connectedProvider);
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+30
-34
@@ -65,48 +65,44 @@ public class CodeBrowserSelectionPlugin extends Plugin {
|
||||
|
||||
private void createActions() {
|
||||
new ActionBuilder("Select All", getName())
|
||||
.menuPath(ToolConstants.MENU_SELECTION, "&All in View")
|
||||
.menuGroup(SELECT_GROUP, "a")
|
||||
.keyBinding("ctrl A")
|
||||
.supportsDefaultToolContext(true)
|
||||
.helpLocation(new HelpLocation(HelpTopics.SELECTION, "Select All"))
|
||||
.withContext(CodeViewerActionContext.class)
|
||||
.inWindow(ActionBuilder.When.CONTEXT_MATCHES)
|
||||
.onAction(c -> ((CodeViewerProvider) c.getComponentProvider()).selectAll())
|
||||
.buildAndInstall(tool);
|
||||
.menuPath(ToolConstants.MENU_SELECTION, "&All in View")
|
||||
.menuGroup(SELECT_GROUP, "a")
|
||||
.keyBinding("ctrl A")
|
||||
.helpLocation(new HelpLocation(HelpTopics.SELECTION, "Select All"))
|
||||
.withContext(CodeViewerActionContext.class, true)
|
||||
.inWindow(ActionBuilder.When.CONTEXT_MATCHES)
|
||||
.onAction(c -> ((CodeViewerProvider) c.getComponentProvider()).selectAll())
|
||||
.buildAndInstall(tool);
|
||||
|
||||
new ActionBuilder("Clear Selection", getName())
|
||||
.menuPath(ToolConstants.MENU_SELECTION, "&Clear Selection")
|
||||
.menuGroup(SELECT_GROUP, "b")
|
||||
.supportsDefaultToolContext(true)
|
||||
.helpLocation(new HelpLocation(HelpTopics.SELECTION, "Clear Selection"))
|
||||
.withContext(CodeViewerActionContext.class)
|
||||
.inWindow(ActionBuilder.When.CONTEXT_MATCHES)
|
||||
.onAction(c -> ((CodeViewerProvider) c.getComponentProvider())
|
||||
.setSelection(new ProgramSelection()))
|
||||
.buildAndInstall(tool);
|
||||
.menuPath(ToolConstants.MENU_SELECTION, "&Clear Selection")
|
||||
.menuGroup(SELECT_GROUP, "b")
|
||||
.helpLocation(new HelpLocation(HelpTopics.SELECTION, "Clear Selection"))
|
||||
.withContext(CodeViewerActionContext.class, true)
|
||||
.inWindow(ActionBuilder.When.CONTEXT_MATCHES)
|
||||
.onAction(c -> ((CodeViewerProvider) c.getComponentProvider())
|
||||
.setSelection(new ProgramSelection()))
|
||||
.buildAndInstall(tool);
|
||||
|
||||
new ActionBuilder("Select Complement", getName())
|
||||
.menuPath(ToolConstants.MENU_SELECTION, "&Complement")
|
||||
.menuGroup(SELECT_GROUP, "c")
|
||||
.supportsDefaultToolContext(true)
|
||||
.helpLocation(new HelpLocation(HelpTopics.SELECTION, "Select Complement"))
|
||||
.withContext(CodeViewerActionContext.class)
|
||||
.inWindow(ActionBuilder.When.CONTEXT_MATCHES)
|
||||
.onAction(c -> ((CodeViewerProvider) c.getComponentProvider()).selectComplement())
|
||||
.buildAndInstall(tool);
|
||||
.menuPath(ToolConstants.MENU_SELECTION, "&Complement")
|
||||
.menuGroup(SELECT_GROUP, "c")
|
||||
.helpLocation(new HelpLocation(HelpTopics.SELECTION, "Select Complement"))
|
||||
.withContext(CodeViewerActionContext.class, true)
|
||||
.inWindow(ActionBuilder.When.CONTEXT_MATCHES)
|
||||
.onAction(c -> ((CodeViewerProvider) c.getComponentProvider()).selectComplement())
|
||||
.buildAndInstall(tool);
|
||||
|
||||
tool.addAction(new MarkAndSelectionAction(getName(), SELECT_GROUP, "d"));
|
||||
|
||||
new ActionBuilder("Create Table From Selection", getName())
|
||||
.menuPath(ToolConstants.MENU_SELECTION, "Create Table From Selection")
|
||||
.menuGroup("SelectUtils")
|
||||
.helpLocation(new HelpLocation("CodeBrowserPlugin", "Selection_Table"))
|
||||
.supportsDefaultToolContext(true)
|
||||
.withContext(CodeViewerActionContext.class)
|
||||
.inWindow(ActionBuilder.When.CONTEXT_MATCHES)
|
||||
.onAction(c -> createTable((CodeViewerProvider) c.getComponentProvider()))
|
||||
.buildAndInstall(tool);
|
||||
.menuPath(ToolConstants.MENU_SELECTION, "Create Table From Selection")
|
||||
.menuGroup("SelectUtils")
|
||||
.helpLocation(new HelpLocation("CodeBrowserPlugin", "Selection_Table"))
|
||||
.withContext(CodeViewerActionContext.class, true)
|
||||
.inWindow(ActionBuilder.When.CONTEXT_MATCHES)
|
||||
.onAction(c -> createTable((CodeViewerProvider) c.getComponentProvider()))
|
||||
.buildAndInstall(tool);
|
||||
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -53,7 +53,7 @@ public class MarkAndSelectionAction extends ToggleDockingAction {
|
||||
new ToolBarData(unarmedIcon, ToolConstants.TOOLBAR_GROUP_THREE, "Z"));
|
||||
|
||||
setHelpLocation((new HelpLocation(HelpTopics.SELECTION, "Mark_And_Select")));
|
||||
setSupportsDefaultToolContext(true);
|
||||
setContextClass(NavigatableActionContext.class, true);
|
||||
addToWindowWhen(NavigatableActionContext.class);
|
||||
|
||||
}
|
||||
|
||||
+2
-2
@@ -15,13 +15,13 @@
|
||||
*/
|
||||
package ghidra.app.plugin.core.commentwindow;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import ghidra.util.table.GhidraTable;
|
||||
|
||||
/*
|
||||
* This the action context for actions invoked from the Comment Window
|
||||
*/
|
||||
public class CommentWindowContext extends ActionContext {
|
||||
public class CommentWindowContext extends DefaultActionContext {
|
||||
|
||||
CommentWindowContext(CommentWindowProvider provider, GhidraTable commentTable) {
|
||||
super(provider, commentTable);
|
||||
|
||||
+2
-1
@@ -26,6 +26,7 @@ import javax.swing.plaf.UIResource;
|
||||
import com.google.common.base.Predicate;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import docking.widgets.DropDownSelectionTextField;
|
||||
import docking.widgets.OptionDialog;
|
||||
import docking.widgets.button.GButton;
|
||||
@@ -757,7 +758,7 @@ public class BitFieldEditorPanel extends JPanel {
|
||||
return null;
|
||||
}
|
||||
|
||||
class BitFieldEditorContext extends ActionContext {
|
||||
class BitFieldEditorContext extends DefaultActionContext {
|
||||
|
||||
private int selectedBitOffset;
|
||||
private DataTypeComponent selectedDtc;
|
||||
|
||||
+2
-2
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
package ghidra.app.plugin.core.compositeeditor;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import ghidra.program.model.data.*;
|
||||
|
||||
/**
|
||||
@@ -23,7 +23,7 @@ import ghidra.program.model.data.*;
|
||||
* composite with a single selected component, and the composite is associated with a
|
||||
* stand-alone archive.
|
||||
*/
|
||||
public class ComponentStandAloneActionContext extends ActionContext
|
||||
public class ComponentStandAloneActionContext extends DefaultActionContext
|
||||
implements ComponentContext {
|
||||
|
||||
private DataTypeComponent component;
|
||||
|
||||
+2
-3
@@ -19,8 +19,7 @@ import java.awt.event.MouseEvent;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.ComponentProvider;
|
||||
import docking.*;
|
||||
import docking.widgets.OptionDialog;
|
||||
import generic.theme.GIcon;
|
||||
import ghidra.app.context.ProgramActionContext;
|
||||
@@ -189,7 +188,7 @@ public abstract class CompositeEditorProvider extends ComponentProviderAdapter
|
||||
else if (componentAt != null && (originalDTM instanceof StandAloneDataTypeManager)) {
|
||||
return new ComponentStandAloneActionContext(this, componentAt);
|
||||
}
|
||||
return new ActionContext(this, null);
|
||||
return new DefaultActionContext(this, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+4
-5
@@ -26,8 +26,7 @@ import javax.swing.event.*;
|
||||
import javax.swing.event.HyperlinkEvent.EventType;
|
||||
import javax.swing.tree.TreePath;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DockingWindowManager;
|
||||
import docking.*;
|
||||
import docking.action.DockingAction;
|
||||
import docking.action.ToggleDockingAction;
|
||||
import docking.event.mouse.GMouseListenerAdapter;
|
||||
@@ -348,7 +347,7 @@ public class DataTypesProvider extends ComponentProviderAdapter {
|
||||
Object source = event.getSource();
|
||||
if (source instanceof JTextField || source instanceof JTextPane) {
|
||||
Component component = (Component) source;
|
||||
return new ActionContext(this, source, component);
|
||||
return new DefaultActionContext(this, source, component);
|
||||
}
|
||||
|
||||
Point point = event.getPoint();
|
||||
@@ -493,8 +492,8 @@ public class DataTypesProvider extends ComponentProviderAdapter {
|
||||
previewScrollPane = new JScrollPane(previewPane);
|
||||
|
||||
DockingWindowManager.getHelpService()
|
||||
.registerHelp(previewScrollPane,
|
||||
new HelpLocation("DataTypeManagerPlugin", "Preview_Window"));
|
||||
.registerHelp(previewScrollPane,
|
||||
new HelpLocation("DataTypeManagerPlugin", "Preview_Window"));
|
||||
}
|
||||
|
||||
private DataType locateDataType(HyperlinkEvent event) {
|
||||
|
||||
+2
-3
@@ -27,8 +27,7 @@ import javax.swing.table.TableCellEditor;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.ComponentProvider;
|
||||
import docking.*;
|
||||
import docking.action.*;
|
||||
import docking.action.builder.ToggleActionBuilder;
|
||||
import docking.widgets.OptionDialog;
|
||||
@@ -152,7 +151,7 @@ public class EnumEditorProvider extends ComponentProviderAdapter
|
||||
|
||||
@Override
|
||||
public ActionContext getActionContext(MouseEvent event) {
|
||||
return new ActionContext(this, editorPanel.getTable());
|
||||
return new DefaultActionContext(this, editorPanel.getTable());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+9
-10
@@ -1,6 +1,5 @@
|
||||
/* ###
|
||||
* IP: GHIDRA
|
||||
* REVIEWED: YES
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -16,16 +15,16 @@
|
||||
*/
|
||||
package ghidra.app.plugin.core.datawindow;
|
||||
|
||||
import docking.DefaultActionContext;
|
||||
import ghidra.util.table.GhidraTable;
|
||||
import docking.ActionContext;
|
||||
|
||||
public class DataWindowContext extends ActionContext {
|
||||
public class DataWindowContext extends DefaultActionContext {
|
||||
|
||||
DataWindowContext( DataWindowProvider provider, GhidraTable dataTable ) {
|
||||
super( provider, dataTable );
|
||||
}
|
||||
|
||||
GhidraTable getDataTable() {
|
||||
return (GhidraTable) getContextObject();
|
||||
}
|
||||
DataWindowContext(DataWindowProvider provider, GhidraTable dataTable) {
|
||||
super(provider, dataTable);
|
||||
}
|
||||
|
||||
GhidraTable getDataTable() {
|
||||
return (GhidraTable) getContextObject();
|
||||
}
|
||||
}
|
||||
|
||||
+2
-3
@@ -26,8 +26,7 @@ import javax.swing.event.DocumentListener;
|
||||
import javax.swing.text.Document;
|
||||
import javax.swing.undo.UndoableEdit;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.ComponentProvider;
|
||||
import docking.*;
|
||||
import docking.action.*;
|
||||
import docking.actions.KeyBindingUtils;
|
||||
import docking.options.editor.FontEditor;
|
||||
@@ -256,7 +255,7 @@ public class TextEditorComponentProvider extends ComponentProviderAdapter {
|
||||
|
||||
ActionContextProvider acp = e -> {
|
||||
ComponentProvider p = TextEditorComponentProvider.this;
|
||||
return new ActionContext(p);
|
||||
return new DefaultActionContext(p);
|
||||
};
|
||||
|
||||
KeyBindingUtils.registerAction(textarea, saveAction, acp);
|
||||
|
||||
+2
-1
@@ -25,6 +25,7 @@ import javax.swing.*;
|
||||
import javax.swing.table.*;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import generic.theme.GIcon;
|
||||
import ghidra.app.services.GoToService;
|
||||
import ghidra.framework.plugintool.ComponentProviderAdapter;
|
||||
@@ -77,7 +78,7 @@ public class FunctionWindowProvider extends ComponentProviderAdapter {
|
||||
|
||||
@Override
|
||||
public ActionContext getActionContext(MouseEvent event) {
|
||||
return new ActionContext(this, functionTable);
|
||||
return new DefaultActionContext(this, functionTable);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+2
-1
@@ -116,7 +116,8 @@ public class AboutProgramPlugin extends Plugin implements ApplicationLevelPlugin
|
||||
}
|
||||
};
|
||||
aboutAction.addToWindowWhen(ProgramActionContext.class);
|
||||
aboutAction.setSupportsDefaultToolContext(true);
|
||||
// use the CodeBrowser as a backup context provider
|
||||
aboutAction.setContextClass(ProgramActionContext.class, true);
|
||||
|
||||
aboutAction.setMenuBarData(
|
||||
new MenuData(new String[] { ToolConstants.MENU_HELP, ACTION_NAME }, null, "ZZZ"));
|
||||
|
||||
-2
@@ -53,8 +53,6 @@ public abstract class AbstractNextPreviousAction extends NavigatableContextActio
|
||||
public AbstractNextPreviousAction(PluginTool tool, String name, String owner, String subGroup) {
|
||||
super(name, owner);
|
||||
this.tool = tool;
|
||||
setSupportsDefaultToolContext(true);
|
||||
|
||||
ToolBarData toolBarData =
|
||||
new ToolBarData(getIcon(), ToolConstants.TOOLBAR_GROUP_FOUR);
|
||||
toolBarData.setToolBarSubGroup(subGroup);
|
||||
|
||||
+1
-2
@@ -66,8 +66,7 @@ public class NextPreviousBookmarkAction extends MultiStateDockingAction<String>
|
||||
public NextPreviousBookmarkAction(PluginTool tool, String owner, String subGroup) {
|
||||
super("Next Bookmark", owner);
|
||||
this.tool = tool;
|
||||
|
||||
setSupportsDefaultToolContext(true);
|
||||
setContextClass(NavigatableActionContext.class, true);
|
||||
|
||||
ToolBarData toolBarData =
|
||||
new ToolBarData(BOOKMARK_ICON, ToolConstants.TOOLBAR_GROUP_FOUR);
|
||||
|
||||
+2
-1
@@ -23,6 +23,7 @@ import javax.swing.*;
|
||||
import javax.swing.event.ChangeListener;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import docking.action.*;
|
||||
import docking.widgets.table.GTable;
|
||||
import generic.theme.GIcon;
|
||||
@@ -402,7 +403,7 @@ public class LocationReferencesProvider extends ComponentProviderAdapter
|
||||
|
||||
@Override
|
||||
public ActionContext getActionContext(MouseEvent event) {
|
||||
return new ActionContext(this, referencesPanel.getTable());
|
||||
return new DefaultActionContext(this, referencesPanel.getTable());
|
||||
}
|
||||
|
||||
//==================================================================================================
|
||||
|
||||
+2
-1
@@ -23,6 +23,7 @@ import javax.swing.JComponent;
|
||||
import javax.swing.event.ChangeEvent;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import docking.action.DockingAction;
|
||||
import ghidra.app.events.ViewChangedPluginEvent;
|
||||
import ghidra.app.services.GoToService;
|
||||
@@ -102,7 +103,7 @@ class TreeViewProvider implements ViewProviderService {
|
||||
|
||||
@Override
|
||||
public ActionContext getActionContext(MouseEvent event) {
|
||||
return new ActionContext().setContextObject(getActivePopupObject(event));
|
||||
return new DefaultActionContext().setContextObject(getActivePopupObject(event));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+27
-26
@@ -24,6 +24,7 @@ import javax.swing.*;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import docking.ActionContext;
|
||||
import docking.DefaultActionContext;
|
||||
import docking.action.builder.ActionBuilder;
|
||||
import docking.widgets.dialogs.InputDialog;
|
||||
import docking.widgets.table.AbstractSortedTableModel;
|
||||
@@ -83,36 +84,36 @@ public class ExternalReferencesProvider extends ComponentProviderAdapter {
|
||||
|
||||
private void createActions() {
|
||||
new ActionBuilder("Add External Program Name", getOwner())
|
||||
.popupMenuPath("Add External Program")
|
||||
.popupMenuIcon(ADD_ICON)
|
||||
.toolBarIcon(ADD_ICON)
|
||||
.enabledWhen(ac -> program != null)
|
||||
.onAction(ac -> addExternalProgram())
|
||||
.buildAndInstallLocal(this);
|
||||
.popupMenuPath("Add External Program")
|
||||
.popupMenuIcon(ADD_ICON)
|
||||
.toolBarIcon(ADD_ICON)
|
||||
.enabledWhen(ac -> program != null)
|
||||
.onAction(ac -> addExternalProgram())
|
||||
.buildAndInstallLocal(this);
|
||||
|
||||
new ActionBuilder("Delete External Program Name", getOwner())
|
||||
.popupMenuPath("Delete External Program")
|
||||
.popupMenuIcon(DELETE_ICON)
|
||||
.toolBarIcon(DELETE_ICON)
|
||||
.enabledWhen(ac -> hasSelectedRows())
|
||||
.onAction(ac -> deleteExternalProgram())
|
||||
.buildAndInstallLocal(this);
|
||||
.popupMenuPath("Delete External Program")
|
||||
.popupMenuIcon(DELETE_ICON)
|
||||
.toolBarIcon(DELETE_ICON)
|
||||
.enabledWhen(ac -> hasSelectedRows())
|
||||
.onAction(ac -> deleteExternalProgram())
|
||||
.buildAndInstallLocal(this);
|
||||
|
||||
new ActionBuilder("Set External Name Association", getOwner())
|
||||
.popupMenuPath("Set External Name Association")
|
||||
.popupMenuIcon(EDIT_ICON)
|
||||
.toolBarIcon(EDIT_ICON)
|
||||
.enabledWhen(ac -> isSingleRowSelected())
|
||||
.onAction(ac -> setExternalProgramAssociation())
|
||||
.buildAndInstallLocal(this);
|
||||
.popupMenuPath("Set External Name Association")
|
||||
.popupMenuIcon(EDIT_ICON)
|
||||
.toolBarIcon(EDIT_ICON)
|
||||
.enabledWhen(ac -> isSingleRowSelected())
|
||||
.onAction(ac -> setExternalProgramAssociation())
|
||||
.buildAndInstallLocal(this);
|
||||
|
||||
new ActionBuilder("Clear External Name Association", getOwner())
|
||||
.popupMenuPath("Clear External Name Association")
|
||||
.popupMenuIcon(CLEAR_ICON)
|
||||
.toolBarIcon(CLEAR_ICON)
|
||||
.enabledWhen(ac -> hasSelectedRows())
|
||||
.onAction(ac -> clearExternalAssociation())
|
||||
.buildAndInstallLocal(this);
|
||||
.popupMenuPath("Clear External Name Association")
|
||||
.popupMenuIcon(CLEAR_ICON)
|
||||
.toolBarIcon(CLEAR_ICON)
|
||||
.enabledWhen(ac -> hasSelectedRows())
|
||||
.onAction(ac -> clearExternalAssociation())
|
||||
.buildAndInstallLocal(this);
|
||||
|
||||
}
|
||||
|
||||
@@ -148,7 +149,7 @@ public class ExternalReferencesProvider extends ComponentProviderAdapter {
|
||||
|
||||
@Override
|
||||
public ActionContext getActionContext(MouseEvent event) {
|
||||
return new ActionContext(this, table);
|
||||
return new DefaultActionContext(this, table);
|
||||
}
|
||||
|
||||
private JPanel buildMainPanel() {
|
||||
@@ -452,7 +453,7 @@ public class ExternalReferencesProvider extends ComponentProviderAdapter {
|
||||
// there are lots of empty path values.
|
||||
Comparator<ExternalNamesRow> c1 =
|
||||
(r1, r2) -> Objects.requireNonNullElse(r1.getPath(), "")
|
||||
.compareTo(Objects.requireNonNullElse(r2.getPath(), ""));
|
||||
.compareTo(Objects.requireNonNullElse(r2.getPath(), ""));
|
||||
return c1.thenComparing((r1, r2) -> r1.getName().compareTo(r2.getName()));
|
||||
}
|
||||
return super.createSortComparator(columnIndex);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user