Browse Source

初始化时从插件里捞一把

feature/big-screen
alex.sung 5 years ago
parent
commit
58eea3a9e8
  1. 15
      designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileNodeConstants.java

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

@ -20,9 +20,13 @@ import java.util.Set;
*/ */
public class FileNodeConstants { public class FileNodeConstants {
private static List<String> supportFileType = new ArrayList<String>(Arrays.asList(FRContext.getFileNodes().getSupportedTypes())); private static List<String> supportFileType;
private FileNodeConstants(){}
static { static {
initSupportedTypes();
GeneralContext.listenPluginRunningChanged(new PluginEventListener() { GeneralContext.listenPluginRunningChanged(new PluginEventListener() {
@Override @Override
public void on(PluginEvent pluginEvent) { public void on(PluginEvent pluginEvent) {
@ -49,6 +53,15 @@ public class FileNodeConstants {
} }
} }
private static void initSupportedTypes() {
supportFileType = new ArrayList<String>(Arrays.asList(FRContext.getFileNodes().getSupportedTypes()));
//通过插件扩展的
Set<App> apps = ExtraDesignClassManager.getInstance().getArray(App.MARK_STRING);
for (App app : apps) {
addAppExtensions(app.defaultExtensions());
}
}
public static String[] getSupportFileTypes() { public static String[] getSupportFileTypes() {
return supportFileType.toArray(new String[0]); return supportFileType.toArray(new String[0]);
} }

Loading…
Cancel
Save