mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-06 03:50:02 +02:00
GP-3117: Make Go To Time action use time selection dialog
This commit is contained in:
parent
9dcc504965
commit
ab5d720a7c
1 changed files with 8 additions and 13 deletions
|
@ -27,7 +27,6 @@ import javax.swing.JComponent;
|
||||||
import docking.ActionContext;
|
import docking.ActionContext;
|
||||||
import docking.action.*;
|
import docking.action.*;
|
||||||
import docking.action.builder.ActionBuilder;
|
import docking.action.builder.ActionBuilder;
|
||||||
import docking.widgets.dialogs.InputDialog;
|
|
||||||
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;
|
||||||
|
@ -40,7 +39,6 @@ import ghidra.framework.plugintool.annotation.AutoConfigStateField;
|
||||||
import ghidra.framework.plugintool.annotation.AutoServiceConsumed;
|
import ghidra.framework.plugintool.annotation.AutoServiceConsumed;
|
||||||
import ghidra.trace.model.time.schedule.TraceSchedule;
|
import ghidra.trace.model.time.schedule.TraceSchedule;
|
||||||
import ghidra.util.HelpLocation;
|
import ghidra.util.HelpLocation;
|
||||||
import ghidra.util.Msg;
|
|
||||||
|
|
||||||
public class DebuggerTimeProvider extends ComponentProviderAdapter {
|
public class DebuggerTimeProvider extends ComponentProviderAdapter {
|
||||||
private static final AutoConfigState.ClassHandler<DebuggerTimeProvider> CONFIG_STATE_HANDLER =
|
private static final AutoConfigState.ClassHandler<DebuggerTimeProvider> CONFIG_STATE_HANDLER =
|
||||||
|
@ -85,6 +83,8 @@ public class DebuggerTimeProvider extends ComponentProviderAdapter {
|
||||||
|
|
||||||
/*testing*/ final DebuggerSnapshotTablePanel mainPanel;
|
/*testing*/ final DebuggerSnapshotTablePanel mainPanel;
|
||||||
|
|
||||||
|
protected final DebuggerTimeSelectionDialog timeDialog;
|
||||||
|
|
||||||
DockingAction actionGoToTime;
|
DockingAction actionGoToTime;
|
||||||
ToggleDockingAction actionHideScratch;
|
ToggleDockingAction actionHideScratch;
|
||||||
|
|
||||||
|
@ -104,6 +104,8 @@ public class DebuggerTimeProvider extends ComponentProviderAdapter {
|
||||||
setHelpLocation(HELP_PROVIDER_TIME);
|
setHelpLocation(HELP_PROVIDER_TIME);
|
||||||
setWindowMenuGroup(DebuggerPluginPackage.NAME);
|
setWindowMenuGroup(DebuggerPluginPackage.NAME);
|
||||||
|
|
||||||
|
timeDialog = new DebuggerTimeSelectionDialog(tool);
|
||||||
|
|
||||||
mainPanel = new DebuggerSnapshotTablePanel(tool);
|
mainPanel = new DebuggerSnapshotTablePanel(tool);
|
||||||
buildMainPanel();
|
buildMainPanel();
|
||||||
|
|
||||||
|
@ -186,20 +188,13 @@ public class DebuggerTimeProvider extends ComponentProviderAdapter {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void activatedGoToTime() {
|
private void activatedGoToTime() {
|
||||||
InputDialog dialog =
|
TraceSchedule time = timeDialog.promptTime(current.getTrace(), current.getTime());
|
||||||
new InputDialog("Go To Time", "Schedule:", current.getTime().toString());
|
if (time == null) {
|
||||||
tool.showDialog(dialog);
|
// Cancelled
|
||||||
if (dialog.isCanceled()) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
|
||||||
TraceSchedule time = TraceSchedule.parse(dialog.getValue());
|
|
||||||
traceManager.activateTime(time);
|
traceManager.activateTime(time);
|
||||||
}
|
}
|
||||||
catch (IllegalArgumentException e) {
|
|
||||||
Msg.showError(this, getComponent(), "Go To Time", "Could not parse schedule");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void activatedHideScratch(ActionContext ctx) {
|
private void activatedHideScratch(ActionContext ctx) {
|
||||||
hideScratch = !hideScratch;
|
hideScratch = !hideScratch;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue