|
|
@ -39,6 +39,23 @@ public class PluginClassRefreshManager { |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final PluginEventListener beforeAllPluginActive = new PluginEventListener() { |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void on(PluginEvent event) { |
|
|
|
|
|
|
|
PluginListenerRegistration.getInstance().stopListen(pluginAfterRunEventListener); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final PluginEventListener afterAllPluginsActive = new PluginEventListener() { |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void on(PluginEvent event) { |
|
|
|
|
|
|
|
PluginListenerRegistration.getInstance().listen(PluginEventType.AfterRun, pluginAfterRunEventListener); |
|
|
|
|
|
|
|
if (DesignerLaunchStatus.getStatus() != DesignerLaunchStatus.WORKSPACE_INIT_COMPLETE) { |
|
|
|
|
|
|
|
HistoryTemplateListCache.getInstance().reloadAllEditingTemplate(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static PluginClassRefreshManager getInstance() { |
|
|
|
public static PluginClassRefreshManager getInstance() { |
|
|
|
return INSTANCE; |
|
|
|
return INSTANCE; |
|
|
@ -50,29 +67,20 @@ public class PluginClassRefreshManager { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private PluginClassRefreshManager() { |
|
|
|
private PluginClassRefreshManager() { |
|
|
|
PluginListenerRegistration.getInstance().listen(PluginEventType.BeforeAllActive, new PluginEventListener() { |
|
|
|
PluginListenerRegistration.getInstance().listen(PluginEventType.BeforeAllActive, beforeAllPluginActive); |
|
|
|
@Override |
|
|
|
PluginListenerRegistration.getInstance().listen(PluginEventType.AfterAllActive, afterAllPluginsActive); |
|
|
|
public void on(PluginEvent event) { |
|
|
|
|
|
|
|
removePluginListener(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
PluginListenerRegistration.getInstance().listen(PluginEventType.AfterAllActive, new PluginEventListener() { |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void on(PluginEvent event) { |
|
|
|
|
|
|
|
addPluginListener(); |
|
|
|
|
|
|
|
if (DesignerLaunchStatus.getStatus() != DesignerLaunchStatus.WORKSPACE_INIT_COMPLETE) { |
|
|
|
|
|
|
|
HistoryTemplateListCache.getInstance().reloadAllEditingTemplate(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void removePluginListener() { |
|
|
|
public void removePluginListener() { |
|
|
|
PluginListenerRegistration.getInstance().stopListen(this.pluginAfterRunEventListener); |
|
|
|
PluginListenerRegistration.getInstance().stopListen(this.pluginAfterRunEventListener); |
|
|
|
|
|
|
|
PluginListenerRegistration.getInstance().stopListen(this.beforeAllPluginActive); |
|
|
|
|
|
|
|
PluginListenerRegistration.getInstance().stopListen(this.afterAllPluginsActive); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void addPluginListener() { |
|
|
|
public void addPluginListener() { |
|
|
|
PluginListenerRegistration.getInstance().listen(PluginEventType.AfterRun, this.pluginAfterRunEventListener); |
|
|
|
PluginListenerRegistration.getInstance().listen(PluginEventType.AfterRun, this.pluginAfterRunEventListener); |
|
|
|
|
|
|
|
PluginListenerRegistration.getInstance().listen(PluginEventType.BeforeAllActive, beforeAllPluginActive); |
|
|
|
|
|
|
|
PluginListenerRegistration.getInstance().listen(PluginEventType.AfterAllActive, afterAllPluginsActive); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|