Browse Source

增加插件扩展类型支持

feature/big-screen
alex.sung 5 years ago
parent
commit
5ee83b07ec
  1. 27
      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

27
designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileNodeConstants.java

@ -0,0 +1,27 @@
package com.fr.design.gui.itree.filetree;
import com.fr.base.FRContext;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.mainframe.App;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Set;
/**
* Created by alex sung on 2019/7/23.
*/
public class FileNodeConstants {
public static String[] SUPPORT_FILE_TYPES;
static {
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]);
}
}

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(FRContext.getFileNodes().getSupportedTypes()));
Arrays.sort(fileNodes, new FileNodeComparator(FileNodeConstants.SUPPORT_FILE_TYPES));
return fileNodes;
}

Loading…
Cancel
Save