|
|
|
@ -7,6 +7,7 @@ import com.fr.design.file.NodeAuthProcessor;
|
|
|
|
|
import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode; |
|
|
|
|
import com.fr.design.mainframe.App; |
|
|
|
|
import com.fr.design.mainframe.manager.search.TemplateTreeSearchManager; |
|
|
|
|
import com.fr.file.filetree.AppTypeFilter; |
|
|
|
|
import com.fr.file.filetree.FileNode; |
|
|
|
|
import com.fr.log.FineLoggerFactory; |
|
|
|
|
import com.fr.stable.ArrayUtils; |
|
|
|
@ -19,6 +20,7 @@ import javax.swing.tree.DefaultTreeModel;
|
|
|
|
|
import javax.swing.tree.TreePath; |
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.Arrays; |
|
|
|
|
import java.util.Collections; |
|
|
|
|
import java.util.Comparator; |
|
|
|
|
import java.util.HashSet; |
|
|
|
|
import java.util.List; |
|
|
|
@ -38,6 +40,8 @@ public class TemplateFileTree extends EnvFileTree {
|
|
|
|
|
private static final int MAX_NODE_EXPAND_NUM = 50; |
|
|
|
|
private static final int MAX_MATCHED_NODE_NUM = 500; |
|
|
|
|
|
|
|
|
|
protected AppTypeFilter appTypeFilter; |
|
|
|
|
|
|
|
|
|
public TemplateFileTree() { |
|
|
|
|
super(ProjectConstants.REPORTLETS_NAME, null, null); |
|
|
|
|
} |
|
|
|
@ -155,12 +159,17 @@ public class TemplateFileTree extends EnvFileTree {
|
|
|
|
|
supportTypes.add(FileExtension.parse(temp)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
Set<App> apps = ExtraDesignClassManager.getInstance().getArray(App.MARK_STRING); |
|
|
|
|
for (App temp : apps) { |
|
|
|
|
for (String extendsion : temp.defaultExtensions()) { |
|
|
|
|
supportTypes.add(FileExtension.parse(extendsion)); |
|
|
|
|
if (appTypeFilter != null) { |
|
|
|
|
Collections.addAll(supportTypes, appTypeFilter.getSupportedTypes()); |
|
|
|
|
} else { |
|
|
|
|
Set<App> apps = ExtraDesignClassManager.getInstance().getArray(App.MARK_STRING); |
|
|
|
|
for (App temp : apps) { |
|
|
|
|
for (String extendsion : temp.defaultExtensions()) { |
|
|
|
|
supportTypes.add(FileExtension.parse(extendsion)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return supportTypes; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -360,6 +369,10 @@ public class TemplateFileTree extends EnvFileTree {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void setAppTypeFilter(AppTypeFilter filter) { |
|
|
|
|
appTypeFilter = filter; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private boolean notContained(String parentPath, ExpandMutableTreeNode treeNode) { |
|
|
|
|
List<String> childList = currentTreeMode.getOrDefault(parentPath, new ArrayList<>()); |
|
|
|
|
String name = ((FileNode) (treeNode.getUserObject())).getName(); |
|
|
|
|