From 7e06af2b0fb6aeff4d2d1028c32e83a4c84c0623 Mon Sep 17 00:00:00 2001 From: neil <459208047@qq.com> Date: Tue, 29 Jan 2019 10:44:32 +0800 Subject: [PATCH 1/3] =?UTF-8?q?REPORT-14667=20=E6=94=AF=E6=8C=81=E9=80=9A?= =?UTF-8?q?=E8=BF=87=E6=8F=92=E4=BB=B6=E6=89=A9=E5=B1=95=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E6=A0=91=E6=94=AF=E6=8C=81=E7=9A=84=E6=96=87=E4=BB=B6=E5=90=8E?= =?UTF-8?q?=E7=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/actions/file/WebPreviewUtils.java | 14 +++---- .../gui/itree/filetree/TemplateFileTree.java | 37 ++++++++++++------- 2 files changed, 30 insertions(+), 21 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/file/WebPreviewUtils.java b/designer-base/src/main/java/com/fr/design/actions/file/WebPreviewUtils.java index 18c93f74c5..f7dbbbada4 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/WebPreviewUtils.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/WebPreviewUtils.java @@ -1,6 +1,5 @@ package com.fr.design.actions.file; -import com.fr.base.extension.FileExtension; import com.fr.base.vcs.DesignerMode; import com.fr.design.fun.PreviewProvider; import com.fr.design.mainframe.DesignerContext; @@ -11,7 +10,6 @@ import com.fr.file.FileNodeFILE; import com.fr.general.GeneralUtils; import com.fr.general.web.ParameterConstants; import com.fr.stable.project.ProjectConstants; -import com.fr.stable.web.AbstractWebletCreator; import javax.swing.JOptionPane; import java.util.Collections; @@ -90,12 +88,12 @@ public final class WebPreviewUtils { java.util.List parameterNameList = new java.util.ArrayList(); java.util.List parameterValueList = new java.util.ArrayList(); - // 暂时屏蔽cptx直接访问 - if (path.endsWith(FileExtension.CPTX.getSuffix())) { - path = path.substring(0, path.length() - 1); - parameterNameList.add(AbstractWebletCreator.FORMAT); - parameterValueList.add(AbstractWebletCreator.X); - } +// // 暂时屏蔽cptx直接访问 +// if (path.endsWith(FileExtension.CPTX.getSuffix())) { +// path = path.substring(0, path.length() - 1); +// parameterNameList.add(AbstractWebletCreator.FORMAT); +// parameterValueList.add(AbstractWebletCreator.X); +// } parameterNameList.add(actionType); parameterValueList.add(path); 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 f9b18b7f8d..51af636aa2 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 @@ -2,8 +2,10 @@ package com.fr.design.gui.itree.filetree; import com.fr.base.FRContext; import com.fr.base.extension.FileExtension; +import com.fr.design.ExtraDesignClassManager; import com.fr.design.file.NodeAuthProcessor; import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode; +import com.fr.design.mainframe.App; import com.fr.file.filetree.FileNode; import com.fr.log.FineLoggerFactory; import com.fr.stable.ArrayUtils; @@ -15,7 +17,9 @@ import javax.swing.tree.DefaultTreeModel; import javax.swing.tree.TreePath; import java.util.ArrayList; import java.util.Arrays; +import java.util.HashSet; import java.util.List; +import java.util.Set; /* * 显示Env下的reportlets目录下面的所有cpt文件 @@ -124,9 +128,28 @@ public class TemplateFileTree extends EnvFileTree { } public FileNode[] listFile(String path) { + // 支持插件扩展, 先从env的filter拿, 再从插件拿 + Set supportTypes = createFileExtensionFilter(); return FRContext.getFileNodes().list( path, - new FileExtension[]{FileExtension.CPT, FileExtension.FRM, FileExtension.CHT, FileExtension.XLS, FileExtension.XLSX}); + supportTypes.toArray(new FileExtension[supportTypes.size()]) + ); + } + + private Set createFileExtensionFilter() { + Set supportTypes = new HashSet(); + if (filter != null) { + for (String temp : filter.getSupportedTypes()) { + supportTypes.add(FileExtension.parse(temp)); + } + } + Set apps = ExtraDesignClassManager.getInstance().getArray(App.MARK_STRING); + for (App temp : apps) { + for (String extendsion : temp.defaultExtensions()) { + supportTypes.add(FileExtension.parse(extendsion)); + } + } + return supportTypes; } /* @@ -205,18 +228,6 @@ public class TemplateFileTree extends EnvFileTree { if (fileNodes == null) { fileNodes = new FileNode[0]; } - // 用FileNodeFilter过滤一下 - if (filter != null) { - List list = new ArrayList(); - for (FileNode fileNode : fileNodes) { - if (filter.accept(fileNode)) { - list.add(fileNode); - } - } - - fileNodes = list.toArray(new FileNode[list.size()]); - } - Arrays.sort(fileNodes, new FileNodeComparator(FRContext.getFileNodes().getSupportedTypes())); return fileNodes; From d7adc527017789d8ea5116cf3cf251b2fcd5e7ee Mon Sep 17 00:00:00 2001 From: neil <459208047@qq.com> Date: Tue, 29 Jan 2019 11:08:37 +0800 Subject: [PATCH 2/3] pmd --- .../java/com/fr/design/actions/file/WebPreviewUtils.java | 7 ------- 1 file changed, 7 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/file/WebPreviewUtils.java b/designer-base/src/main/java/com/fr/design/actions/file/WebPreviewUtils.java index f7dbbbada4..de223e2ccc 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/WebPreviewUtils.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/WebPreviewUtils.java @@ -88,13 +88,6 @@ public final class WebPreviewUtils { java.util.List parameterNameList = new java.util.ArrayList(); java.util.List parameterValueList = new java.util.ArrayList(); -// // 暂时屏蔽cptx直接访问 -// if (path.endsWith(FileExtension.CPTX.getSuffix())) { -// path = path.substring(0, path.length() - 1); -// parameterNameList.add(AbstractWebletCreator.FORMAT); -// parameterValueList.add(AbstractWebletCreator.X); -// } - parameterNameList.add(actionType); parameterValueList.add(path); if (map != null) { From 18041fcbfe9b6215b496a4b42e131aaabde6b12e Mon Sep 17 00:00:00 2001 From: "Wim.Zhai" Date: Tue, 29 Jan 2019 18:14:16 +0800 Subject: [PATCH 3/3] =?UTF-8?q?CHART-3791=20=E4=BB=8E=E5=85=B6=E4=BB=96?= =?UTF-8?q?=E5=9B=BE=E8=A1=A8=E5=88=87=E6=8D=A2=E8=87=B3=E5=9C=B0=E5=9B=BE?= =?UTF-8?q?=EF=BC=8C=E9=87=8D=E7=BD=AE=E5=9C=B0=E5=9B=BE=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../van/chart/designer/type/AbstractVanChartTypePane.java | 5 +++++ .../van/chart/map/designer/type/VanChartMapPlotPane.java | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java index 68386f3095..b16c9237e1 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java @@ -109,6 +109,7 @@ public abstract class AbstractVanChartTypePane extends AbstractChartTypePane{ resetTitleAttr(chart); //重置监控刷新选项 resetRefreshMoreLabelAttr((VanChart)chart); + resetFilterDefinition(chart); } @@ -118,6 +119,10 @@ public abstract class AbstractVanChartTypePane extends AbstractChartTypePane{ chart.setTitle(vanChartPlot.getDefaultTitle()); } + //重置数据配置 + protected void resetFilterDefinition(Chart chart){ + + } //重置监控刷新面板 protected void resetRefreshMoreLabelAttr(VanChart chart){ diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapPlotPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapPlotPane.java index 76a47afd84..244660adf5 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapPlotPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapPlotPane.java @@ -6,10 +6,10 @@ import com.fr.chart.chartattr.Plot; import com.fr.design.mainframe.chart.gui.type.ChartImagePane; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.log.FineLoggerFactory; - import com.fr.plugin.chart.base.VanChartTools; import com.fr.plugin.chart.map.MapIndependentVanChart; import com.fr.plugin.chart.map.VanChartMapPlot; +import com.fr.plugin.chart.map.data.VanMapDefinition; import com.fr.plugin.chart.map.server.CompatibleGEOJSONHelper; import com.fr.van.chart.designer.type.AbstractVanChartTypePane; @@ -129,6 +129,11 @@ public class VanChartMapPlotPane extends AbstractVanChartTypePane { } + @Override + protected void resetFilterDefinition(Chart chart) { + chart.setFilterDefinition(new VanMapDefinition()); + } + protected void resetAttr(Plot plot) { sourceChoosePane.resetComponentValue((VanChartMapPlot) plot); }