|
|
|
@ -1,7 +1,7 @@
|
|
|
|
|
package com.fr.design.file; |
|
|
|
|
|
|
|
|
|
import com.fr.design.ExtraDesignClassManager; |
|
|
|
|
import com.fr.design.file.impl.DefaultTemplateFileResourceOperation; |
|
|
|
|
import com.fr.design.file.impl.DefaultTemplateResource; |
|
|
|
|
import com.fr.design.fun.LocalResourceProvider; |
|
|
|
|
import com.fr.design.mainframe.DesignerFrameFileDealerPane; |
|
|
|
|
import com.fr.design.ui.util.UIUtil; |
|
|
|
@ -21,17 +21,19 @@ import com.fr.workspace.engine.base.FineObjectPool;
|
|
|
|
|
* @version 10.0 |
|
|
|
|
* Created by hades on 2020/12/23 |
|
|
|
|
*/ |
|
|
|
|
public class TemplateFileResourceManager { |
|
|
|
|
public class TemplateResourceManager { |
|
|
|
|
|
|
|
|
|
private static TemplateFileResourceOperation OPERATION = new DefaultTemplateFileResourceOperation(); |
|
|
|
|
private static final TemplateResource DEFAULT_OPERATION = new DefaultTemplateResource(); |
|
|
|
|
|
|
|
|
|
private TemplateFileResourceManager() { |
|
|
|
|
private static TemplateResource OPERATION = DEFAULT_OPERATION; |
|
|
|
|
|
|
|
|
|
static { |
|
|
|
|
PluginFilter filter = pluginContext -> pluginContext.contain(PluginModule.ExtraDesign, LocalResourceProvider.XML_TAG); |
|
|
|
|
|
|
|
|
|
PluginListenerRegistration.getInstance().listen(PluginEventType.AfterStop, new PluginEventListener() { |
|
|
|
|
@Override |
|
|
|
|
public void on(PluginEvent event) { |
|
|
|
|
registerOperation(new DefaultTemplateFileResourceOperation()); |
|
|
|
|
registerOperation(new DefaultTemplateResource()); |
|
|
|
|
FineObjectPool.getInstance().getLocalPool().put(FileNodes.class, new LocalFileNodes()); |
|
|
|
|
UIUtil.invokeLaterIfNeeded(() -> DesignerFrameFileDealerPane.getInstance().refresh()); |
|
|
|
|
} |
|
|
|
@ -50,11 +52,14 @@ public class TemplateFileResourceManager {
|
|
|
|
|
}, filter); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private static void registerOperation(TemplateFileResourceOperation operation) { |
|
|
|
|
private static void registerOperation(TemplateResource operation) { |
|
|
|
|
OPERATION = operation; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static TemplateFileResourceOperation getOperation() { |
|
|
|
|
public static TemplateResource getResource() { |
|
|
|
|
if (OPERATION == null) { |
|
|
|
|
return DEFAULT_OPERATION; |
|
|
|
|
} |
|
|
|
|
return OPERATION; |
|
|
|
|
} |
|
|
|
|
|