mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-09-28 17:11:11 -09:00
GT-2925 - Key Bindings - Support Window Menu Provider Key Bindings -
Step - Added 'snapshot' concept to base Component Provider to fix how actions are added to the toolbar and menu; fixed bugs and tests
This commit is contained in:
@@ -48,8 +48,7 @@ import ghidra.program.model.address.*;
|
||||
import ghidra.program.model.listing.*;
|
||||
import ghidra.program.model.symbol.*;
|
||||
import ghidra.program.util.*;
|
||||
import ghidra.util.HelpLocation;
|
||||
import ghidra.util.SystemUtilities;
|
||||
import ghidra.util.*;
|
||||
import ghidra.util.datastruct.WeakDataStructureFactory;
|
||||
import ghidra.util.datastruct.WeakSet;
|
||||
import ghidra.util.exception.AssertException;
|
||||
@@ -104,13 +103,16 @@ public class FGProvider extends VisualGraphComponentProvider<FGVertex, FGEdge, F
|
||||
controller = new FGController(this, plugin);
|
||||
|
||||
setConnected(isConnected);
|
||||
if (!isConnected) {
|
||||
setTransient();
|
||||
}
|
||||
|
||||
decorationPanel = new DecoratorPanel(controller.getViewComponent(), isConnected);
|
||||
setWindowMenuGroup(FunctionGraphPlugin.FUNCTION_GRAPH_NAME);
|
||||
setWindowGroup(FunctionGraphPlugin.FUNCTION_GRAPH_NAME);
|
||||
setDefaultWindowPosition(WindowPosition.WINDOW);
|
||||
|
||||
setIcon(FunctionGraphPlugin.ICON, true);
|
||||
setIcon(FunctionGraphPlugin.ICON, isConnected);
|
||||
setHelpLocation(new HelpLocation("FunctionGraphPlugin", "FunctionGraphPlugin"));
|
||||
|
||||
addToTool();
|
||||
@@ -129,6 +131,12 @@ public class FGProvider extends VisualGraphComponentProvider<FGVertex, FGEdge, F
|
||||
setClipboardService(service);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSnapshot() {
|
||||
// we are a snapshot when we are 'disconnected'
|
||||
return !isConnected();
|
||||
}
|
||||
|
||||
public void setClipboardService(ClipboardService service) {
|
||||
clipboardService = service;
|
||||
if (clipboardService != null) {
|
||||
@@ -204,7 +212,7 @@ public class FGProvider extends VisualGraphComponentProvider<FGVertex, FGEdge, F
|
||||
|
||||
void cloneWindow() {
|
||||
FGProvider newProvider = plugin.createNewDisconnectedProvider();
|
||||
SystemUtilities.runSwingLater(() -> {
|
||||
Swing.runLater(() -> {
|
||||
newProvider.doSetProgram(currentProgram);
|
||||
|
||||
FGData currentData = controller.getFunctionGraphData();
|
||||
|
||||
Reference in New Issue
Block a user