diff --git a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileNodeConstants.java b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileNodeConstants.java index 3bde026a25..b997b21d09 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileNodeConstants.java +++ b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileNodeConstants.java @@ -13,15 +13,16 @@ import java.util.Set; * Created by alex sung on 2019/7/23. */ public class FileNodeConstants { - public static String[] SUPPORT_FILE_TYPES; - static { + private FileNodeConstants(){} + + public static String[] getSupportFileTypes(){ List supportFileType = new ArrayList<>(Arrays.asList(FRContext.getFileNodes().getSupportedTypes())); //通过插件扩展的 Set apps = ExtraDesignClassManager.getInstance().getArray(App.MARK_STRING); for(App app: apps){ supportFileType.addAll(Arrays.asList(app.defaultExtensions())); } - SUPPORT_FILE_TYPES = supportFileType.toArray(new String[0]); + return supportFileType.toArray(new String[0]); } } diff --git a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java index b722cd44a4..b1f641b3b6 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java +++ b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java @@ -228,7 +228,7 @@ public class TemplateFileTree extends EnvFileTree { if (fileNodes == null) { fileNodes = new FileNode[0]; } - Arrays.sort(fileNodes, new FileNodeComparator(FileNodeConstants.SUPPORT_FILE_TYPES)); + Arrays.sort(fileNodes, new FileNodeComparator(FileNodeConstants.getSupportFileTypes())); return fileNodes; }