Browse Source

插件天生可拔插,这里不能用static,应每次调用时获取

feature/big-screen
alex.sung 5 years ago
parent
commit
65e07d5e0e
  1. 7
      designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileNodeConstants.java
  2. 2
      designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java

7
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<String> supportFileType = new ArrayList<>(Arrays.asList(FRContext.getFileNodes().getSupportedTypes()));
//通过插件扩展的
Set<App> 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]);
}
}

2
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;
}

Loading…
Cancel
Save