fixes #1810 broken toolbar actions on nodes in the function graph

This commit is contained in:
ghidravore
2020-06-26 14:35:03 -04:00
parent c7cc11a18e
commit b7e6faf2dc
@@ -113,7 +113,7 @@ public class ToolBarItemManager implements PropertyChangeListener, ActionListene
@Override
public void actionPerformed(ActionEvent event) {
DockingWindowManager.clearMouseOverHelp();
ActionContext context = windowManager.getActionContext(toolBarAction);
ActionContext context = getActionContext();
context.setSourceObject(event.getSource());
@@ -130,6 +130,18 @@ public class ToolBarItemManager implements PropertyChangeListener, ActionListene
});
}
private ActionContext getActionContext() {
if (windowManager != null) {
return windowManager.getActionContext(toolBarAction);
}
ComponentProvider provider = getComponentProvider();
ActionContext context = provider == null ? null : provider.getActionContext(null);
final ActionContext actionContext =
context == null ? new ActionContext(provider, null) : context;
return actionContext;
}
@Override
public String toString() {
return toolBarAction.getName();