Fixed an exception when trying to open 2 tools with the same project

This commit is contained in:
dragonmacher
2022-11-17 09:05:55 -05:00
parent 45640e9bc6
commit b1fa0a1df0

View File

@@ -160,7 +160,8 @@ public abstract class PluginTool extends AbstractDockingTool {
String name, boolean isDockable, boolean hasStatus, boolean isModal) {
this.project = project;
this.projectManager = projectManager;
this.toolServices = toolServices;
this.toolServices = toolServices == null ? new ToolServicesAdapter() : toolServices;
propertyChangeMgr = new PropertyChangeSupport(this);
optionsMgr = new OptionsManager(this);
winMgr = createDockingWindowManager(isDockable, hasStatus, isModal);
@@ -1317,6 +1318,9 @@ public abstract class PluginTool extends AbstractDockingTool {
if (project != null) {
toolServices = project.getToolServices();
}
else {
toolServices = new ToolServicesAdapter();
}
}
protected void restorePluginsFromXml(Element elem) throws PluginException {