From e950feb1f5ecbaa057cc36c8bbcc56d40e15a221 Mon Sep 17 00:00:00 2001 From: kerry Date: Mon, 9 Sep 2019 13:45:47 +0800 Subject: [PATCH 01/95] =?UTF-8?q?REPORT-21202=20tab=E5=9D=97=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E8=8F=9C=E5=8D=95=E6=A0=B7=E5=BC=8F=E4=B9=8B?= =?UTF-8?q?=E5=90=8E=E6=94=B9=E4=B8=8D=E5=9B=9E=E9=BB=98=E8=AE=A4=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/beans/models/SelectionModel.java | 47 +++++++------------ .../fr/design/mainframe/FormSelection.java | 6 ++- 2 files changed, 21 insertions(+), 32 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java b/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java index c7121f0e16..76eb602300 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java @@ -18,7 +18,9 @@ import com.fr.design.utils.ComponentUtils; import com.fr.design.utils.gui.LayoutUtils; import com.fr.stable.ArrayUtils; -import java.awt.*; +import java.awt.LayoutManager; +import java.awt.Rectangle; +import java.awt.Toolkit; import java.awt.event.MouseEvent; import java.util.ArrayList; @@ -175,36 +177,19 @@ public class SelectionModel { } private void pasteXWFitLayout() { - if (selection.getSelectedCreator().getClass().equals(XWTabFitLayout.class)) { - XLayoutContainer container = (XLayoutContainer) selection.getSelectedCreator(); - //tab布局编辑器内部左上角第一个坐标点 - int leftUpX = container.toData().getMargin().getLeft() + 1; - int leftUpY = container.toData().getMargin().getTop() + 1; - //选中第一个坐标点坐在的组件 - selection.setSelectedCreator((XCreator) container.getComponentAt(leftUpX, leftUpY)); - Rectangle rectangle = selection.getRelativeBounds(); - if (hasSelectedPasteSource()) { - selectedPaste(); - } else { - FormSelectionUtils.paste2Container(designer, container, clipboard, - rectangle.x + rectangle.width / 2, - rectangle.y + DELTA_X_Y); - } + //自适应布局编辑器内部左上角第一个坐标点 + int leftUpX = designer.getRootComponent().toData().getMargin().getLeft() + 1; + int leftUpY = designer.getRootComponent().toData().getMargin().getTop() + 1; + //选中第一个坐标点坐在的组件 + selection.setSelectedCreator((XCreator) designer.getRootComponent().getComponentAt(leftUpX, leftUpY)); + Rectangle rectangle = selection.getRelativeBounds(); + if (hasSelectedPasteSource()) { + selectedPaste(); } else { - //自适应布局编辑器内部左上角第一个坐标点 - int leftUpX = designer.getRootComponent().toData().getMargin().getLeft() + 1; - int leftUpY = designer.getRootComponent().toData().getMargin().getTop() + 1; - //选中第一个坐标点坐在的组件 - selection.setSelectedCreator((XCreator) designer.getRootComponent().getComponentAt(leftUpX, leftUpY)); - Rectangle rectangle = selection.getRelativeBounds(); - if (hasSelectedPasteSource()) { - selectedPaste(); - } else { - FormSelectionUtils.paste2Container(designer, designer.getRootComponent(), - clipboard, - rectangle.x + rectangle.width / 2, - rectangle.y + DELTA_X_Y); - } + FormSelectionUtils.paste2Container(designer, designer.getRootComponent(), + clipboard, + rectangle.x + rectangle.width / 2, + rectangle.y + DELTA_X_Y); } } @@ -497,4 +482,4 @@ public class SelectionModel { selection.setSelectedCreators(rebuildSelection); fireCreatorSelected(); } -} \ No newline at end of file +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormSelection.java b/designer-form/src/main/java/com/fr/design/mainframe/FormSelection.java index 8d223c2452..c7d7d8c157 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormSelection.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormSelection.java @@ -11,6 +11,7 @@ import com.fr.design.designer.creator.XWAbsoluteLayout; import com.fr.design.designer.creator.XWFitLayout; import com.fr.design.designer.creator.XWParameterLayout; import com.fr.design.designer.creator.cardlayout.XWCardTagLayout; +import com.fr.design.designer.creator.cardlayout.XWTabFitLayout; import com.fr.design.utils.ComponentUtils; import com.fr.design.utils.gui.LayoutUtils; import com.fr.form.ui.Widget; @@ -317,6 +318,9 @@ public class FormSelection { clipBoard.reset(); for (XCreator root : selection) { + if(root.acceptType(XWTabFitLayout.class)){ + continue; + } try { XCreator creator = XCreatorUtils.createXCreator((Widget) root.toData().clone()); creator.setBounds(root.getBounds()); @@ -326,4 +330,4 @@ public class FormSelection { } } } -} \ No newline at end of file +} From 8141138aaeb2d658902d5feaad7c2b142c65fc2e Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 17 Sep 2019 09:34:53 +0800 Subject: [PATCH 02/95] =?UTF-8?q?REPORT-21486=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=20=E5=8F=8C=E5=B1=8F=E6=83=85=E5=86=B5=EF=BC=8C?= =?UTF-8?q?=E5=8F=96=E8=89=B2=E5=99=A8=E7=BB=8F=E8=BF=87=E5=8F=8C=E5=B1=8F?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E5=A4=84=E4=BC=9A=E5=8D=A1=E6=AD=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/style/color/ColorPicker.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/style/color/ColorPicker.java b/designer-base/src/main/java/com/fr/design/style/color/ColorPicker.java index 155ac4168b..d8816c3e3f 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/ColorPicker.java +++ b/designer-base/src/main/java/com/fr/design/style/color/ColorPicker.java @@ -167,17 +167,18 @@ class ColorPickerPanel extends JPanel * 截屏 */ public void captureScreen() { - try - { + try { robot = new Robot(); } - catch (AWTException e) - { + catch (AWTException e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); } // 截屏幕 - screenImage = robot.createScreenCapture(new Rectangle(0, 0, Toolkit - .getDefaultToolkit().getScreenSize().width, Toolkit - .getDefaultToolkit().getScreenSize().height)); + Rectangle rectangle = new Rectangle(0, 0, 0, 0); + for (GraphicsDevice gd : GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices()) { + rectangle = rectangle.union(gd.getDefaultConfiguration().getBounds()); + } + screenImage = robot.createScreenCapture(rectangle); } /** From e3bb63c95f4c5aa938d7aa88c8a159b9145c62bd Mon Sep 17 00:00:00 2001 From: zack Date: Mon, 23 Sep 2019 19:18:55 +0800 Subject: [PATCH 03/95] =?UTF-8?q?REPORT-20568=20=E5=A1=AB=E6=8A=A5?= =?UTF-8?q?=E5=90=8E=E6=8F=90=E4=BA=A4=E5=85=A5=E5=BA=93=E6=97=B6=E9=97=B4?= =?UTF-8?q?=EF=BC=8C=E6=B7=BB=E5=8A=A02=E4=B8=AA=E6=8F=90=E4=BA=A4tab?= =?UTF-8?q?=EF=BC=8C=E7=AC=AC=E4=BA=8C=E4=B8=AA=E5=B0=91=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/javascript/JavaScriptActionPane.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/javascript/JavaScriptActionPane.java b/designer-base/src/main/java/com/fr/design/javascript/JavaScriptActionPane.java index 3b025ae1fa..ee1e1905f6 100644 --- a/designer-base/src/main/java/com/fr/design/javascript/JavaScriptActionPane.java +++ b/designer-base/src/main/java/com/fr/design/javascript/JavaScriptActionPane.java @@ -8,6 +8,7 @@ import com.fr.design.fun.JavaScriptActionProvider; import com.fr.design.gui.frpane.UIComboBoxPane; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.mainframe.DesignerContext; +import com.fr.design.mainframe.JTemplate; import com.fr.design.write.submit.DBManipulationPane; import com.fr.form.ui.WebContentUtils; import com.fr.js.JavaScript; @@ -149,7 +150,8 @@ public abstract class JavaScriptActionPane extends UIComboBoxPane { @Override public DBManipulationPane createDBManipulationPane() { - return new DBManipulationPane(); + JTemplate jTemplate = DesignerContext.getDesignerFrame().getSelectedJTemplate(); + return jTemplate == null ? new DBManipulationPane() : jTemplate.createDBManipulationPane(); } @Override From 33f1a07b51e0d0433bc7418db81c21825154e354 Mon Sep 17 00:00:00 2001 From: zack Date: Wed, 25 Sep 2019 16:35:19 +0800 Subject: [PATCH 04/95] =?UTF-8?q?REPORT-18676=20=E3=80=90=E9=87=8D?= =?UTF-8?q?=E6=9E=84=E6=8F=90=E4=BA=A4=E6=A0=A1=E9=AA=8C=E3=80=91cpt?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E7=95=8C=E9=9D=A2=E7=9A=84=E6=8E=A7=E4=BB=B6?= =?UTF-8?q?=E5=85=A5=E5=BA=93=E4=BA=8B=E4=BB=B6=E8=AF=BB=E5=8F=96=E4=B8=8D?= =?UTF-8?q?=E5=88=B0=E6=8E=A7=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/DesignModelAdapter.java | 14 ++++++++++++++ .../fun/ParameterWidgetOptionProvider.java | 1 + .../fr/design/mainframe/FormModelAdapter.java | 4 +--- .../design/mainframe/WorkBookModelAdapter.java | 16 ++++++++++++++++ 4 files changed, 32 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/DesignModelAdapter.java b/designer-base/src/main/java/com/fr/design/DesignModelAdapter.java index 84fd684ae8..24dd314844 100644 --- a/designer-base/src/main/java/com/fr/design/DesignModelAdapter.java +++ b/designer-base/src/main/java/com/fr/design/DesignModelAdapter.java @@ -7,8 +7,11 @@ import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.mainframe.DesignerFrameFileDealerPane; import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.JTemplateProvider; +import com.fr.form.ui.DataControl; +import com.fr.form.ui.MultiFileEditor; import com.fr.form.ui.Widget; import com.fr.general.ComparatorUtils; +import com.fr.stable.StringUtils; import com.fr.stable.js.WidgetName; import java.util.Iterator; @@ -214,6 +217,17 @@ public abstract class DesignModelAdapter getWidgetsName(); + /** + * 判断是否是值编辑器可以设置的控件类型 + * @param widget 控件 + * @return 可以设置返回true,否则返回false + */ + public boolean widgetAccepted(Widget widget) { + return widget != null + && StringUtils.isNotEmpty(widget.getWidgetName()) + && (widget instanceof DataControl || widget instanceof MultiFileEditor); + } + /** * 更新缓存的参数 */ diff --git a/designer-base/src/main/java/com/fr/design/fun/ParameterWidgetOptionProvider.java b/designer-base/src/main/java/com/fr/design/fun/ParameterWidgetOptionProvider.java index 685c81a921..ffcfef58bc 100644 --- a/designer-base/src/main/java/com/fr/design/fun/ParameterWidgetOptionProvider.java +++ b/designer-base/src/main/java/com/fr/design/fun/ParameterWidgetOptionProvider.java @@ -17,6 +17,7 @@ public interface ParameterWidgetOptionProvider extends Mutable { /** * 自定义参数控件的实际类,该类需要继承自com.fr.form.ui.Widget + * 如果有控件值属性,该类需要实现DataControl接口,否则可能有部分功能无法使用,比如:值编辑器选择控件的时候无法找到插件里的控件 * @return 控件类 */ Class classForWidget(); diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormModelAdapter.java b/designer-form/src/main/java/com/fr/design/mainframe/FormModelAdapter.java index 090969d348..abe0c97e86 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormModelAdapter.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormModelAdapter.java @@ -8,9 +8,7 @@ import com.fr.design.file.HistoryTemplateListPane; import com.fr.form.main.Form; import com.fr.form.main.WidgetGatherAdapter; import com.fr.form.ui.BaseChartEditor; -import com.fr.form.ui.DataControl; import com.fr.form.ui.ElementCaseEditor; -import com.fr.form.ui.MultiFileEditor; import com.fr.form.ui.Widget; import com.fr.script.Calculator; import com.fr.stable.ParameterProvider; @@ -74,7 +72,7 @@ public class FormModelAdapter extends DesignModelAdapter> @Override public void dealWith(Widget widget) { - if (widget instanceof DataControl || widget instanceof MultiFileEditor) { + if (widgetAccepted(widget)) { list.add(new WidgetName(widget.getWidgetName())); } } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/WorkBookModelAdapter.java b/designer-realize/src/main/java/com/fr/design/mainframe/WorkBookModelAdapter.java index 1e55d3c9b0..7b292c3a16 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/WorkBookModelAdapter.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/WorkBookModelAdapter.java @@ -2,6 +2,7 @@ package com.fr.design.mainframe; import com.fr.base.Parameter; import com.fr.base.TableData; +import com.fr.base.parameter.ParameterUI; import com.fr.data.TableDataSource; import com.fr.design.DesignModelAdapter; import com.fr.design.bridge.DesignToolbarProvider; @@ -118,6 +119,20 @@ public class WorkBookModelAdapter extends DesignModelAdapter getWidgetsName() { List list = new ArrayList(); WorkBook wb = this.getBook(); + ReportParameterAttr parameterAttr = wb.getReportParameterAttr(); + if (parameterAttr != null) { + ParameterUI parameterUI = parameterAttr.getParameterUI(); + if (parameterUI != null) { + Widget[] paraWidgets = parameterUI.getAllWidgets(); + for (int i = 0; i < paraWidgets.length; i++) { + Widget wi = paraWidgets[i]; + if (widgetAccepted(wi)) { + list.add(new WidgetName(wi.getWidgetName())); + } + } + } + } + for (int i = 0, len = wb.getReportCount(); i < len; i++) { Report report = wb.getReport(i); Iterator it = report.iteratorOfElementCase(); @@ -128,6 +143,7 @@ public class WorkBookModelAdapter extends DesignModelAdapter Date: Thu, 26 Sep 2019 10:01:41 +0800 Subject: [PATCH 05/95] =?UTF-8?q?REPORT-18676=20=E3=80=90=E9=87=8D?= =?UTF-8?q?=E6=9E=84=E6=8F=90=E4=BA=A4=E6=A0=A1=E9=AA=8C=E3=80=91cpt?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E7=95=8C=E9=9D=A2=E7=9A=84=E6=8E=A7=E4=BB=B6?= =?UTF-8?q?=E5=85=A5=E5=BA=93=E4=BA=8B=E4=BB=B6=E8=AF=BB=E5=8F=96=E4=B8=8D?= =?UTF-8?q?=E5=88=B0=E6=8E=A7=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/WorkBookModelAdapter.java | 51 +++++-------------- 1 file changed, 14 insertions(+), 37 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/WorkBookModelAdapter.java b/designer-realize/src/main/java/com/fr/design/mainframe/WorkBookModelAdapter.java index 7b292c3a16..fff25486dc 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/WorkBookModelAdapter.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/WorkBookModelAdapter.java @@ -2,20 +2,17 @@ package com.fr.design.mainframe; import com.fr.base.Parameter; import com.fr.base.TableData; -import com.fr.base.parameter.ParameterUI; import com.fr.data.TableDataSource; import com.fr.design.DesignModelAdapter; import com.fr.design.bridge.DesignToolbarProvider; import com.fr.form.ui.Widget; import com.fr.main.impl.WorkBook; +import com.fr.main.impl.WorkBookHelper; import com.fr.main.parameter.ReportParameterAttr; -import com.fr.report.cell.CellElement; -import com.fr.report.cell.DefaultTemplateCellElement; import com.fr.report.cell.FloatElement; -import com.fr.report.elementcase.ElementCase; import com.fr.report.elementcase.TemplateElementCase; -import com.fr.report.report.Report; import com.fr.script.Calculator; +import com.fr.stable.Filter; import com.fr.stable.ParameterProvider; import com.fr.stable.StringUtils; import com.fr.stable.bridge.StableFactory; @@ -31,6 +28,7 @@ import java.util.List; */ public class WorkBookModelAdapter extends DesignModelAdapter { + public WorkBookModelAdapter(JWorkBook jworkbook) { super(jworkbook); } @@ -116,42 +114,21 @@ public class WorkBookModelAdapter extends DesignModelAdapter getWidgetsName() { - List list = new ArrayList(); WorkBook wb = this.getBook(); - ReportParameterAttr parameterAttr = wb.getReportParameterAttr(); - if (parameterAttr != null) { - ParameterUI parameterUI = parameterAttr.getParameterUI(); - if (parameterUI != null) { - Widget[] paraWidgets = parameterUI.getAllWidgets(); - for (int i = 0; i < paraWidgets.length; i++) { - Widget wi = paraWidgets[i]; - if (widgetAccepted(wi)) { - list.add(new WidgetName(wi.getWidgetName())); - } - } + return WorkBookHelper.listWidgetNamesInWorkBook(wb, new Filter() { + @Override + public boolean accept(Widget widget) { + return widgetAccepted(widget); } - } - - for (int i = 0, len = wb.getReportCount(); i < len; i++) { - Report report = wb.getReport(i); - Iterator it = report.iteratorOfElementCase(); - while (it.hasNext()) { - ElementCase ec = (ElementCase) it.next(); - Iterator cs = ec.cellIterator(); - while (cs.hasNext()) { - CellElement ce = (CellElement) cs.next(); - if (ce instanceof DefaultTemplateCellElement) { - Widget widget = ((DefaultTemplateCellElement) ce).getWidget(); - //todo 这边有没有必要统一改成widgetAccepted?暂时不改,插件那边可能会有影响,因为插件有的控件并没有实现DataControl的 - if (widget != null && StringUtils.isNotEmpty(widget.getWidgetName())) { - list.add(new WidgetName(widget.getWidgetName())); - } - } - } + }, new Filter() { + @Override + public boolean accept(Widget widget) { + //todo 这边有没有必要统一改成widgetAccepted?暂时不改,插件那边可能会有影响,因为插件有的控件并没有实现DataControl的 + return widget != null && StringUtils.isNotEmpty(widget.getWidgetName()); } - } - return list; + }); } /** From db8e1b7e14879267db768fca69ff7d51d7711799 Mon Sep 17 00:00:00 2001 From: "yaoh.wu" Date: Fri, 27 Sep 2019 14:48:00 +0800 Subject: [PATCH 06/95] =?UTF-8?q?REPORT-22114=20=E8=BF=9C=E7=A8=8B?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E9=85=8D=E7=BD=AE=E7=95=8C=E9=9D=A2=E4=BC=98?= =?UTF-8?q?=E5=85=88=E4=BB=A5=E7=9B=B4=E6=8E=A5=20url=20=E5=9C=B0=E5=9D=80?= =?UTF-8?q?=E5=A1=AB=E5=86=99=E7=9A=84=E4=B8=BA=E5=87=86=E5=B9=B6=E5=B0=BD?= =?UTF-8?q?=E5=8F=AF=E8=83=BD=E4=BF=9D=E8=AF=81=E8=81=94=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/env/RemoteEnvPane.java | 1 + .../java/com/fr/env/RemoteWorkspaceURL.java | 36 ++++++++++--------- ...LTest.java => RemoteWorkspaceURLTest.java} | 35 +++++++++++++++++- 3 files changed, 54 insertions(+), 18 deletions(-) rename designer-base/src/test/java/com/fr/env/{RemoteEnvURLTest.java => RemoteWorkspaceURLTest.java} (81%) diff --git a/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java b/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java index 9b97c43599..1e80ae9ec4 100644 --- a/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java +++ b/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java @@ -643,6 +643,7 @@ public class RemoteEnvPane extends BasicBeanPane { remoteWorkspaceURL.setPort(port); remoteWorkspaceURL.setWeb(web); remoteWorkspaceURL.setServlet(servlet); + remoteWorkspaceURL.resetUrl(); } diff --git a/designer-base/src/main/java/com/fr/env/RemoteWorkspaceURL.java b/designer-base/src/main/java/com/fr/env/RemoteWorkspaceURL.java index f7f5e6aeeb..06e38a5cc8 100644 --- a/designer-base/src/main/java/com/fr/env/RemoteWorkspaceURL.java +++ b/designer-base/src/main/java/com/fr/env/RemoteWorkspaceURL.java @@ -1,10 +1,9 @@ package com.fr.env; +import com.fr.stable.AssistUtils; import com.fr.stable.FCloneable; import com.fr.stable.StringUtils; -import java.util.Objects; - /** * @author yaohwu */ @@ -42,6 +41,7 @@ public class RemoteWorkspaceURL implements FCloneable { private String port; private String web; private String servlet; + private String url; /** @@ -51,7 +51,7 @@ public class RemoteWorkspaceURL implements FCloneable { * @param url x:x/x/x/x */ public RemoteWorkspaceURL(String url) { - + this.url = url; // 没有写协议名称 默认 使用 http 协议 if (!url.startsWith(HTTPS) && !url.startsWith(HTTP)) { url = HTTP + url; @@ -116,11 +116,15 @@ public class RemoteWorkspaceURL implements FCloneable { } public String getURL() { + if (this.url != null) { + return url; + } String prefix = isHttps ? HTTPS : HTTP; String portColon = StringUtils.isNotEmpty(port) ? ":" : StringUtils.EMPTY; String webAppNameSlash = StringUtils.isNotEmpty(web) ? "/" : StringUtils.EMPTY; String servletNameSlash = StringUtils.isNotEmpty(servlet) ? "/" : StringUtils.EMPTY; - return prefix + host + portColon + port + webAppNameSlash + web + servletNameSlash + servlet; + this.url = prefix + host + portColon + port + webAppNameSlash + web + servletNameSlash + servlet; + return this.url; } @@ -164,26 +168,24 @@ public class RemoteWorkspaceURL implements FCloneable { return servlet; } + public void resetUrl() { + this.url = null; + } + @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - RemoteWorkspaceURL that = (RemoteWorkspaceURL) o; - return isHttps == that.isHttps && - Objects.equals(host, that.host) && - Objects.equals(port, that.port) && - Objects.equals(web, that.web) && - Objects.equals(servlet, that.servlet); + return o instanceof RemoteWorkspaceURL && AssistUtils.equals(isHttps, ((RemoteWorkspaceURL) o).isHttps) + && AssistUtils.equals(host, ((RemoteWorkspaceURL) o).host) + && AssistUtils.equals(port, ((RemoteWorkspaceURL) o).port) + && AssistUtils.equals(web, ((RemoteWorkspaceURL) o).web) + && AssistUtils.equals(servlet, ((RemoteWorkspaceURL) o).servlet) + && AssistUtils.equals(url, ((RemoteWorkspaceURL) o).url); } @Override public int hashCode() { - return Objects.hash(isHttps, host, port, web, servlet); + return AssistUtils.hashCode(isHttps, host, port, web, servlet, url); } @Override diff --git a/designer-base/src/test/java/com/fr/env/RemoteEnvURLTest.java b/designer-base/src/test/java/com/fr/env/RemoteWorkspaceURLTest.java similarity index 81% rename from designer-base/src/test/java/com/fr/env/RemoteEnvURLTest.java rename to designer-base/src/test/java/com/fr/env/RemoteWorkspaceURLTest.java index 2c6a0ab39a..731093c153 100644 --- a/designer-base/src/test/java/com/fr/env/RemoteEnvURLTest.java +++ b/designer-base/src/test/java/com/fr/env/RemoteWorkspaceURLTest.java @@ -8,7 +8,40 @@ import static org.junit.Assert.assertEquals; /** * @author yaohwu */ -public class RemoteEnvURLTest { +public class RemoteWorkspaceURLTest { + + + @Test + public void testUrlReset() { + + String a = "https://yaohwu:8080/webroot/app/c/d"; + RemoteWorkspaceURL workspaceURL = new RemoteWorkspaceURL(a); + Assert.assertEquals(a, workspaceURL.getURL()); + Assert.assertEquals("app", workspaceURL.getServlet()); + Assert.assertEquals("webroot", workspaceURL.getWeb()); + Assert.assertEquals("yaohwu", workspaceURL.getHost()); + Assert.assertEquals("8080", workspaceURL.getPort()); + Assert.assertTrue(workspaceURL.getHttps()); + + workspaceURL.setHttps(false); + workspaceURL.setHost("finereport"); + + Assert.assertEquals(a, workspaceURL.getURL()); + Assert.assertEquals("app", workspaceURL.getServlet()); + Assert.assertEquals("webroot", workspaceURL.getWeb()); + Assert.assertEquals("finereport", workspaceURL.getHost()); + Assert.assertEquals("8080", workspaceURL.getPort()); + Assert.assertFalse(workspaceURL.getHttps()); + + workspaceURL.resetUrl(); + + Assert.assertEquals("http://finereport:8080/webroot/app", workspaceURL.getURL()); + Assert.assertEquals("app", workspaceURL.getServlet()); + Assert.assertEquals("webroot", workspaceURL.getWeb()); + Assert.assertEquals("finereport", workspaceURL.getHost()); + Assert.assertEquals("8080", workspaceURL.getPort()); + Assert.assertFalse(workspaceURL.getHttps()); + } @Test public void testURLParser() { From c15d8fdd5a52a9026eb85de9fd60971761078a1d Mon Sep 17 00:00:00 2001 From: "yaoh.wu" Date: Fri, 27 Sep 2019 14:51:29 +0800 Subject: [PATCH 07/95] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20toString=20=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E5=B1=95=E7=A4=BA=E5=AE=8C=E6=95=B4=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer-base/src/main/java/com/fr/env/RemoteWorkspaceURL.java | 1 + 1 file changed, 1 insertion(+) diff --git a/designer-base/src/main/java/com/fr/env/RemoteWorkspaceURL.java b/designer-base/src/main/java/com/fr/env/RemoteWorkspaceURL.java index 06e38a5cc8..dee40422c7 100644 --- a/designer-base/src/main/java/com/fr/env/RemoteWorkspaceURL.java +++ b/designer-base/src/main/java/com/fr/env/RemoteWorkspaceURL.java @@ -196,6 +196,7 @@ public class RemoteWorkspaceURL implements FCloneable { ", port='" + port + '\'' + ", web='" + web + '\'' + ", servlet='" + servlet + '\'' + + ", url='" + url + '\'' + '}'; } From 578b9a8b94d4fe452c710cd18cc8f31236e872c4 Mon Sep 17 00:00:00 2001 From: "yaoh.wu" Date: Fri, 27 Sep 2019 14:56:40 +0800 Subject: [PATCH 08/95] =?UTF-8?q?hashCode=20=E5=92=8C=20equals=20=E5=8D=95?= =?UTF-8?q?=E5=85=83=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/env/RemoteWorkspaceURLTest.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/designer-base/src/test/java/com/fr/env/RemoteWorkspaceURLTest.java b/designer-base/src/test/java/com/fr/env/RemoteWorkspaceURLTest.java index 731093c153..f066ae6896 100644 --- a/designer-base/src/test/java/com/fr/env/RemoteWorkspaceURLTest.java +++ b/designer-base/src/test/java/com/fr/env/RemoteWorkspaceURLTest.java @@ -4,6 +4,7 @@ import org.junit.Assert; import org.junit.Test; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotEquals; /** * @author yaohwu @@ -11,6 +12,18 @@ import static org.junit.Assert.assertEquals; public class RemoteWorkspaceURLTest { + @Test + public void testEqualAndHashCode() { + String a = "https://yaohwu:8080/webroot/app/c/d"; + RemoteWorkspaceURL workspaceURL1 = new RemoteWorkspaceURL(a); + RemoteWorkspaceURL workspaceURL2 = new RemoteWorkspaceURL(a); + assertEquals(workspaceURL1.hashCode(), workspaceURL2.hashCode()); + assertEquals(workspaceURL1, workspaceURL2); + workspaceURL2.resetUrl(); + assertNotEquals(workspaceURL1.hashCode(), workspaceURL2.hashCode()); + assertNotEquals(workspaceURL1, workspaceURL2); + } + @Test public void testUrlReset() { From 3c4c2cbd4635998cb88726230ccb84ba11c69f03 Mon Sep 17 00:00:00 2001 From: "Bruce.Deng" Date: Sun, 29 Sep 2019 11:52:22 +0800 Subject: [PATCH 09/95] =?UTF-8?q?REPORT-21556=20=E5=AF=BC=E5=85=A5excel?= =?UTF-8?q?=E4=B8=8D=E6=98=BE=E7=A4=BA=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/javascript/Commit2DBJavaScriptPane.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/javascript/Commit2DBJavaScriptPane.java b/designer-base/src/main/java/com/fr/design/javascript/Commit2DBJavaScriptPane.java index dbccb7c50c..d408950237 100644 --- a/designer-base/src/main/java/com/fr/design/javascript/Commit2DBJavaScriptPane.java +++ b/designer-base/src/main/java/com/fr/design/javascript/Commit2DBJavaScriptPane.java @@ -149,6 +149,8 @@ public class Commit2DBJavaScriptPane extends FurtherBasicBeanPane Date: Tue, 8 Oct 2019 18:34:44 +0800 Subject: [PATCH 10/95] =?UTF-8?q?REPORT-22410=2010.0=E5=88=A0=E9=99=A4tab?= =?UTF-8?q?=E6=97=B6=E5=BC=B9=E7=AA=97=E5=86=99=E7=9A=84Finereport8.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/creator/cardlayout/XCardSwitchButton.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java index 72d0669c83..b1f1fb636b 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java @@ -32,6 +32,7 @@ import com.fr.general.ComparatorUtils; import com.fr.general.FRFont; import com.fr.general.cardtag.TemplateStyle; +import com.fr.stable.ProductConstants; import com.fr.stable.unit.PT; import javax.swing.Action; @@ -221,7 +222,7 @@ public class XCardSwitchButton extends XButton { private void deleteCard(XCardSwitchButton button, int index){ String titleName = button.getContentLabel().getText(); int value = JOptionPane.showConfirmDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Confirm_Dialog_Content") + "“" + titleName + "”", - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_ConfirmDialog_Title"), JOptionPane.YES_NO_OPTION); + ProductConstants.PRODUCT_NAME, JOptionPane.YES_NO_OPTION); if (value != JOptionPane.OK_OPTION) { return; } @@ -363,7 +364,7 @@ public class XCardSwitchButton extends XButton { private void deleteTabLayout(SelectionModel selectionModel, FormDesigner designer){ String titleName = this.getContentLabel().getText(); int value = JOptionPane.showConfirmDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Confirm_Dialog_Content") + "“" + titleName + "”", - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_ConfirmDialog_Title"),JOptionPane.YES_NO_OPTION); + ProductConstants.PRODUCT_NAME, JOptionPane.YES_NO_OPTION); if (value != JOptionPane.OK_OPTION) { return; } From a4e936a433ebd5611bc8f8db585dd58083d99fa5 Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 9 Oct 2019 16:12:02 +0800 Subject: [PATCH 11/95] =?UTF-8?q?REPORT-21486=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=20=E5=8F=96=E8=89=B2=E5=99=A8=20=E5=8F=8C=E5=B1=8F?= =?UTF-8?q?=E6=83=85=E5=86=B5=E4=B8=8B=20=E5=9C=A8=E4=BA=A4=E6=8D=A2?= =?UTF-8?q?=E5=B1=8F=E5=B9=95=E4=BD=8D=E7=BD=AE=E5=90=8E=20=E4=BB=8D?= =?UTF-8?q?=E6=9C=89=E4=B8=80=E4=BA=9B=E4=BA=8C=E9=97=AE=E9=A2=98=20&&=20R?= =?UTF-8?q?EPORT-22214=20=E7=A6=81=E6=AD=A2=E4=BF=AE=E6=94=B9=E6=8E=A7?= =?UTF-8?q?=E4=BB=B6js=E4=BA=8B=E4=BB=B6=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/style/color/ColorPicker.java | 96 +++++++++++-------- .../com/fr/design/utils/gui/GUICoreUtils.java | 26 ++--- .../properties/EventPropertyTable.java | 1 + 3 files changed, 68 insertions(+), 55 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/style/color/ColorPicker.java b/designer-base/src/main/java/com/fr/design/style/color/ColorPicker.java index d8816c3e3f..6c1808fc05 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/ColorPicker.java +++ b/designer-base/src/main/java/com/fr/design/style/color/ColorPicker.java @@ -4,7 +4,8 @@ package com.fr.design.style.color; * Created by plough on 2016/12/22. */ -import com.fr.base.BaseUtils; +import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.general.IOUtils; import com.fr.log.FineLoggerFactory; import javax.swing.*; @@ -19,8 +20,7 @@ import java.awt.image.BufferedImage; /** * 取色框 */ -public class ColorPicker extends JDialog implements ActionListener -{ +public class ColorPicker extends JDialog implements ActionListener { private Container container = getContentPane(); // 主容器 private int setCoordinateX; // 取色框x坐标 private int setCoordinateY; // 取色框y坐标 @@ -42,8 +42,7 @@ public class ColorPicker extends JDialog implements ActionListener /** * 构造函数,创建一个取色框窗体 */ - public ColorPicker(ColorSelectable colorSelectable, Boolean setColorRealTime) - { + public ColorPicker(ColorSelectable colorSelectable, Boolean setColorRealTime) { setUndecorated(true); // 去掉窗体边缘 setResizable(false); Shape shape = new Ellipse2D.Double(0, 0, colorPickerSize, colorPickerSize); @@ -77,7 +76,6 @@ public class ColorPicker extends JDialog implements ActionListener } colorPickerPanel.captureScreen(); } -// System.out.println(KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusedWindow()); } /** @@ -94,11 +92,33 @@ public class ColorPicker extends JDialog implements ActionListener public void updateLocation() { mousePos = MouseInfo.getPointerInfo().getLocation(); - setCoordinateX = mousePos.x - getSize().width/2; - setCoordinateY = mousePos.y- getSize().height/2; + updateCoordinate(); + setLocation(setCoordinateX, setCoordinateY); + updateMousePos(); + updateCoordinate(); colorPickerPanel.setMagnifierLocation(setCoordinateX, setCoordinateY); - setLocation(setCoordinateX, setCoordinateY); + + } + + private void updateCoordinate() { + setCoordinateX = mousePos.x - getSize().width / 2; + setCoordinateY = mousePos.y - getSize().height / 2; + } + + /** + * 兼容多屏下鼠标位置的计算 + */ + private void updateMousePos() { + Rectangle bounds = GUICoreUtils.getRectScreen(); + mousePos.x -= bounds.x; + mousePos.y -= bounds.y; + if (mousePos.x < 0) { + mousePos.x *= -1; + } + if (mousePos.y < 0) { + mousePos.y *= -1; + } } /** @@ -106,8 +126,7 @@ public class ColorPicker extends JDialog implements ActionListener * * @param colorPickerSize 取色框尺寸 */ - public void updateSize(int colorPickerSize) - { + public void updateSize(int colorPickerSize) { colorPickerPanel.setColorPickerSize(colorPickerSize); setSize(colorPickerSize, colorPickerSize); validate(); // 更新所有子控件 @@ -124,20 +143,19 @@ public class ColorPicker extends JDialog implements ActionListener // 隐藏鼠标光标 public void hideCursor() { Image imageCursor = Toolkit.getDefaultToolkit().getImage(""); - Cursor cu = Toolkit.getDefaultToolkit().createCustomCursor(imageCursor, new Point(0,0), "cursor"); + Cursor cu = Toolkit.getDefaultToolkit().createCustomCursor(imageCursor, new Point(0, 0), "cursor"); setCursor(cu); } - private class MouseFunctions extends MouseAdapter - { + private class MouseFunctions extends MouseAdapter { + @Override public void mousePressed(MouseEvent e) { - pickComplete(e.getButton() == e.BUTTON1); // 左键确定 + pickComplete(e.getButton() == MouseEvent.BUTTON1); // 左键确定 } } } -class ColorPickerPanel extends JPanel -{ +class ColorPickerPanel extends JPanel { private BufferedImage screenImage; private Image colorPickerFrame; // 取色框的边框图案 private int colorPickerSize; // 取色框尺寸 @@ -154,11 +172,11 @@ class ColorPickerPanel extends JPanel /** * 带参数的构造函数 - * @param scaleFactor 放大倍数 + * + * @param scaleFactor 放大倍数 */ - public ColorPickerPanel(int scaleFactor) - { - colorPickerFrame = BaseUtils.readImage("/com/fr/design/images/gui/colorPicker/colorPickerFrame.png"); + public ColorPickerPanel(int scaleFactor) { + colorPickerFrame = IOUtils.readImage("/com/fr/design/images/gui/colorPicker/colorPickerFrame.png"); this.scaleFactor = scaleFactor; captureScreen(); } @@ -169,25 +187,20 @@ class ColorPickerPanel extends JPanel public void captureScreen() { try { robot = new Robot(); - } - catch (AWTException e) { + } catch (AWTException e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); } // 截屏幕 - Rectangle rectangle = new Rectangle(0, 0, 0, 0); - for (GraphicsDevice gd : GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices()) { - rectangle = rectangle.union(gd.getDefaultConfiguration().getBounds()); - } - screenImage = robot.createScreenCapture(rectangle); + screenImage = robot.createScreenCapture(GUICoreUtils.getRectScreen()); } /** * 设置取色框的位置 - * @param locationX x坐标 - * @param locationY y坐标 + * + * @param locationX x坐标 + * @param locationY y坐标 */ - public void setMagnifierLocation(int locationX, int locationY) - { + public void setMagnifierLocation(int locationX, int locationY) { this.locationX = locationX; this.locationY = locationY; repaint(); // 注意重画控件 @@ -201,17 +214,16 @@ class ColorPickerPanel extends JPanel return new Color(R, G, B); } - public void setColorPickerSize(int colorPickerSize) - { + public void setColorPickerSize(int colorPickerSize) { this.colorPickerSize = colorPickerSize; } - public void paintComponent(Graphics g) - { + @Override + public void paintComponent(Graphics g) { Graphics2D g2d = (Graphics2D) g; - g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON); + g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); - double pixelCount = (double)colorPickerSize / scaleFactor; // 取色器一条边上的放大后的像素点个数(可以是小数) + double pixelCount = (double) colorPickerSize / scaleFactor; // 取色器一条边上的放大后的像素点个数(可以是小数) // 关键处理代码 g2d.drawImage( screenImage, // 要画的图片 @@ -219,10 +231,10 @@ class ColorPickerPanel extends JPanel 0, // 目标矩形的第一个角的y坐标 colorPickerSize, // 目标矩形的第二个角的x坐标 colorPickerSize, // 目标矩形的第二个角的y坐标 - locationX + (int)((colorPickerSize - pixelCount) * 0.5) + 1, // 源矩形的第一个角的x坐标 - locationY + (int)((colorPickerSize - pixelCount) * 0.5) + 1, // 源矩形的第一个角的y坐标 - locationX + (int)((colorPickerSize + pixelCount) * 0.5) + 1, // 源矩形的第二个角的x坐标 - locationY + (int)((colorPickerSize + pixelCount) * 0.5) + 1, // 源矩形的第二个角的y坐标 + locationX + (int) ((colorPickerSize - pixelCount) * 0.5) + 1, // 源矩形的第一个角的x坐标 + locationY + (int) ((colorPickerSize - pixelCount) * 0.5) + 1, // 源矩形的第一个角的y坐标 + locationX + (int) ((colorPickerSize + pixelCount) * 0.5) + 1, // 源矩形的第二个角的x坐标 + locationY + (int) ((colorPickerSize + pixelCount) * 0.5) + 1, // 源矩形的第二个角的y坐标 this ); g2d.drawImage(colorPickerFrame, 0, 0, this); diff --git a/designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java b/designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java index c8c0561c90..fdc0d0f0c7 100644 --- a/designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java +++ b/designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java @@ -60,19 +60,7 @@ import javax.swing.border.TitledBorder; import javax.swing.event.ChangeListener; import javax.swing.tree.TreeNode; import javax.swing.tree.TreePath; -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Component; -import java.awt.Cursor; -import java.awt.Dimension; -import java.awt.FlowLayout; -import java.awt.Font; -import java.awt.GridLayout; -import java.awt.Image; -import java.awt.Point; -import java.awt.Rectangle; -import java.awt.Toolkit; -import java.awt.Window; +import java.awt.*; import java.awt.event.ActionListener; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; @@ -962,4 +950,16 @@ public final class GUICoreUtils { } return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 0, 10); } + + /** + * 获取当前所有显示器设备的总长总宽 + * @return + */ + public static Rectangle getRectScreen() { + Rectangle rectangle = new Rectangle(0, 0, 0, 0); + for (GraphicsDevice gd : GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices()) { + rectangle = rectangle.union(gd.getDefaultConfiguration().getBounds()); + } + return rectangle; + } } diff --git a/designer-form/src/main/java/com/fr/design/designer/properties/EventPropertyTable.java b/designer-form/src/main/java/com/fr/design/designer/properties/EventPropertyTable.java index 1592b0fd01..ec953b9da3 100644 --- a/designer-form/src/main/java/com/fr/design/designer/properties/EventPropertyTable.java +++ b/designer-form/src/main/java/com/fr/design/designer/properties/EventPropertyTable.java @@ -28,6 +28,7 @@ public class EventPropertyTable extends UIListControlPane { public EventPropertyTable(FormDesigner designer) { super(); + this.setNameListEditable(false); this.designer = designer; } From 514844ae5f9f767f7ecfb9b83492104c7ec58524 Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 9 Oct 2019 16:16:04 +0800 Subject: [PATCH 12/95] update --- .../com/fr/design/utils/gui/GUICoreUtils.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java b/designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java index fdc0d0f0c7..22107bf8ad 100644 --- a/designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java +++ b/designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java @@ -60,12 +60,26 @@ import javax.swing.border.TitledBorder; import javax.swing.event.ChangeListener; import javax.swing.tree.TreeNode; import javax.swing.tree.TreePath; -import java.awt.*; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Component; +import java.awt.Cursor; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.GridLayout; +import java.awt.Image; +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.Toolkit; +import java.awt.Window; import java.awt.event.ActionListener; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import java.awt.image.BufferedImage; import java.awt.image.ImageObserver; +import java.awt.GraphicsDevice; +import java.awt.GraphicsEnvironment; import java.util.ArrayList; import java.util.Arrays; import java.util.List; From 9b076c24ed44f4e1dfaf61ec9dfc7a82a331813d Mon Sep 17 00:00:00 2001 From: Bryant Date: Fri, 11 Oct 2019 10:15:07 +0800 Subject: [PATCH 13/95] =?UTF-8?q?REPORT-22389=20jar=E5=8D=A0=E7=94=A8?= =?UTF-8?q?=E8=BF=98=E5=8E=9F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/update/actions/RecoverForDesigner.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/update/actions/RecoverForDesigner.java b/designer-base/src/main/java/com/fr/design/update/actions/RecoverForDesigner.java index 60decb8735..318beb5fc7 100644 --- a/designer-base/src/main/java/com/fr/design/update/actions/RecoverForDesigner.java +++ b/designer-base/src/main/java/com/fr/design/update/actions/RecoverForDesigner.java @@ -3,6 +3,7 @@ package com.fr.design.update.actions; import com.fr.decision.update.backup.Recover; import com.fr.decision.update.data.UpdateConstants; import com.fr.decision.update.exception.UpdateException; +import com.fr.general.CommonIOUtils; import com.fr.general.GeneralUtils; import com.fr.general.IOUtils; import com.fr.log.FineLoggerFactory; @@ -24,7 +25,7 @@ public class RecoverForDesigner implements Recover { @Override public boolean recover() { try{ - IOUtils.copyFilesInDirByPath(StableUtils.pathJoin(StableUtils.getInstallHome(), UpdateConstants.DESIGNERBACKUPPATH), + CommonIOUtils.copyFilesInDirByPath(StableUtils.pathJoin(StableUtils.getInstallHome(), UpdateConstants.DESIGNERBACKUPPATH), StableUtils.pathJoin(StableUtils.getInstallHome(), ProjectConstants.LIB_NAME)); return true; } catch (IOException ignore) { From 9f04e9d32809ecd005098f3fb3fdf2b3397194ea Mon Sep 17 00:00:00 2001 From: shine Date: Fri, 11 Oct 2019 18:47:34 +0800 Subject: [PATCH 14/95] =?UTF-8?q?CHART-10750=20&&=20CHART-10749=20fix:?= =?UTF-8?q?=E8=AF=8D=E4=BA=91=E5=92=8C=E5=A4=9A=E5=B1=82=E9=A5=BC=E5=9B=BE?= =?UTF-8?q?=20=E6=95=B0=E6=8D=AE=E9=85=8D=E7=BD=AE=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MultiPieIndependentVanChartInterface.java | 15 +++++++++++++++ .../WordCloudIndependentVanChartInterface.java | 15 +++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/designer-chart/src/main/java/com/fr/van/chart/multilayer/MultiPieIndependentVanChartInterface.java b/designer-chart/src/main/java/com/fr/van/chart/multilayer/MultiPieIndependentVanChartInterface.java index d6fe79390d..c7a44d1b88 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/multilayer/MultiPieIndependentVanChartInterface.java +++ b/designer-chart/src/main/java/com/fr/van/chart/multilayer/MultiPieIndependentVanChartInterface.java @@ -4,8 +4,13 @@ import com.fr.chart.chartattr.Plot; import com.fr.design.beans.BasicBeanPane; import com.fr.design.condition.ConditionAttributesPane; import com.fr.design.i18n.Toolkit; +import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.ChartStylePane; +import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane; +import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane; +import com.fr.van.chart.multilayer.data.MultiPiePlotReportDataContentPane; +import com.fr.van.chart.multilayer.data.MultiPiePlotTableDataContentPane; import com.fr.van.chart.multilayer.other.VanChartMultiPieConditionPane; import com.fr.van.chart.multilayer.style.VanChartMultiPieSeriesPane; import com.fr.van.chart.vanchart.AbstractIndependentVanChartUI; @@ -36,6 +41,16 @@ public class MultiPieIndependentVanChartInterface extends AbstractIndependentVan }; } + @Override + public AbstractTableDataContentPane getTableDataSourcePane(Plot plot, ChartDataPane parent) { + return new MultiPiePlotTableDataContentPane(parent); + } + + @Override + public AbstractReportDataContentPane getReportDataSourcePane(Plot plot, ChartDataPane parent) { + return new MultiPiePlotReportDataContentPane(parent); + } + // @Override // public ChartDataPane getChartDataPane(AttributeChangeListener listener) { // return new AbstractDataPane(listener) { diff --git a/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/WordCloudIndependentVanChartInterface.java b/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/WordCloudIndependentVanChartInterface.java index 62356028fc..ff4b9bbce8 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/WordCloudIndependentVanChartInterface.java +++ b/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/WordCloudIndependentVanChartInterface.java @@ -8,13 +8,18 @@ import com.fr.design.dialog.BasicPane; import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.chart.AbstractChartAttrPane; +import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.ChartStylePane; +import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane; +import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane; import com.fr.plugin.chart.base.VanChartConstants; import com.fr.van.chart.designer.other.VanChartInteractivePaneWithOutSort; import com.fr.van.chart.designer.other.VanChartOtherPane; import com.fr.van.chart.designer.style.VanChartStylePane; import com.fr.van.chart.vanchart.AbstractIndependentVanChartUI; +import com.fr.van.chart.wordcloud.designer.data.WordCloudPlotReportDataContentPane; +import com.fr.van.chart.wordcloud.designer.data.WordCloudPlotTableDataContentPane; import com.fr.van.chart.wordcloud.designer.other.VanChartWordCloudConditionPane; import com.fr.van.chart.wordcloud.designer.style.VanChartWordCloudSeriesPane; import com.fr.van.chart.wordcloud.designer.type.VanChartWordCloudTypePane; @@ -57,6 +62,16 @@ public class WordCloudIndependentVanChartInterface extends AbstractIndependentVa return "com/fr/design/images/form/toolbar/wordcloud.png"; } + @Override + public AbstractReportDataContentPane getReportDataSourcePane(Plot plot, ChartDataPane parent) { + return new WordCloudPlotReportDataContentPane(); + } + + @Override + public AbstractTableDataContentPane getTableDataSourcePane(Plot plot, ChartDataPane parent) { + return new WordCloudPlotTableDataContentPane(); + } + @Override public BasicBeanPane getPlotSeriesPane(ChartStylePane parent, Plot plot) { return new VanChartWordCloudSeriesPane(parent, plot); From 5002c3eb1b1e5dfd4912bfc5058f0249ba453227 Mon Sep 17 00:00:00 2001 From: shine Date: Sat, 12 Oct 2019 14:58:08 +0800 Subject: [PATCH 15/95] =?UTF-8?q?CHART-10710=20=E5=85=BC=E5=AE=B9=20?= =?UTF-8?q?=E6=80=A7=E8=83=BD=E6=8F=92=E4=BB=B6=E4=BD=BF=E7=94=A8=20cc.get?= =?UTF-8?q?Chart?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/chart/ChartCommonWizardPane.java | 2 +- .../java/com/fr/design/chart/ChartTypePane.java | 2 +- .../mainframe/MiddleChartPropertyPane.java | 10 ++++++---- .../fr/design/mainframe/chart/ChartEditPane.java | 2 +- .../mainframe/chart/gui/ChartTypeButtonPane.java | 12 ++++++------ .../mainframe/chart/gui/ChartTypePane.java | 16 ++++++++-------- 6 files changed, 23 insertions(+), 21 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/chart/ChartCommonWizardPane.java b/designer-chart/src/main/java/com/fr/design/chart/ChartCommonWizardPane.java index 6ff6e0639d..e4de3686ef 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/ChartCommonWizardPane.java +++ b/designer-chart/src/main/java/com/fr/design/chart/ChartCommonWizardPane.java @@ -12,7 +12,7 @@ public abstract class ChartCommonWizardPane extends ChartWizardPane { return; } - populate(cc.getSelectedChartProvider()); + populate(cc.getSelectedChart(ChartProvider.class)); } public abstract void populate(ChartProvider chart); diff --git a/designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java b/designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java index 8233e68e80..3cc9ba6a72 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java +++ b/designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java @@ -123,7 +123,7 @@ public class ChartTypePane extends ChartCommonWizardPane { return; } - ChartProvider chart4Update = cc.getSelectedChartProvider(); + ChartProvider chart4Update = cc.getSelectedChart(ChartProvider.class); if (chart4Update == null) { String plotID = this.chartIDs[mainTypeList.getSelectedIndex()]; ChartProvider chart = ChartTypeManager.getInstance().getCharts(plotID)[iconViewList.getSelectedIndex()]; diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/MiddleChartPropertyPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/MiddleChartPropertyPane.java index 1b2a85668f..7d77a0ac60 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/MiddleChartPropertyPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/MiddleChartPropertyPane.java @@ -6,6 +6,7 @@ package com.fr.design.mainframe; import com.fr.base.BaseUtils; import com.fr.base.chart.BaseChartCollection; import com.fr.chart.chartattr.ChartCollection; +import com.fr.chartx.attr.ChartProvider; import com.fr.design.ChartTypeInterfaceManager; import com.fr.design.designer.TargetComponent; import com.fr.design.gui.chart.BaseChartPropertyPane; @@ -14,11 +15,12 @@ import com.fr.design.gui.frpane.UITitlePanel; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itabpane.TitleChangeListener; import com.fr.design.mainframe.chart.ChartEditPane; - import com.fr.stable.StableUtils; -import javax.swing.*; -import java.awt.*; +import javax.swing.BorderFactory; +import javax.swing.Icon; +import javax.swing.JComponent; +import java.awt.BorderLayout; public abstract class MiddleChartPropertyPane extends BaseChartPropertyPane{ @@ -91,7 +93,7 @@ public abstract class MiddleChartPropertyPane extends BaseChartPropertyPane{ * @param ePane 面板 */ public void populateChartPropertyPane(ChartCollection collection, TargetComponent ePane) { - addChartEditPane(collection.getSelectedChartProvider().getID()); + addChartEditPane(collection.getSelectedChart(ChartProvider.class).getID()); setSupportCellData(true); this.container.setEPane(ePane); chartEditPane.populate(collection); diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartEditPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartEditPane.java index 5ecfa1071c..6bd6383212 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartEditPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartEditPane.java @@ -230,7 +230,7 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4 return; } - ChartProvider chartProvider = collection.getSelectedChartProvider(); + ChartProvider chartProvider = collection.getSelectedChart(ChartProvider.class); if (checkNeedsReLayout(chartProvider)) { String chartID = chartProvider.getID(); if ("WaferChipChart".equals(chartID) || "BoxPlotChart".equals(chartID)) { diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java index 880c1a7792..7d64588c50 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java @@ -176,7 +176,7 @@ public class ChartTypeButtonPane extends BasicBeanPane implemen * @return */ public ChartProvider getChangeStateNewChart() { - ChartProvider chart = editingCollection.getSelectedChartProvider(); + ChartProvider chart = editingCollection.getSelectedChart(ChartProvider.class); String chartID = chart.getID(); String priority = ChartTypeManager.getInstanceWithCheck().getPriority(chartID); return ChartTypeManager.getInstanceWithCheck().getFirstChart(priority); @@ -199,7 +199,7 @@ public class ChartTypeButtonPane extends BasicBeanPane implemen } private boolean supportChange() { - return supportChangeConfigChartClassSet.contains(editingCollection.getSelectedChartProvider().getClass()); + return supportChangeConfigChartClassSet.contains(editingCollection.getSelectedChart(ChartProvider.class).getClass()); } ActionListener configListener = new ActionListener() { @@ -354,9 +354,9 @@ public class ChartTypeButtonPane extends BasicBeanPane implemen } private void checkConfigButtonVisible() { - addButton.setVisible(ChartTypeManager.enabledChart(editingCollection.getSelectedChartProvider().getID())); + addButton.setVisible(ChartTypeManager.enabledChart(editingCollection.getSelectedChart(ChartProvider.class).getID())); //新建一个collection - if (editingCollection.getChartCount() == 1 && editingCollection.getSelectedChartProvider() != null) { + if (editingCollection.getChartCount() == 1 && editingCollection.getSelectedChart(ChartProvider.class) != null) { //Chart 不支持图表切换 configButton.setVisible(supportChange()); } @@ -484,7 +484,7 @@ public class ChartTypeButtonPane extends BasicBeanPane implemen private void deleteAButton() { //先重构属性,在重构面板,否则面板在重构过程中,会重新将属性中的切换图表加到indexList中,导致面板无法删除 //记录改变前的plotID - String lastPlotID = editingCollection == null ? StringUtils.EMPTY : editingCollection.getSelectedChartProvider().getID(); + String lastPlotID = editingCollection == null ? StringUtils.EMPTY : editingCollection.getSelectedChart(ChartProvider.class).getID(); if (editingCollection != null) { int count = editingCollection.getChartCount(); for (int i = 0; i < count; i++) { @@ -564,7 +564,7 @@ public class ChartTypeButtonPane extends BasicBeanPane implemen if (isEnabled()) { noSelected(); //记录改变前的plotID - String lastPlotID = editingCollection == null ? StringUtils.EMPTY : editingCollection.getSelectedChartProvider().getID(); + String lastPlotID = editingCollection == null ? StringUtils.EMPTY : editingCollection.getSelectedChart(ChartProvider.class).getID(); changeCollectionSelected(getButtonName()); setSelectedWithFireListener(true); fireSelectedChanged(); diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java index 77e75a69a1..26f0a38e9c 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java @@ -19,15 +19,15 @@ import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.CardLayout; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; import java.util.ArrayList; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import java.awt.BorderLayout; -import java.awt.CardLayout; -import java.awt.event.ItemEvent; -import java.awt.event.ItemListener; /** * 图表 属性表, 类型选择 界面. @@ -208,7 +208,7 @@ public class ChartTypePane extends AbstractChartAttrPane{ //处理办法:这边除了重构 下拉项选项和cardNames 还需要把cards重构下(不需要init pane,只需要我需要的拿出来就好了) private void relayout(ChartCollection collection){ //重构需要重构下拉框选项和cardNames - ChartProvider chart = collection.getSelectedChartProvider(); + ChartProvider chart = collection.getSelectedChart(ChartProvider.class); String chartID = chart.getID(); String priority = ChartTypeManager.getInstanceWithCheck().getPriority(chartID); boolean enabledChart = ChartTypeManager.enabledChart(chartID); @@ -294,7 +294,7 @@ public class ChartTypePane extends AbstractChartAttrPane{ * @param collection */ public void reLayoutEditPane(String lastPlotID, ChartCollection collection){ - ChartProvider chart = collection.getSelectedChartProvider(); + ChartProvider chart = collection.getSelectedChart(ChartProvider.class); String plotID = chart.getID(); boolean isUseDefault = ChartTypeInterfaceManager.getInstance().isUseDefaultPane(plotID); if (editPane != null && editPane.isDefaultPane() != isUseDefault || (!isUseDefault && !ComparatorUtils.equals(lastPlotID, plotID))){ @@ -315,7 +315,7 @@ public class ChartTypePane extends AbstractChartAttrPane{ public void populate(ChartCollection collection) { editingCollection = collection; - ChartProvider chart = collection.getSelectedChartProvider(); + ChartProvider chart = collection.getSelectedChart(ChartProvider.class); this.remove(leftContentPane); initContentPane(); @@ -333,7 +333,7 @@ public class ChartTypePane extends AbstractChartAttrPane{ public void update(ChartCollection collection) { editingCollection = collection; buttonPane.update(collection);// 内部操作时 已经做过处理. - ChartProvider chart = collection.getSelectedChartProvider(); + ChartProvider chart = collection.getSelectedChart(ChartProvider.class); chartTypeComBox.updateBean(chart); } From a7b0f60248ba5b7f8401b7f90e470d10b849f06f Mon Sep 17 00:00:00 2001 From: author Date: Sat, 12 Oct 2019 15:27:56 +0800 Subject: [PATCH 16/95] =?UTF-8?q?REPORT-22339=20=E8=BF=9C=E7=A8=8B?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E7=AE=A1=E7=90=86=E6=9D=83=E9=99=90=E4=B8=AD?= =?UTF-8?q?=EF=BC=8C=E6=96=B0=E5=BB=BA=E5=A4=9A=E4=B8=AA=E8=A7=92=E8=89=B2?= =?UTF-8?q?=EF=BC=8C=E8=BF=9B=E8=A1=8C=E5=88=A0=E9=99=A4=E6=97=B6=E4=BC=9A?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=EF=BC=8C=E4=BD=86=E6=98=AF=E5=B9=B6=E6=9C=AA?= =?UTF-8?q?=E5=AD=98=E5=9C=A8=E8=B5=8B=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/remote/ui/AbstractManagerPane.java | 38 +++++++++++++++---- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/remote/ui/AbstractManagerPane.java b/designer-base/src/main/java/com/fr/design/remote/ui/AbstractManagerPane.java index 10ab1ffd5c..c92a7a8513 100644 --- a/designer-base/src/main/java/com/fr/design/remote/ui/AbstractManagerPane.java +++ b/designer-base/src/main/java/com/fr/design/remote/ui/AbstractManagerPane.java @@ -67,6 +67,12 @@ public abstract class AbstractManagerPane extends BasicPane { */ private List addedMembers = new ArrayList<>(); + + /** + * 具有设计权限的角色/用户 + */ + private List authorityMembers = new ArrayList<>(); + /** * 决策平台用户列表model */ @@ -211,6 +217,9 @@ public abstract class AbstractManagerPane extends BasicPane { resetAddedMembers(); this.addedMembers.addAll(addedMembers); + resetAuthorityMembers(); + this.authorityMembers.addAll(addedMembers); + // 刷新右侧面板 addToAddedMemberList(); @@ -314,15 +323,15 @@ public abstract class AbstractManagerPane extends BasicPane { private void addToMemberList() { addingListModel.clear(); - for (RemoteDesignMember addingMember : addingMembers) { + for (RemoteDesignMember member : addingMembers) { // 如果包含在右侧列表中,那么左侧列表默认选中 - for (RemoteDesignMember addedMember : addedMembers){ - if (addingMember.equals(addedMember)){ - addingMember.setAuthority(addedMember.hasAuthority()); - addingMember.setSelected(true); - } + if (addedMembers.contains(member)) { + member.setSelected(true); + } + else { + member.setSelected(false); } - addingListModel.addElement(addingMember); + addingListModel.addElement(member); } addingList.revalidate(); addingList.repaint(); @@ -350,6 +359,10 @@ public abstract class AbstractManagerPane extends BasicPane { addedMembers.clear(); } + private void resetAuthorityMembers() { + authorityMembers.clear(); + } + protected abstract Collection getMembers(String userName, String keyWord); protected abstract Collection getMembers(String userName, String keyWord, int pageNum, int count); @@ -376,6 +389,7 @@ public abstract class AbstractManagerPane extends BasicPane { @Override protected void done() { + referAddingMemberList(); addToMemberList(); } }; @@ -403,12 +417,22 @@ public abstract class AbstractManagerPane extends BasicPane { @Override protected void done() { + referAddingMemberList(); addToMemberList(); } }; loadMoreWorker.execute(); } + // 检查左侧列表角色/用户是否有权限 + private void referAddingMemberList() { + for (RemoteDesignMember member : addingMembers) { + if (authorityMembers.contains(member)){ + member.setAuthority(true); + } + } + } + private void sync2AddedMembersFromAdding() { RemoteDesignMember[] members = new RemoteDesignMember[addingListModel.getSize()]; From d5a216c38e99ab3e294233b9fab4d85ecc78bed9 Mon Sep 17 00:00:00 2001 From: hades Date: Mon, 14 Oct 2019 11:15:29 +0800 Subject: [PATCH 17/95] =?UTF-8?q?=E3=80=901004=E5=9B=9E=E5=BD=92=E3=80=91?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E9=9D=A2=E6=9D=BF-=E8=B6=85=E7=BA=A7?= =?UTF-8?q?=E9=93=BE=E6=8E=A5-=E7=BD=91=E7=BB=9C=E6=8A=A5=E8=A1=A8-?= =?UTF-8?q?=E5=AF=B9=E8=AF=9D=E6=A1=86=E8=AE=BE=E7=BD=AE=20=E7=A6=81?= =?UTF-8?q?=E6=AD=A2=E8=BE=93=E5=85=A5=E8=B4=9F=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/gui/itextfield/UINumberField.java | 8 ++++++++ .../com/fr/design/hyperlink/ReportletHyperNorthPane.java | 2 ++ 2 files changed, 10 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/gui/itextfield/UINumberField.java b/designer-base/src/main/java/com/fr/design/gui/itextfield/UINumberField.java index 1ffb3c1dde..f71a11f43d 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itextfield/UINumberField.java +++ b/designer-base/src/main/java/com/fr/design/gui/itextfield/UINumberField.java @@ -35,6 +35,7 @@ public class UINumberField extends UITextField { private double maxValue = Double.MAX_VALUE; private boolean isContentChanged = false; + private boolean fillNegativeNumbers = true; public UINumberField() { this(MAX_INTEGERLENGTH_32, MAX_DECIMALLENGTH); @@ -62,6 +63,10 @@ public class UINumberField extends UITextField { initListener(); } + public void canFillNegativeNumber(boolean canFillNegativeNumbers) { + this.fillNegativeNumbers = canFillNegativeNumbers; + } + public int getMaxIntegerLength() { return maxIntegerLength; } @@ -185,6 +190,9 @@ public class UINumberField extends UITextField { // kunsnat: 这种限制输入 有个不好的地方, 比如删除时: 10.1 最大值限定100, 那么就删除中间的小数点之后变为101, 超出了100. // 但是直接限制不能删除中间类似小数点, 那么也可能遇到: 最小值10 , 从100变化到其中的19, 就很难.. private boolean notChange(String strNew) { + if (!fillNegativeNumbers && strNew.contains("-")) { + return true; + } boolean noChange = false; boolean isMinus = strNew.startsWith("-"); strNew = strNew.replaceFirst("-", StringUtils.EMPTY); // 控制能输入负数 diff --git a/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperNorthPane.java b/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperNorthPane.java index c1e454f1b0..43710cd0f2 100644 --- a/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperNorthPane.java +++ b/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperNorthPane.java @@ -368,6 +368,7 @@ public class ReportletHyperNorthPane extends AbstractHyperNorthPane Date: Mon, 14 Oct 2019 11:18:46 +0800 Subject: [PATCH 18/95] update --- .../java/com/fr/design/gui/itextfield/UINumberField.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/itextfield/UINumberField.java b/designer-base/src/main/java/com/fr/design/gui/itextfield/UINumberField.java index f71a11f43d..12b894ddce 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itextfield/UINumberField.java +++ b/designer-base/src/main/java/com/fr/design/gui/itextfield/UINumberField.java @@ -35,7 +35,7 @@ public class UINumberField extends UITextField { private double maxValue = Double.MAX_VALUE; private boolean isContentChanged = false; - private boolean fillNegativeNumbers = true; + private boolean fillNegativeNumber = true; public UINumberField() { this(MAX_INTEGERLENGTH_32, MAX_DECIMALLENGTH); @@ -63,8 +63,8 @@ public class UINumberField extends UITextField { initListener(); } - public void canFillNegativeNumber(boolean canFillNegativeNumbers) { - this.fillNegativeNumbers = canFillNegativeNumbers; + public void canFillNegativeNumber(boolean fillNegativeNumber) { + this.fillNegativeNumber = fillNegativeNumber; } public int getMaxIntegerLength() { @@ -190,7 +190,7 @@ public class UINumberField extends UITextField { // kunsnat: 这种限制输入 有个不好的地方, 比如删除时: 10.1 最大值限定100, 那么就删除中间的小数点之后变为101, 超出了100. // 但是直接限制不能删除中间类似小数点, 那么也可能遇到: 最小值10 , 从100变化到其中的19, 就很难.. private boolean notChange(String strNew) { - if (!fillNegativeNumbers && strNew.contains("-")) { + if (!fillNegativeNumber && strNew.contains("-")) { return true; } boolean noChange = false; From caf12de0894726ac1964bf129e0ed935f55c4d2f Mon Sep 17 00:00:00 2001 From: hades Date: Mon, 14 Oct 2019 11:37:06 +0800 Subject: [PATCH 19/95] =?UTF-8?q?REPORT-22757=E3=80=901004=E5=9B=9E?= =?UTF-8?q?=E5=BD=92=E3=80=91=E8=AE=BE=E8=AE=A1=E9=9D=A2=E6=9D=BF-?= =?UTF-8?q?=E9=94=AE=E9=BC=A0=E6=93=8D=E4=BD=9C-=E6=99=BA=E8=83=BD?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8D=95=E5=85=83=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/ElementCasePane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePane.java b/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePane.java index a281561103..4e12bd5f85 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePane.java @@ -863,7 +863,7 @@ public abstract class ElementCasePane extends Tar // those that are interested in this event for (int i = listeners.length - 2; i >= 0; i -= 2) { if (listeners[i] == SelectionListener.class) { - ((SelectionListener) listeners[i + 1]).selectionChanged(new SelectionEvent(this)); + ((SelectionListener) listeners[i + 1]).selectionChanged(new SelectionEvent(ElementCasePane.this)); } } } From cbe8ae87ab1bbf78cdb55750ee8ed179ad87db15 Mon Sep 17 00:00:00 2001 From: WeiYanglu Date: Mon, 14 Oct 2019 18:25:27 +0800 Subject: [PATCH 20/95] =?UTF-8?q?MOBILE-23324=20=E7=A7=BB=E5=8A=A8?= =?UTF-8?q?=E7=AB=AF=E7=BB=84=E4=BB=B6=E8=83=8C=E6=99=AF=E6=8D=A2=E6=88=90?= =?UTF-8?q?=E5=8F=AF=E6=94=AF=E6=8C=81=E8=AE=BE=E7=BD=AE=E9=80=8F=E6=98=8E?= =?UTF-8?q?=E7=9A=84=E9=A2=9C=E8=89=B2=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/mobile/ui/MobileStyleDefinePane.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleDefinePane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleDefinePane.java index 1ec8fe5e51..93c24ad699 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleDefinePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleDefinePane.java @@ -5,7 +5,7 @@ import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.design.style.color.NewColorSelectBox; +import com.fr.design.style.color.ColorSelectBox; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.form.ui.Widget; import com.fr.form.ui.mobile.MobileStyle; @@ -23,7 +23,7 @@ public class MobileStyleDefinePane extends BasicBeanPane { private Widget widget; private MobileStyleCustomDefinePane customBeanPane; private Class mobileStyleClazz; - private NewColorSelectBox colorSelectBox; + private ColorSelectBox colorSelectBox; private Color titleColor = new Color(47, 142, 241); MobileStyleDefinePane(Widget widget, Class customBeanPaneClass, @@ -91,7 +91,7 @@ public class MobileStyleDefinePane extends BasicBeanPane { UILabel colorSelectLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Widget_Background"), UILabel.RIGHT); colorSelectLabel.setPreferredSize(new Dimension(65, 20)); - colorSelectBox = new NewColorSelectBox(152); + colorSelectBox = new ColorSelectBox(152); colorSelectBox.addSelectChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { From a8bc5220feb61d3b55fa81113a858fdcab7ce616 Mon Sep 17 00:00:00 2001 From: shine Date: Tue, 15 Oct 2019 09:52:32 +0800 Subject: [PATCH 21/95] =?UTF-8?q?CHART-10790=20fix:=E6=97=A7=E5=9B=BE?= =?UTF-8?q?=E8=A1=A8-GIS=E5=9C=B0=E5=9B=BE-key=E5=80=BC=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E8=A7=A6=E5=8F=91=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/chart/gui/type/GisMapPlotPane.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/GisMapPlotPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/GisMapPlotPane.java index f12fe344e8..77409e4c02 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/GisMapPlotPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/GisMapPlotPane.java @@ -88,7 +88,12 @@ public class GisMapPlotPane extends AbstractDeprecatedChartTypePane { return ChartConstants.GIS_CHAER; } - protected String[] getTypeLayoutPath() { + @Override + public String getPlotID() { + return ChartConstants.GIS_CHAER; + } + + protected String[] getTypeLayoutPath() { return new String[]{"/com/fr/design/images/chart/GisMapPlot/layout/0.png", "/com/fr/design/images/chart/GisMapPlot/layout/1.png", }; @@ -157,7 +162,6 @@ public class GisMapPlotPane extends AbstractDeprecatedChartTypePane { * 更新界面内容 */ public void populateBean(Chart chart) { - typeDemo.get(0).isPressing = true; GisMapPlot plot = (GisMapPlot) chart.getPlot(); if(plot.isGisType()){ From a0d2c36f9275de30df30a160bc7d45627358e07e Mon Sep 17 00:00:00 2001 From: Harrison Date: Tue, 15 Oct 2019 11:09:17 +0800 Subject: [PATCH 22/95] =?UTF-8?q?REPORT-22768=20=E6=9C=80=E6=96=B0?= =?UTF-8?q?=E7=9A=84release=EF=BC=8C=E5=90=8C=E4=B8=80tomcat=E4=B8=8B?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E9=83=A8=E7=BD=B2=E4=B8=A4=E4=B8=AA=E5=B7=A5?= =?UTF-8?q?=E7=A8=8B=20=E8=B0=83=E6=95=B4=E4=B8=80=E4=B8=8B=E4=B8=B4?= =?UTF-8?q?=E6=97=B6=E6=96=87=E4=BB=B6=E7=9A=84=E5=88=A0=E9=99=A4=E4=BD=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/start/module/PreStartActivator.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/designer-realize/src/main/java/com/fr/start/module/PreStartActivator.java b/designer-realize/src/main/java/com/fr/start/module/PreStartActivator.java index d3aec5897c..6a3e0415d2 100644 --- a/designer-realize/src/main/java/com/fr/start/module/PreStartActivator.java +++ b/designer-realize/src/main/java/com/fr/start/module/PreStartActivator.java @@ -5,6 +5,7 @@ import com.fr.design.RestartHelper; import com.fr.design.i18n.Toolkit; import com.fr.design.utils.DesignUtils; import com.fr.event.EventDispatcher; +import com.fr.file.TmpFileUtils; import com.fr.general.CloudCenter; import com.fr.general.GeneralContext; import com.fr.module.Activator; @@ -17,6 +18,8 @@ public class PreStartActivator extends Activator { @Override public void start() { + //清空临时文件 + TmpFileUtils.cleanUpInnerTmpFiles(); RestartHelper.deleteRecordFilesWhenStart(); //初始化 EventDispatcher.fire(ModuleEvent.MajorModuleStarting, Toolkit.i18nText("Fine-Design_Basic_Initializing")); From 5e6055306b52737d344cb2c2beaa05bc8e042f20 Mon Sep 17 00:00:00 2001 From: "Bruce.Deng" Date: Tue, 15 Oct 2019 11:33:23 +0800 Subject: [PATCH 23/95] =?UTF-8?q?REPORT-21556=20=E5=AF=BC=E5=85=A5excel?= =?UTF-8?q?=E4=B8=8D=E6=98=BE=E7=A4=BA=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/javascript/Commit2DBJavaScriptPane.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/javascript/Commit2DBJavaScriptPane.java b/designer-base/src/main/java/com/fr/design/javascript/Commit2DBJavaScriptPane.java index d408950237..dbccb7c50c 100644 --- a/designer-base/src/main/java/com/fr/design/javascript/Commit2DBJavaScriptPane.java +++ b/designer-base/src/main/java/com/fr/design/javascript/Commit2DBJavaScriptPane.java @@ -149,8 +149,6 @@ public class Commit2DBJavaScriptPane extends FurtherBasicBeanPane Date: Tue, 15 Oct 2019 11:42:44 +0800 Subject: [PATCH 24/95] =?UTF-8?q?REPORT-21017=E3=80=90=E6=96=B0=E5=BC=95?= =?UTF-8?q?=E6=93=8E=E3=80=91=E5=A2=9E=E5=8A=A0cptx=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E5=8F=8A=E7=9B=B8=E5=85=B3=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gui/itree/filetree/FileNodeConstants.java | 4 +- .../gui/itree/filetree/FileTreeIcon.java | 29 ++++++++++-- .../AbstractNewTemplateFileProvider.java | 20 ++++++++ .../com/fr/design/mainframe/JTemplate.java | 32 +++++++++++-- .../mainframe/NewTemplateFileProvider.java | 46 +++++++++++++++++++ .../java/com/fr/file/FILEChooserPane.java | 25 +++++----- .../itree/filetree/FileNodeConstantsTest.java | 39 ++++++++++++---- .../java/com/fr/file/FILEChooserPaneTest.java | 38 +++++++++++++++ .../java/com/fr/design/mainframe/JForm.java | 14 ++++++ .../com/fr/design/mainframe/JWorkBook.java | 9 ++++ 10 files changed, 226 insertions(+), 30 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/AbstractNewTemplateFileProvider.java create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/NewTemplateFileProvider.java create mode 100644 designer-base/src/test/java/com/fr/file/FILEChooserPaneTest.java diff --git a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileNodeConstants.java b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileNodeConstants.java index 8c5f0e154a..256fee21bc 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileNodeConstants.java +++ b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileNodeConstants.java @@ -55,12 +55,14 @@ public class FileNodeConstants { private static void initSupportedTypes() { try { rwl.writeLock().lock(); - supportFileType = new ArrayList<>(Arrays.asList(FRContext.getFileNodes().getSupportedTypes())); + supportFileType = new ArrayList(); //通过插件扩展的 Set apps = ExtraDesignClassManager.getInstance().getArray(App.MARK_STRING); for (App app : apps) { addAppExtensions(app.defaultExtensions()); } + supportFileType.addAll(Arrays.asList(FRContext.getFileNodes().getSupportedTypes())); + } finally { rwl.writeLock().unlock(); } diff --git a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileTreeIcon.java b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileTreeIcon.java index b0e26cc80e..1a84fa1695 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileTreeIcon.java +++ b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileTreeIcon.java @@ -1,7 +1,9 @@ package com.fr.design.gui.itree.filetree; import com.fr.base.BaseUtils; +import com.fr.design.ExtraDesignClassManager; import com.fr.design.icon.LockIcon; +import com.fr.design.mainframe.NewTemplateFileProvider; import com.fr.file.filetree.FileNode; import com.fr.general.ComparatorUtils; import com.fr.stable.StableUtils; @@ -11,6 +13,7 @@ import javax.swing.Icon; import javax.swing.UIManager; import javax.swing.filechooser.FileSystemView; import java.io.File; +import java.util.Set; public class FileTreeIcon { private FileTreeIcon() { @@ -146,16 +149,36 @@ public class FileTreeIcon { if (node.isDirectory()) { return FileTreeIcon.FOLDER_IMAGE_ICON; } - return FileSystemView.getFileSystemView().getSystemIcon(new File(path)); + return getLocalFileIcon(path); } } if (node.isDirectory()) { return FileTreeIcon.FOLDER_IMAGE_ICON; } else { - return FileTreeIcon.getIcon(FileTreeIcon.getFileType(node.getName()), isShowLock); + return getRemoteFileIcon(node, isShowLock); } } + private static Icon getLocalFileIcon(String path) { + Set providers = ExtraDesignClassManager.getInstance().getArray(NewTemplateFileProvider.XML_TAG); + for (NewTemplateFileProvider provider : providers) { + if (provider.getLocalFileIcon(path) != null) { + return provider.getLocalFileIcon(path); + } + } + return FileSystemView.getFileSystemView().getSystemIcon(new File(path)); + } + + private static Icon getRemoteFileIcon(FileNode node, boolean isShowLock){ + Set providers = ExtraDesignClassManager.getInstance().getArray(NewTemplateFileProvider.XML_TAG); + for (NewTemplateFileProvider provider : providers) { + if (provider.getRemoteFileIcon(node, isShowLock) != null) { + return provider.getRemoteFileIcon(node, isShowLock); + } + } + return FileTreeIcon.getIcon(FileTreeIcon.getFileType(node.getName()), isShowLock); + } + private static Icon getIcon(int fileType, boolean isLocked) { if (fileType == JAVA_FILE) { if (isLocked) { @@ -293,4 +316,4 @@ public class FileTreeIcon { return TEXT_FILE; } } -} \ No newline at end of file +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/AbstractNewTemplateFileProvider.java b/designer-base/src/main/java/com/fr/design/mainframe/AbstractNewTemplateFileProvider.java new file mode 100644 index 0000000000..64a6f480fb --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/AbstractNewTemplateFileProvider.java @@ -0,0 +1,20 @@ +package com.fr.design.mainframe; + +import com.fr.stable.fun.mark.API; + +/** + * Created by kerry on 2019-10-14 + */ +@API(level = NewTemplateFileProvider.CURRENT_LEVEL) +public abstract class AbstractNewTemplateFileProvider implements NewTemplateFileProvider { + + @Override + public int currentAPILevel() { + return CURRENT_LEVEL; + } + + @Override + public String mark4Provider() { + return getClass().getName(); + } +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java index 852130c1e0..1daeb4d81e 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java @@ -4,6 +4,7 @@ import com.fr.base.BaseUtils; import com.fr.base.FRContext; import com.fr.base.Parameter; import com.fr.base.ScreenResolution; +import com.fr.base.extension.FileExtension; import com.fr.base.io.BaseBook; import com.fr.base.iofile.attr.DesignBanCopyAttrMark; import com.fr.base.iofile.attr.TemplateIdAttrMark; @@ -12,7 +13,6 @@ import com.fr.design.DesignModelAdapter; import com.fr.design.DesignState; import com.fr.design.DesignerEnvManager; import com.fr.design.ExtraDesignClassManager; -import com.fr.design.actions.AllowAuthorityEditAction; import com.fr.design.actions.TableDataSourceAction; import com.fr.design.actions.edit.RedoAction; import com.fr.design.actions.edit.UndoAction; @@ -49,6 +49,7 @@ import com.fr.design.write.submit.DBManipulationPane; import com.fr.file.FILE; import com.fr.file.FILEChooserPane; import com.fr.file.MemFILE; +import com.fr.file.filter.ChooseFileFilter; import com.fr.form.ui.NoneWidget; import com.fr.form.ui.Widget; import com.fr.general.ComparatorUtils; @@ -575,6 +576,7 @@ public abstract class JTemplate> String oldName = this.getPath(); // alex:如果是SaveAs的话需要让用户来选择路径了 FILEChooserPane fileChooser = getFILEChooserPane(isShowLoc); + addChooseFILEFilter(fileChooser); fileChooser.setFileNameTextField(fileName, this.suffix()); int chooseResult = fileChooser.showSaveDialog(DesignerContext.getDesignerFrame(), this.suffix()); @@ -625,6 +627,16 @@ public abstract class JTemplate> } } + protected void addChooseFILEFilter(FILEChooserPane fileChooser){ + String appName = ProductConstants.APP_NAME; + fileChooser.addChooseFILEFilter(new ChooseFileFilter(FileExtension.CPT, appName + Toolkit.i18nText("Fine-Design_Report_Template_File"))); + if (FileExtension.FRM.matchExtension(this.suffix())) { + // richer:form文件 daniel 改成三个字 + fileChooser.addChooseFILEFilter(new ChooseFileFilter(FileExtension.FRM, appName + Toolkit.i18nText("Fine-Design_Report_Template_File"))); + } + + } + // 保存新模板时会进入此方法(新建模板直接保存,或者另存为) protected boolean saveNewFile(FILE editingFILE, String oldName) { String originID = StringUtils.EMPTY; @@ -635,13 +647,25 @@ public abstract class JTemplate> initForCollect(); this.editingFILE = editingFILE; - boolean result = this.saveFile(); + boolean result = this.saveToNewFile(oldName); if (result) { DesignerFrameFileDealerPane.getInstance().refresh(); collectInfo(originID); } - //更换最近打开 - DesignerEnvManager.getEnvManager().replaceRecentOpenedFilePath(oldName, this.getPath()); + return result; + } + + protected boolean saveToNewFile(String oldName){ + boolean result = false; + Set providers = ExtraDesignClassManager.getInstance().getArray(NewTemplateFileProvider.XML_TAG); + for (NewTemplateFileProvider provider : providers) { + result = result || provider.saveToNewFile(this.editingFILE.getPath(), this); + } + if(!result && FileExtension.CPT.matchExtension(this.editingFILE.getPath())){ + result = result || this.saveFile(); + //更换最近打开 + DesignerEnvManager.getEnvManager().replaceRecentOpenedFilePath(oldName, this.getPath()); + } return result; } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/NewTemplateFileProvider.java b/designer-base/src/main/java/com/fr/design/mainframe/NewTemplateFileProvider.java new file mode 100644 index 0000000000..e14a54d7b5 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/NewTemplateFileProvider.java @@ -0,0 +1,46 @@ +package com.fr.design.mainframe; + +import com.fr.file.FILEChooserPane; +import com.fr.file.filetree.FileNode; +import com.fr.stable.fun.mark.Mutable; + +import javax.swing.Icon; + +/** + * Created by kerry on 2019-10-11 + */ +public interface NewTemplateFileProvider extends Mutable { + + int CURRENT_LEVEL = 1; + + String XML_TAG = "NewFileTypeProvider"; + + /** + * 向文件选择器中添加指定文件类型过滤器 + * @param fileChooser 文件选择器 + * @param suffix 文件后缀 + */ + void addChooseFileFilter(FILEChooserPane fileChooser, String suffix); + + /** + * 获取本地目录文件关联的icon + * @param path 文件路径 + * @return 对应的图标 + */ + Icon getLocalFileIcon(String path); + + /** + * 获取远程目录文件关联的icon + * @param node 文件节点 + * @param isShowLock 是否显示被锁住 + * @return 对应的图标 + */ + Icon getRemoteFileIcon(FileNode node, boolean isShowLock); + + /** + * 保存为新类型文件 + * @param targetPath 目标路径 + * @param jTemplate 模板对象 + */ + boolean saveToNewFile(String targetPath, JTemplate jTemplate); +} diff --git a/designer-base/src/main/java/com/fr/file/FILEChooserPane.java b/designer-base/src/main/java/com/fr/file/FILEChooserPane.java index fc4a5dfea0..7c6e56bb7d 100644 --- a/designer-base/src/main/java/com/fr/file/FILEChooserPane.java +++ b/designer-base/src/main/java/com/fr/file/FILEChooserPane.java @@ -782,12 +782,7 @@ public class FILEChooserPane extends BasicPane { } } //jerry 26216 只保留.cpt .frm有用的格式,并且不可编辑 - if (type == JFileChooser.OPEN_DIALOG) { - postfixComboBox.setEnabled(true); - } else { - postfixComboBox.setEnabled(false); - } - + postfixComboBox.setEnabled(true); //只有一个类型时不可下拉 if (filterList.size() == 1) { postfixComboBox.setEnabled(false); @@ -841,14 +836,7 @@ public class FILEChooserPane extends BasicPane { private void saveDialog() { String filename = fileNameTextField.getText(); - if (!filename.endsWith(suffix)) { - ChooseFileFilter chooseFileFilter = (ChooseFileFilter) (postfixComboBox.getSelectedItem()); - if (chooseFileFilter != null && StringUtils.isNotEmpty(chooseFileFilter.getExtensionString())) { - fileNameTextField.setText(filename + chooseFileFilter.getExtensionString()); - } else { - fileNameTextField.setText(filename + this.suffix); - } - } + fileNameTextField.setText(calFileNameText(filename, (ChooseFileFilter) (postfixComboBox.getSelectedItem()))); option = OK_OPTION; FILE selectedFile = this.getSelectedFILE(); @@ -874,6 +862,15 @@ public class FILEChooserPane extends BasicPane { } } + private String calFileNameText(String currentValue, ChooseFileFilter selectFileFilter) { + if (selectFileFilter == null || StringUtils.isEmpty(selectFileFilter.getExtensionString())) { + return currentValue + this.suffix; + } else if (!currentValue.endsWith(selectFileFilter.getExtensionString())) { + return currentValue + selectFileFilter.getExtensionString(); + } + return currentValue; + } + private boolean access(FILE selectedFile) { boolean access = false; try { diff --git a/designer-base/src/test/java/com/fr/design/gui/itree/filetree/FileNodeConstantsTest.java b/designer-base/src/test/java/com/fr/design/gui/itree/filetree/FileNodeConstantsTest.java index 67f0824567..a12ae6c14e 100644 --- a/designer-base/src/test/java/com/fr/design/gui/itree/filetree/FileNodeConstantsTest.java +++ b/designer-base/src/test/java/com/fr/design/gui/itree/filetree/FileNodeConstantsTest.java @@ -11,6 +11,10 @@ import com.fr.stable.fun.mark.Mutable; import org.easymock.EasyMock; import org.junit.Assert; import org.junit.Test; +import org.junit.runner.RunWith; +import org.powermock.api.easymock.PowerMock; +import org.powermock.core.classloader.annotations.PrepareForTest; +import org.powermock.modules.junit4.PowerMockRunner; import java.util.HashSet; import java.util.Set; @@ -18,23 +22,42 @@ import java.util.Set; /** * Created by alex sung on 2019/7/25. */ +@RunWith(PowerMockRunner.class) +@PrepareForTest(ExtraDesignClassManager.class) public class FileNodeConstantsTest { @Test - public void supportFileTypesTest(){ - ExtraDesignClassManager extra = EasyMock.mock(ExtraDesignClassManager.class); - Set apps = new HashSet(){{add(new MockCptxApp());}}; - EasyMock.expect(extra.getArray(App.MARK_STRING)).andReturn(apps).anyTimes(); - EasyMock.replay(extra); - + public void supportFileTypesTest() { + ExtraDesignClassManager extra = mockExtraDesignClassManager(); Assert.assertEquals(1, extra.getArray(App.MARK_STRING).size()); App app = (App) extra.getArray(App.MARK_STRING).iterator().next(); Assert.assertEquals("cptx", app.defaultExtensions()[0]); } - private class MockCptxApp extends AbstractAppProvider{ + @Test + public void testSupportFileTypesOrder() { + ExtraDesignClassManager extra = mockExtraDesignClassManager(); + PowerMock.mockStatic(ExtraDesignClassManager.class); + EasyMock.expect(ExtraDesignClassManager.getInstance()).andReturn(extra).once(); + PowerMock.replayAll(); + String[] fileTypes = FileNodeConstants.getSupportFileTypes(); + Assert.assertEquals("cptx", fileTypes[0]); + Assert.assertEquals("cpt", fileTypes[1]); + } + + private ExtraDesignClassManager mockExtraDesignClassManager() { + ExtraDesignClassManager extra = EasyMock.mock(ExtraDesignClassManager.class); + Set apps = new HashSet() {{ + add(new MockCptxApp()); + }}; + EasyMock.expect(extra.getArray(App.MARK_STRING)).andReturn(apps).anyTimes(); + EasyMock.replay(extra); + return extra; + } + + private class MockCptxApp extends AbstractAppProvider { @Override public String[] defaultExtensions() { - return new String[] {FileExtension.CPTX.getExtension()}; + return new String[]{FileExtension.CPTX.getExtension()}; } @Override diff --git a/designer-base/src/test/java/com/fr/file/FILEChooserPaneTest.java b/designer-base/src/test/java/com/fr/file/FILEChooserPaneTest.java new file mode 100644 index 0000000000..d3d601c288 --- /dev/null +++ b/designer-base/src/test/java/com/fr/file/FILEChooserPaneTest.java @@ -0,0 +1,38 @@ +package com.fr.file; + +import com.fr.base.extension.FileExtension; +import com.fr.file.filter.ChooseFileFilter; +import com.fr.invoke.Reflect; +import com.fr.stable.StringUtils; +import org.junit.Assert; +import org.junit.Test; + +/** + * Created by kerry on 2019-10-15 + */ + +public class FILEChooserPaneTest { + @Test + public void testAddChooseFileFilter() { + FILEChooserPane chooserPane = Reflect.on(FILEChooserPane.class).field("INSTANCE").get(); + String result1 = Reflect.on(chooserPane).call("calFileNameText", "WorkBook1.cpt", null).get(); + Assert.assertEquals("WorkBook1.cptnull", result1); + + ChooseFileFilter chooseFileFilter1 = new ChooseFileFilter(FileExtension.CPT, StringUtils.EMPTY); + String result2 = Reflect.on(chooserPane).call("calFileNameText", "WorkBook1.cpt", chooseFileFilter1).get(); + Assert.assertEquals("WorkBook1.cpt", result2); + + ChooseFileFilter chooseFileFilter2 = new ChooseFileFilter(FileExtension.CPTX, StringUtils.EMPTY); + String result3 = Reflect.on(chooserPane).call("calFileNameText", "WorkBook1.cpt", chooseFileFilter2).get(); + Assert.assertEquals("WorkBook1.cpt.cptx", result3); + + ChooseFileFilter chooseFileFilter3 = new ChooseFileFilter(FileExtension.CPT, StringUtils.EMPTY); + String result4 = Reflect.on(chooserPane).call("calFileNameText", "WorkBook1.cptx", chooseFileFilter3).get(); + Assert.assertEquals("WorkBook1.cptx.cpt", result4); + + ChooseFileFilter chooseFileFilter5 = new ChooseFileFilter(FileExtension.CPTX, StringUtils.EMPTY); + String result5 = Reflect.on(chooserPane).call("calFileNameText", "WorkBook1.cptx", chooseFileFilter5).get(); + Assert.assertEquals("WorkBook1.cptx", result5); + } + +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java index 6b8cbbe5d5..0abafdabdd 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java @@ -3,6 +3,7 @@ package com.fr.design.mainframe; import com.fr.base.BaseUtils; import com.fr.base.PaperSize; import com.fr.base.Parameter; +import com.fr.base.extension.FileExtension; import com.fr.base.vcs.DesignerMode; import com.fr.design.DesignState; import com.fr.design.actions.FormMobileAttrAction; @@ -34,6 +35,7 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.imenu.UIMenuItem; import com.fr.design.gui.xpane.FormHyperlinkGroupPane; import com.fr.design.gui.xpane.FormHyperlinkGroupPaneNoPop; +import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.form.FormECCompositeProvider; import com.fr.design.mainframe.form.FormECDesignerProvider; @@ -52,6 +54,8 @@ import com.fr.design.report.fit.menupane.ReportFitAttrAction; import com.fr.design.roleAuthority.RolesAlreadyEditedPane; import com.fr.design.utils.gui.LayoutUtils; import com.fr.file.FILE; +import com.fr.file.FILEChooserPane; +import com.fr.file.filter.ChooseFileFilter; import com.fr.form.FormElementCaseContainerProvider; import com.fr.form.FormElementCaseProvider; import com.fr.form.main.Form; @@ -66,6 +70,7 @@ import com.fr.report.cell.cellattr.CellImage; import com.fr.report.worksheet.FormElementCase; import com.fr.stable.ArrayUtils; import com.fr.stable.Constants; +import com.fr.stable.ProductConstants; import com.fr.stable.bridge.StableFactory; import com.fr.web.controller.ViewRequestConstants; @@ -949,4 +954,13 @@ public class JForm extends JTemplate implements BaseJForm { public String route() { return ViewRequestConstants.REPORT_VIEW_PATH; } + + protected void addChooseFILEFilter(FILEChooserPane fileChooser){ + super.addChooseFILEFilter(fileChooser); + Set providers = ExtraDesignClassManager.getInstance().getArray(NewTemplateFileProvider.XML_TAG); + for (NewTemplateFileProvider provider : providers) { + provider.addChooseFileFilter(fileChooser, this.suffix()); + } + } } From 157a846b219496b6b88daaed35e3020029bf5761 Mon Sep 17 00:00:00 2001 From: kerry Date: Tue, 15 Oct 2019 11:52:04 +0800 Subject: [PATCH 25/95] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/fun/NewTemplateFileProvider.java | 47 +++++++++++++++++++ .../impl/AbstractNewTemplateFileProvider.java | 21 +++++++++ .../gui/itree/filetree/FileTreeIcon.java | 2 +- .../com/fr/design/mainframe/JTemplate.java | 1 + .../com/fr/design/mainframe/JWorkBook.java | 1 + 5 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 designer-base/src/main/java/com/fr/design/fun/NewTemplateFileProvider.java create mode 100644 designer-base/src/main/java/com/fr/design/fun/impl/AbstractNewTemplateFileProvider.java diff --git a/designer-base/src/main/java/com/fr/design/fun/NewTemplateFileProvider.java b/designer-base/src/main/java/com/fr/design/fun/NewTemplateFileProvider.java new file mode 100644 index 0000000000..34f811ae0a --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/fun/NewTemplateFileProvider.java @@ -0,0 +1,47 @@ +package com.fr.design.fun; + +import com.fr.design.mainframe.JTemplate; +import com.fr.file.FILEChooserPane; +import com.fr.file.filetree.FileNode; +import com.fr.stable.fun.mark.Mutable; + +import javax.swing.Icon; + +/** + * Created by kerry on 2019-10-11 + */ +public interface NewTemplateFileProvider extends Mutable { + + int CURRENT_LEVEL = 1; + + String XML_TAG = "NewFileTypeProvider"; + + /** + * 向文件选择器中添加指定文件类型过滤器 + * @param fileChooser 文件选择器 + * @param suffix 文件后缀 + */ + void addChooseFileFilter(FILEChooserPane fileChooser, String suffix); + + /** + * 获取本地目录文件关联的icon + * @param path 文件路径 + * @return 对应的图标 + */ + Icon getLocalFileIcon(String path); + + /** + * 获取远程目录文件关联的icon + * @param node 文件节点 + * @param isShowLock 是否显示被锁住 + * @return 对应的图标 + */ + Icon getRemoteFileIcon(FileNode node, boolean isShowLock); + + /** + * 保存为新类型文件 + * @param targetPath 目标路径 + * @param jTemplate 模板对象 + */ + boolean saveToNewFile(String targetPath, JTemplate jTemplate); +} diff --git a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractNewTemplateFileProvider.java b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractNewTemplateFileProvider.java new file mode 100644 index 0000000000..d460c7b959 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractNewTemplateFileProvider.java @@ -0,0 +1,21 @@ +package com.fr.design.fun.impl; + +import com.fr.design.fun.NewTemplateFileProvider; +import com.fr.stable.fun.mark.API; + +/** + * Created by kerry on 2019-10-14 + */ +@API(level = NewTemplateFileProvider.CURRENT_LEVEL) +public abstract class AbstractNewTemplateFileProvider implements NewTemplateFileProvider { + + @Override + public int currentAPILevel() { + return CURRENT_LEVEL; + } + + @Override + public String mark4Provider() { + return getClass().getName(); + } +} diff --git a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileTreeIcon.java b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileTreeIcon.java index 1a84fa1695..a453d0a947 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileTreeIcon.java +++ b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileTreeIcon.java @@ -3,7 +3,7 @@ package com.fr.design.gui.itree.filetree; import com.fr.base.BaseUtils; import com.fr.design.ExtraDesignClassManager; import com.fr.design.icon.LockIcon; -import com.fr.design.mainframe.NewTemplateFileProvider; +import com.fr.design.fun.NewTemplateFileProvider; import com.fr.file.filetree.FileNode; import com.fr.general.ComparatorUtils; import com.fr.stable.StableUtils; diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java index 1daeb4d81e..c862b0caa2 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java @@ -27,6 +27,7 @@ import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.file.TemplateTreePane; import com.fr.design.fun.DesignerFrameUpButtonProvider; import com.fr.design.fun.MenuHandler; +import com.fr.design.fun.NewTemplateFileProvider; import com.fr.design.fun.PreviewProvider; import com.fr.design.gui.frpane.HyperlinkGroupPane; import com.fr.design.gui.frpane.HyperlinkGroupPaneActionProvider; diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java b/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java index 90e30c0c96..7822f7d859 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java @@ -34,6 +34,7 @@ import com.fr.design.event.TargetModifiedEvent; import com.fr.design.event.TargetModifiedListener; import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.file.MutilTempalteTabPane; +import com.fr.design.fun.NewTemplateFileProvider; import com.fr.design.fun.PreviewProvider; import com.fr.design.gui.frpane.HyperlinkGroupPane; import com.fr.design.gui.frpane.HyperlinkGroupPaneActionProvider; From 83b322a9cb9c16eeaf31992e60252c46f44d2c48 Mon Sep 17 00:00:00 2001 From: kerry Date: Tue, 15 Oct 2019 11:52:13 +0800 Subject: [PATCH 26/95] =?UTF-8?q?=E6=97=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AbstractNewTemplateFileProvider.java | 20 -------- .../mainframe/NewTemplateFileProvider.java | 46 ------------------- 2 files changed, 66 deletions(-) delete mode 100644 designer-base/src/main/java/com/fr/design/mainframe/AbstractNewTemplateFileProvider.java delete mode 100644 designer-base/src/main/java/com/fr/design/mainframe/NewTemplateFileProvider.java diff --git a/designer-base/src/main/java/com/fr/design/mainframe/AbstractNewTemplateFileProvider.java b/designer-base/src/main/java/com/fr/design/mainframe/AbstractNewTemplateFileProvider.java deleted file mode 100644 index 64a6f480fb..0000000000 --- a/designer-base/src/main/java/com/fr/design/mainframe/AbstractNewTemplateFileProvider.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.fr.design.mainframe; - -import com.fr.stable.fun.mark.API; - -/** - * Created by kerry on 2019-10-14 - */ -@API(level = NewTemplateFileProvider.CURRENT_LEVEL) -public abstract class AbstractNewTemplateFileProvider implements NewTemplateFileProvider { - - @Override - public int currentAPILevel() { - return CURRENT_LEVEL; - } - - @Override - public String mark4Provider() { - return getClass().getName(); - } -} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/NewTemplateFileProvider.java b/designer-base/src/main/java/com/fr/design/mainframe/NewTemplateFileProvider.java deleted file mode 100644 index e14a54d7b5..0000000000 --- a/designer-base/src/main/java/com/fr/design/mainframe/NewTemplateFileProvider.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.fr.design.mainframe; - -import com.fr.file.FILEChooserPane; -import com.fr.file.filetree.FileNode; -import com.fr.stable.fun.mark.Mutable; - -import javax.swing.Icon; - -/** - * Created by kerry on 2019-10-11 - */ -public interface NewTemplateFileProvider extends Mutable { - - int CURRENT_LEVEL = 1; - - String XML_TAG = "NewFileTypeProvider"; - - /** - * 向文件选择器中添加指定文件类型过滤器 - * @param fileChooser 文件选择器 - * @param suffix 文件后缀 - */ - void addChooseFileFilter(FILEChooserPane fileChooser, String suffix); - - /** - * 获取本地目录文件关联的icon - * @param path 文件路径 - * @return 对应的图标 - */ - Icon getLocalFileIcon(String path); - - /** - * 获取远程目录文件关联的icon - * @param node 文件节点 - * @param isShowLock 是否显示被锁住 - * @return 对应的图标 - */ - Icon getRemoteFileIcon(FileNode node, boolean isShowLock); - - /** - * 保存为新类型文件 - * @param targetPath 目标路径 - * @param jTemplate 模板对象 - */ - boolean saveToNewFile(String targetPath, JTemplate jTemplate); -} From 0ca22c9fc3f59dbd2dfc5f0036a145f5fd05c736 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Tue, 15 Oct 2019 16:21:13 +0800 Subject: [PATCH 27/95] =?UTF-8?q?CHART-10759=20=E5=86=B3=E7=AD=96=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8=E8=AE=BE=E8=AE=A1=E5=99=A8=E7=BB=98=E5=9B=BE=E4=B8=8D?= =?UTF-8?q?=E8=B0=83=E7=94=A8=E5=85=AC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/chart/gui/ChartComponent.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/chart/gui/ChartComponent.java b/designer-chart/src/main/java/com/fr/design/chart/gui/ChartComponent.java index e3d6a52101..2385cabd60 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/gui/ChartComponent.java +++ b/designer-chart/src/main/java/com/fr/design/chart/gui/ChartComponent.java @@ -13,6 +13,8 @@ import com.fr.log.FineLoggerFactory; import com.fr.script.Calculator; import com.fr.stable.core.PropertyChangeListener; +import java.util.ArrayList; +import java.util.List; import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics; @@ -22,8 +24,6 @@ import java.awt.RenderingHints; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; -import java.util.ArrayList; -import java.util.List; /** * @author kunsnat E-mail:kunsnat@gmail.com @@ -236,7 +236,7 @@ public class ChartComponent extends MiddleChartComponent implements MouseListene private void drawChart(Graphics2D g2d) { if (chartCollection4Design != null) { - BaseChartPainter painter = chartCollection4Design.createResultChartPainter(Calculator.createCalculator(), + BaseChartPainter painter = chartCollection4Design.createResultChartPainterWithOutDealFormula(Calculator.createCalculator(), WebChartIDInfo.createEmptyDesignerInfo(), chartWidth, chartHeight); int resolution = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getJTemplateResolution(); From 5220af6b8320ef3a83f4d4c31d16fd44d3e8f928 Mon Sep 17 00:00:00 2001 From: pengda Date: Wed, 16 Oct 2019 10:24:05 +0800 Subject: [PATCH 28/95] =?UTF-8?q?REPORT-22779=20=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E5=8D=87=E7=BA=A7=E5=90=8E=E9=87=8D=E5=90=AF=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/RestartHelper.java | 44 ++++--------------- .../fr/start/module/DesignerActivator.java | 2 + 2 files changed, 10 insertions(+), 36 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/RestartHelper.java b/designer-base/src/main/java/com/fr/design/RestartHelper.java index 4a0813f320..1fef32bb30 100644 --- a/designer-base/src/main/java/com/fr/design/RestartHelper.java +++ b/designer-base/src/main/java/com/fr/design/RestartHelper.java @@ -33,7 +33,7 @@ public class RestartHelper { public static final String RECORD_FILE = StableUtils.pathJoin(StableUtils.getInstallHome(), "delete.properties"); public static final String MOVE_FILE = StableUtils.pathJoin(StableUtils.getInstallHome(), "move.properties"); - + private static OSBasedAction restartAction; /** * 把要删除的文件都记录到delete.properties中 @@ -171,8 +171,8 @@ public class RestartHelper { }catch (Exception e){ FineLoggerFactory.getLogger().error(e.getMessage(), e); } - OSBasedAction osBasedAction = OSSupportCenter.getAction(RestartAction.class); - osBasedAction.execute(filesToBeDelete); + + restartAction.execute(filesToBeDelete); } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); } finally { @@ -187,39 +187,11 @@ public class RestartHelper { } } - /* private static void restartInMacOS(String installHome, String[] filesToBeDelete) throws Exception { - ProcessBuilder builder = new ProcessBuilder(); - List commands = new ArrayList(); - commands.add("open"); - commands.add(installHome + File.separator + "bin" + File.separator + "restart.app"); - if (ArrayUtils.isNotEmpty(filesToBeDelete)) { - commands.add("--args"); - commands.add(StableUtils.join(filesToBeDelete, "+")); - } - builder.command(commands); - builder.start(); - } - - private static void restartInWindows(String installHome, String[] filesToBeDelete) throws Exception { - ProcessBuilder builder = new ProcessBuilder(); - List commands = new ArrayList(); - commands.add(installHome + File.separator + "bin" + File.separator + "restart.exe"); - if (ArrayUtils.isNotEmpty(filesToBeDelete)) { - commands.add(StableUtils.join(filesToBeDelete, "+")); - } - builder.command(commands); - builder.start(); + /** + * 提前初始化重启动作 + */ + public static void initRestartAction(){ + restartAction = OSSupportCenter.getAction(RestartAction.class); } - private static void restartInLinux(String installHome, String[] filesToBeDelete) throws Exception { - ProcessBuilder builder = new ProcessBuilder(); - List commands = new ArrayList(); - //现在先写的是restart.sh - commands.add(installHome + File.separator + "bin" + File.separator + "restart.sh"); - if (ArrayUtils.isNotEmpty(filesToBeDelete)) { - commands.add(StableUtils.join(filesToBeDelete, "+")); - } - builder.command(commands); - builder.start(); - }*/ } \ No newline at end of file diff --git a/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java b/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java index 1727906fb0..051857c330 100644 --- a/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java +++ b/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java @@ -11,6 +11,7 @@ import com.fr.config.MarketConfig; import com.fr.decision.update.backup.RecoverManager; import com.fr.design.DesignerEnvManager; import com.fr.design.ExtraDesignClassManager; +import com.fr.design.RestartHelper; import com.fr.design.actions.NewFormAction; import com.fr.design.actions.core.ActionFactory; import com.fr.design.actions.insert.cell.BiasCellAction; @@ -139,6 +140,7 @@ public class DesignerActivator extends Activator { storePassport(); AlphaFineHelper.switchConfig4Locale(); RecoverManager.register(new RecoverForDesigner()); + RestartHelper.initRestartAction(); } @Override From 18dc43a8749172f86a8407da9d82e6ca53266b6b Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 16 Oct 2019 13:02:54 +0800 Subject: [PATCH 29/95] =?UTF-8?q?REPORT-22824=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=20mac=E4=B8=8B=20=E6=95=B0=E6=8D=AE=E9=9B=86=E9=A2=84?= =?UTF-8?q?=E8=A7=88=E9=9D=A2=E6=9D=BF=20=E7=82=B9=E5=87=BB=E9=A2=84?= =?UTF-8?q?=E8=A7=88=E5=90=8E=20=E4=B8=8D=E5=87=BA=E7=8E=B0=E5=9C=A8?= =?UTF-8?q?=E6=9C=80=E9=A1=B6=E5=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/datapane/preview/PreviewTablePane.java | 13 +++---------- .../tabledata/tabledatapane/FileTableDataPane.java | 2 +- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java index 383a1f02aa..8fdd09f134 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java @@ -27,15 +27,7 @@ import com.fr.function.TIME; import com.fr.general.FRFont; import com.fr.log.FineLoggerFactory; -import javax.swing.BorderFactory; -import javax.swing.Icon; -import javax.swing.JComponent; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.JScrollPane; -import javax.swing.JTable; -import javax.swing.SwingWorker; -import javax.swing.UIManager; +import javax.swing.*; import javax.swing.table.DefaultTableCellRenderer; import javax.swing.table.TableColumn; import javax.swing.table.TableModel; @@ -48,6 +40,7 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; +import java.awt.image.BufferedImage; import java.sql.Timestamp; import java.util.ArrayList; import java.util.Date; @@ -163,7 +156,7 @@ public class PreviewTablePane extends BasicPane { this.add(new JScrollPane(preveiwTable), BorderLayout.CENTER); if (this.dialog == null) { - this.dialog = this.showWindow(DesignerContext.getDesignerFrame()); + this.dialog = this.showWindow(new JFrame()); } progressBar = new AutoProgressBar(this, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Loading_Data"), "", 0, 100) { public void doMonitorCanceled() { diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/FileTableDataPane.java b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/FileTableDataPane.java index 0d8b05c401..fdee7fb8ae 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/FileTableDataPane.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/FileTableDataPane.java @@ -438,7 +438,7 @@ public class FileTableDataPane extends AbstractTableDataPane { @Override public void actionPerformed(ActionEvent e) { FILEChooserPane fileChooser = FILEChooserPane.getInstance(true, false, new ChooseFileFilter(getFileSuffix())); - if (fileChooser.showOpenDialog(DesignerContext.getDesignerFrame()) == FILEChooserPane.OK_OPTION) { + if (fileChooser.showOpenDialog(FileTableDataPane.this) == FILEChooserPane.OK_OPTION) { final FILE file = fileChooser.getSelectedFILE(); if (file == null) {// 选择的文件不能是 null return; From 30a1b542280da66ab4c9827fd6179db68e80368a Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 16 Oct 2019 13:04:35 +0800 Subject: [PATCH 30/95] update --- .../com/fr/design/data/datapane/preview/PreviewTablePane.java | 1 - 1 file changed, 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java index 8fdd09f134..01d7c9a6ff 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java @@ -40,7 +40,6 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; -import java.awt.image.BufferedImage; import java.sql.Timestamp; import java.util.ArrayList; import java.util.Date; From 987c17b553417e9bf906b6bfb4efba7c9d9778ef Mon Sep 17 00:00:00 2001 From: kerry Date: Wed, 16 Oct 2019 14:03:33 +0800 Subject: [PATCH 31/95] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fun/NewTemplateFileOptionProvider.java | 47 +++++++++++++++++++ ...AbstractNewTemplateFileOptionProvider.java | 45 ++++++++++++++++++ .../gui/itree/filetree/FileNodeConstants.java | 15 +++--- .../gui/itree/filetree/FileTreeIcon.java | 30 +++++++----- .../com/fr/design/mainframe/JTemplate.java | 6 +-- .../itree/filetree/FileNodeConstantsTest.java | 39 +++++++-------- .../com/fr/design/mainframe/JWorkBook.java | 6 +-- 7 files changed, 140 insertions(+), 48 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/fun/NewTemplateFileOptionProvider.java create mode 100644 designer-base/src/main/java/com/fr/design/fun/impl/AbstractNewTemplateFileOptionProvider.java diff --git a/designer-base/src/main/java/com/fr/design/fun/NewTemplateFileOptionProvider.java b/designer-base/src/main/java/com/fr/design/fun/NewTemplateFileOptionProvider.java new file mode 100644 index 0000000000..feec821ba0 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/fun/NewTemplateFileOptionProvider.java @@ -0,0 +1,47 @@ +package com.fr.design.fun; + +import com.fr.decision.extension.report.ReportSupportedFileProvider; +import com.fr.design.mainframe.JTemplate; +import com.fr.file.FILEChooserPane; +import com.fr.stable.fun.mark.Mutable; + +import javax.swing.Icon; + +/** + * Created by kerry on 2019-10-11 + */ +public interface NewTemplateFileOptionProvider extends Mutable { + + int CURRENT_LEVEL = 1; + + String XML_TAG = "NewTemplateFileOptionProvider"; + + /** + * 向文件选择器中添加指定文件类型过滤器 + * @param fileChooser 文件选择器 + * @param suffix 文件后缀 + */ + void addChooseFileFilter(FILEChooserPane fileChooser, String suffix); + + + /** + * 获取对应的新增的支持文件类型 + * @return ReportTemplateFileProvider + */ + ReportSupportedFileProvider getSupportedFile(); + + /** + * 获取文件关联的icon + * @param path 文件路径 + * @param isShowLock 是否显示被锁住 + * @return 对应的图标 + */ + Icon getFileIcon(String path,boolean isShowLock); + + /** + * 保存为新类型文件 + * @param targetPath 目标路径 + * @param jTemplate 模板对象 + */ + boolean saveToNewFile(String targetPath, JTemplate jTemplate); +} diff --git a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractNewTemplateFileOptionProvider.java b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractNewTemplateFileOptionProvider.java new file mode 100644 index 0000000000..931c4bc656 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractNewTemplateFileOptionProvider.java @@ -0,0 +1,45 @@ +package com.fr.design.fun.impl; + +import com.fr.decision.extension.report.ReportSupportedFileProvider; +import com.fr.design.fun.NewTemplateFileOptionProvider; +import com.fr.design.mainframe.JTemplate; +import com.fr.file.FILEChooserPane; +import com.fr.stable.fun.mark.API; + +import javax.swing.Icon; + +/** + * Created by kerry on 2019-10-14 + */ +@API(level = NewTemplateFileOptionProvider.CURRENT_LEVEL) +public abstract class AbstractNewTemplateFileOptionProvider implements NewTemplateFileOptionProvider { + @Override + public void addChooseFileFilter(FILEChooserPane fileChooser, String suffix) { + + } + + @Override + public ReportSupportedFileProvider getSupportedFile() { + return null; + } + + @Override + public Icon getFileIcon(String path, boolean isShowLock) { + return null; + } + + @Override + public boolean saveToNewFile(String targetPath, JTemplate jTemplate) { + return false; + } + + @Override + public int currentAPILevel() { + return CURRENT_LEVEL; + } + + @Override + public String mark4Provider() { + return getClass().getName(); + } +} diff --git a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileNodeConstants.java b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileNodeConstants.java index 256fee21bc..d0b14804aa 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileNodeConstants.java +++ b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileNodeConstants.java @@ -1,8 +1,9 @@ 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.mainframe.App; +import com.fr.design.fun.NewTemplateFileOptionProvider; import com.fr.general.GeneralContext; import com.fr.plugin.context.PluginContext; import com.fr.plugin.injectable.PluginModule; @@ -44,10 +45,10 @@ public class FileNodeConstants { }); } - private static void addAppExtensions(String[] extensions) { + private static void addAppExtensions(FileExtension[] extensions) { for (int i = 0, size = extensions.length; i < size; i++) { - if (!supportFileType.contains(extensions[i])) { - supportFileType.add(extensions[i]); + if (!supportFileType.contains(extensions[i].getExtension())) { + supportFileType.add(extensions[i].getExtension()); } } } @@ -57,9 +58,9 @@ public class FileNodeConstants { rwl.writeLock().lock(); supportFileType = new ArrayList(); //通过插件扩展的 - Set apps = ExtraDesignClassManager.getInstance().getArray(App.MARK_STRING); - for (App app : apps) { - addAppExtensions(app.defaultExtensions()); + Set providers = ExtraDesignClassManager.getInstance().getArray(NewTemplateFileOptionProvider.XML_TAG); + for (NewTemplateFileOptionProvider provider : providers) { + addAppExtensions(provider.getSupportedFile().getFileExtensions()); } supportFileType.addAll(Arrays.asList(FRContext.getFileNodes().getSupportedTypes())); diff --git a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileTreeIcon.java b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileTreeIcon.java index a453d0a947..68c877fb6c 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileTreeIcon.java +++ b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileTreeIcon.java @@ -3,7 +3,7 @@ package com.fr.design.gui.itree.filetree; import com.fr.base.BaseUtils; import com.fr.design.ExtraDesignClassManager; import com.fr.design.icon.LockIcon; -import com.fr.design.fun.NewTemplateFileProvider; +import com.fr.design.fun.NewTemplateFileOptionProvider; import com.fr.file.filetree.FileNode; import com.fr.general.ComparatorUtils; import com.fr.stable.StableUtils; @@ -160,25 +160,31 @@ public class FileTreeIcon { } private static Icon getLocalFileIcon(String path) { - Set providers = ExtraDesignClassManager.getInstance().getArray(NewTemplateFileProvider.XML_TAG); - for (NewTemplateFileProvider provider : providers) { - if (provider.getLocalFileIcon(path) != null) { - return provider.getLocalFileIcon(path); - } + Icon icon = getExtraIcon(path, false); + if (icon != null) { + return icon; } return FileSystemView.getFileSystemView().getSystemIcon(new File(path)); } - private static Icon getRemoteFileIcon(FileNode node, boolean isShowLock){ - Set providers = ExtraDesignClassManager.getInstance().getArray(NewTemplateFileProvider.XML_TAG); - for (NewTemplateFileProvider provider : providers) { - if (provider.getRemoteFileIcon(node, isShowLock) != null) { - return provider.getRemoteFileIcon(node, isShowLock); - } + private static Icon getRemoteFileIcon(FileNode node, boolean isShowLock) { + Icon icon = getExtraIcon(node.getName(), isShowLock); + if (icon != null) { + return icon; } return FileTreeIcon.getIcon(FileTreeIcon.getFileType(node.getName()), isShowLock); } + private static Icon getExtraIcon(String path, boolean isShowLock) { + Set providers = ExtraDesignClassManager.getInstance().getArray(NewTemplateFileOptionProvider.XML_TAG); + for (NewTemplateFileOptionProvider provider : providers) { + if (provider.getFileIcon(path, isShowLock) != null) { + return provider.getFileIcon(path, isShowLock); + } + } + return null; + } + private static Icon getIcon(int fileType, boolean isLocked) { if (fileType == JAVA_FILE) { if (isLocked) { diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java index c862b0caa2..85bd81a721 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java @@ -27,7 +27,7 @@ import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.file.TemplateTreePane; import com.fr.design.fun.DesignerFrameUpButtonProvider; import com.fr.design.fun.MenuHandler; -import com.fr.design.fun.NewTemplateFileProvider; +import com.fr.design.fun.NewTemplateFileOptionProvider; import com.fr.design.fun.PreviewProvider; import com.fr.design.gui.frpane.HyperlinkGroupPane; import com.fr.design.gui.frpane.HyperlinkGroupPaneActionProvider; @@ -658,8 +658,8 @@ public abstract class JTemplate> protected boolean saveToNewFile(String oldName){ boolean result = false; - Set providers = ExtraDesignClassManager.getInstance().getArray(NewTemplateFileProvider.XML_TAG); - for (NewTemplateFileProvider provider : providers) { + Set providers = ExtraDesignClassManager.getInstance().getArray(NewTemplateFileOptionProvider.XML_TAG); + for (NewTemplateFileOptionProvider provider : providers) { result = result || provider.saveToNewFile(this.editingFILE.getPath(), this); } if(!result && FileExtension.CPT.matchExtension(this.editingFILE.getPath())){ diff --git a/designer-base/src/test/java/com/fr/design/gui/itree/filetree/FileNodeConstantsTest.java b/designer-base/src/test/java/com/fr/design/gui/itree/filetree/FileNodeConstantsTest.java index a12ae6c14e..8431344bae 100644 --- a/designer-base/src/test/java/com/fr/design/gui/itree/filetree/FileNodeConstantsTest.java +++ b/designer-base/src/test/java/com/fr/design/gui/itree/filetree/FileNodeConstantsTest.java @@ -1,12 +1,10 @@ package com.fr.design.gui.itree.filetree; import com.fr.base.extension.FileExtension; -import com.fr.base.io.BaseBook; +import com.fr.decision.extension.report.ReportSupportedFileProvider; import com.fr.design.ExtraDesignClassManager; -import com.fr.design.mainframe.AbstractAppProvider; -import com.fr.design.mainframe.App; -import com.fr.design.mainframe.JTemplate; -import com.fr.file.FILE; +import com.fr.design.fun.NewTemplateFileOptionProvider; +import com.fr.design.fun.impl.AbstractNewTemplateFileOptionProvider; import com.fr.stable.fun.mark.Mutable; import org.easymock.EasyMock; import org.junit.Assert; @@ -15,7 +13,6 @@ import org.junit.runner.RunWith; import org.powermock.api.easymock.PowerMock; import org.powermock.core.classloader.annotations.PrepareForTest; import org.powermock.modules.junit4.PowerMockRunner; - import java.util.HashSet; import java.util.Set; @@ -28,9 +25,9 @@ public class FileNodeConstantsTest { @Test public void supportFileTypesTest() { ExtraDesignClassManager extra = mockExtraDesignClassManager(); - Assert.assertEquals(1, extra.getArray(App.MARK_STRING).size()); - App app = (App) extra.getArray(App.MARK_STRING).iterator().next(); - Assert.assertEquals("cptx", app.defaultExtensions()[0]); + Assert.assertEquals(1, extra.getArray(NewTemplateFileOptionProvider.XML_TAG).size()); + NewTemplateFileOptionProvider option = (NewTemplateFileOptionProvider) extra.getArray(NewTemplateFileOptionProvider.XML_TAG).iterator().next(); + Assert.assertEquals(FileExtension.CPTX, option.getSupportedFile().getFileExtensions()[0]); } @Test @@ -46,29 +43,25 @@ public class FileNodeConstantsTest { private ExtraDesignClassManager mockExtraDesignClassManager() { ExtraDesignClassManager extra = EasyMock.mock(ExtraDesignClassManager.class); - Set apps = new HashSet() {{ - add(new MockCptxApp()); + Set options = new HashSet() {{ + add(new MockNewTemplateFileOption()); }}; - EasyMock.expect(extra.getArray(App.MARK_STRING)).andReturn(apps).anyTimes(); + EasyMock.expect(extra.getArray(NewTemplateFileOptionProvider.XML_TAG)).andReturn(options).anyTimes(); EasyMock.replay(extra); return extra; } - private class MockCptxApp extends AbstractAppProvider { - @Override - public String[] defaultExtensions() { - return new String[]{FileExtension.CPTX.getExtension()}; - } + private class MockNewTemplateFileOption extends AbstractNewTemplateFileOptionProvider { @Override - public JTemplate openTemplate(FILE tplFile) { - return null; + public ReportSupportedFileProvider getSupportedFile() { + ReportSupportedFileProvider supportedFileProvider = EasyMock.mock(ReportSupportedFileProvider.class); + EasyMock.expect(supportedFileProvider.getFileExtensions()).andReturn(new FileExtension[]{FileExtension.CPTX}).anyTimes(); + EasyMock.replay(supportedFileProvider); + return supportedFileProvider; } - @Override - public BaseBook asIOFile(FILE tplFile) { - return null; - } + } } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java b/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java index 7822f7d859..4edae780b2 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java @@ -34,7 +34,7 @@ import com.fr.design.event.TargetModifiedEvent; import com.fr.design.event.TargetModifiedListener; import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.file.MutilTempalteTabPane; -import com.fr.design.fun.NewTemplateFileProvider; +import com.fr.design.fun.NewTemplateFileOptionProvider; import com.fr.design.fun.PreviewProvider; import com.fr.design.gui.frpane.HyperlinkGroupPane; import com.fr.design.gui.frpane.HyperlinkGroupPaneActionProvider; @@ -1171,8 +1171,8 @@ public class JWorkBook extends JTemplate { protected void addChooseFILEFilter(FILEChooserPane fileChooser){ super.addChooseFILEFilter(fileChooser); - Set providers = ExtraDesignClassManager.getInstance().getArray(NewTemplateFileProvider.XML_TAG); - for (NewTemplateFileProvider provider : providers) { + Set providers = ExtraDesignClassManager.getInstance().getArray(NewTemplateFileOptionProvider.XML_TAG); + for (NewTemplateFileOptionProvider provider : providers) { provider.addChooseFileFilter(fileChooser, this.suffix()); } } From 8bf2a5e0addd3f7a03682868f5237bad08957c27 Mon Sep 17 00:00:00 2001 From: kerry Date: Wed, 16 Oct 2019 14:03:39 +0800 Subject: [PATCH 32/95] =?UTF-8?q?=E9=87=8D=E5=91=BD=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/fun/NewTemplateFileProvider.java | 47 ------------------- .../impl/AbstractNewTemplateFileProvider.java | 21 --------- 2 files changed, 68 deletions(-) delete mode 100644 designer-base/src/main/java/com/fr/design/fun/NewTemplateFileProvider.java delete mode 100644 designer-base/src/main/java/com/fr/design/fun/impl/AbstractNewTemplateFileProvider.java diff --git a/designer-base/src/main/java/com/fr/design/fun/NewTemplateFileProvider.java b/designer-base/src/main/java/com/fr/design/fun/NewTemplateFileProvider.java deleted file mode 100644 index 34f811ae0a..0000000000 --- a/designer-base/src/main/java/com/fr/design/fun/NewTemplateFileProvider.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.fr.design.fun; - -import com.fr.design.mainframe.JTemplate; -import com.fr.file.FILEChooserPane; -import com.fr.file.filetree.FileNode; -import com.fr.stable.fun.mark.Mutable; - -import javax.swing.Icon; - -/** - * Created by kerry on 2019-10-11 - */ -public interface NewTemplateFileProvider extends Mutable { - - int CURRENT_LEVEL = 1; - - String XML_TAG = "NewFileTypeProvider"; - - /** - * 向文件选择器中添加指定文件类型过滤器 - * @param fileChooser 文件选择器 - * @param suffix 文件后缀 - */ - void addChooseFileFilter(FILEChooserPane fileChooser, String suffix); - - /** - * 获取本地目录文件关联的icon - * @param path 文件路径 - * @return 对应的图标 - */ - Icon getLocalFileIcon(String path); - - /** - * 获取远程目录文件关联的icon - * @param node 文件节点 - * @param isShowLock 是否显示被锁住 - * @return 对应的图标 - */ - Icon getRemoteFileIcon(FileNode node, boolean isShowLock); - - /** - * 保存为新类型文件 - * @param targetPath 目标路径 - * @param jTemplate 模板对象 - */ - boolean saveToNewFile(String targetPath, JTemplate jTemplate); -} diff --git a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractNewTemplateFileProvider.java b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractNewTemplateFileProvider.java deleted file mode 100644 index d460c7b959..0000000000 --- a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractNewTemplateFileProvider.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.fr.design.fun.impl; - -import com.fr.design.fun.NewTemplateFileProvider; -import com.fr.stable.fun.mark.API; - -/** - * Created by kerry on 2019-10-14 - */ -@API(level = NewTemplateFileProvider.CURRENT_LEVEL) -public abstract class AbstractNewTemplateFileProvider implements NewTemplateFileProvider { - - @Override - public int currentAPILevel() { - return CURRENT_LEVEL; - } - - @Override - public String mark4Provider() { - return getClass().getName(); - } -} From 5951735bb920aac6994ea7c387bed99aca68abbd Mon Sep 17 00:00:00 2001 From: kerry Date: Wed, 16 Oct 2019 14:35:03 +0800 Subject: [PATCH 33/95] =?UTF-8?q?=E7=BB=A7=E6=89=BFAbstractProvider?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/fun/impl/AbstractNewTemplateFileOptionProvider.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractNewTemplateFileOptionProvider.java b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractNewTemplateFileOptionProvider.java index 931c4bc656..4d420ada09 100644 --- a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractNewTemplateFileOptionProvider.java +++ b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractNewTemplateFileOptionProvider.java @@ -4,6 +4,7 @@ import com.fr.decision.extension.report.ReportSupportedFileProvider; import com.fr.design.fun.NewTemplateFileOptionProvider; import com.fr.design.mainframe.JTemplate; import com.fr.file.FILEChooserPane; +import com.fr.stable.fun.impl.AbstractProvider; import com.fr.stable.fun.mark.API; import javax.swing.Icon; @@ -12,7 +13,7 @@ import javax.swing.Icon; * Created by kerry on 2019-10-14 */ @API(level = NewTemplateFileOptionProvider.CURRENT_LEVEL) -public abstract class AbstractNewTemplateFileOptionProvider implements NewTemplateFileOptionProvider { +public abstract class AbstractNewTemplateFileOptionProvider extends AbstractProvider implements NewTemplateFileOptionProvider { @Override public void addChooseFileFilter(FILEChooserPane fileChooser, String suffix) { From be9619fc990bc0be43f9d4961f94858f52f4dc96 Mon Sep 17 00:00:00 2001 From: kerry Date: Wed, 16 Oct 2019 14:57:49 +0800 Subject: [PATCH 34/95] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=91=BD=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fun/ReportSupportedFileUIProvider.java | 47 +++++++++++++++++++ ...AbstractReportSupportedFileUIProvider.java | 46 ++++++++++++++++++ .../gui/itree/filetree/FileNodeConstants.java | 6 +-- .../gui/itree/filetree/FileTreeIcon.java | 6 +-- .../com/fr/design/mainframe/JTemplate.java | 6 +-- .../itree/filetree/FileNodeConstantsTest.java | 12 ++--- .../com/fr/design/mainframe/JWorkBook.java | 6 +-- 7 files changed, 111 insertions(+), 18 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/fun/ReportSupportedFileUIProvider.java create mode 100644 designer-base/src/main/java/com/fr/design/fun/impl/AbstractReportSupportedFileUIProvider.java diff --git a/designer-base/src/main/java/com/fr/design/fun/ReportSupportedFileUIProvider.java b/designer-base/src/main/java/com/fr/design/fun/ReportSupportedFileUIProvider.java new file mode 100644 index 0000000000..c68c8813dd --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/fun/ReportSupportedFileUIProvider.java @@ -0,0 +1,47 @@ +package com.fr.design.fun; + +import com.fr.decision.extension.report.ReportSupportedFileProvider; +import com.fr.design.mainframe.JTemplate; +import com.fr.file.FILEChooserPane; +import com.fr.stable.fun.mark.Mutable; + +import javax.swing.Icon; + +/** + * Created by kerry on 2019-10-11 + */ +public interface ReportSupportedFileUIProvider extends Mutable { + + int CURRENT_LEVEL = 1; + + String XML_TAG = "ReportSupportedFileUIProvider"; + + /** + * 向文件选择器中添加指定文件类型过滤器 + * @param fileChooser 文件选择器 + * @param suffix 文件后缀 + */ + void addChooseFileFilter(FILEChooserPane fileChooser, String suffix); + + + /** + * 获取对应的新增的支持文件类型 + * @return ReportTemplateFileProvider + */ + ReportSupportedFileProvider getSupportedFile(); + + /** + * 获取文件关联的icon + * @param path 文件路径 + * @param isShowLock 是否显示被锁住 + * @return 对应的图标 + */ + Icon getFileIcon(String path,boolean isShowLock); + + /** + * 保存为新类型文件 + * @param targetPath 目标路径 + * @param jTemplate 模板对象 + */ + boolean saveToNewFile(String targetPath, JTemplate jTemplate); +} diff --git a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractReportSupportedFileUIProvider.java b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractReportSupportedFileUIProvider.java new file mode 100644 index 0000000000..f307a91e28 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractReportSupportedFileUIProvider.java @@ -0,0 +1,46 @@ +package com.fr.design.fun.impl; + +import com.fr.decision.extension.report.ReportSupportedFileProvider; +import com.fr.design.fun.ReportSupportedFileUIProvider; +import com.fr.design.mainframe.JTemplate; +import com.fr.file.FILEChooserPane; +import com.fr.stable.fun.impl.AbstractProvider; +import com.fr.stable.fun.mark.API; + +import javax.swing.Icon; + +/** + * Created by kerry on 2019-10-14 + */ +@API(level = ReportSupportedFileUIProvider.CURRENT_LEVEL) +public abstract class AbstractReportSupportedFileUIProvider extends AbstractProvider implements ReportSupportedFileUIProvider { + @Override + public void addChooseFileFilter(FILEChooserPane fileChooser, String suffix) { + + } + + @Override + public ReportSupportedFileProvider getSupportedFile() { + return null; + } + + @Override + public Icon getFileIcon(String path, boolean isShowLock) { + return null; + } + + @Override + public boolean saveToNewFile(String targetPath, JTemplate jTemplate) { + return false; + } + + @Override + public int currentAPILevel() { + return CURRENT_LEVEL; + } + + @Override + public String mark4Provider() { + return getClass().getName(); + } +} diff --git a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileNodeConstants.java b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileNodeConstants.java index d0b14804aa..82cae94c1c 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileNodeConstants.java +++ b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileNodeConstants.java @@ -3,7 +3,7 @@ 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.fun.NewTemplateFileOptionProvider; +import com.fr.design.fun.ReportSupportedFileUIProvider; import com.fr.general.GeneralContext; import com.fr.plugin.context.PluginContext; import com.fr.plugin.injectable.PluginModule; @@ -58,8 +58,8 @@ public class FileNodeConstants { rwl.writeLock().lock(); supportFileType = new ArrayList(); //通过插件扩展的 - Set providers = ExtraDesignClassManager.getInstance().getArray(NewTemplateFileOptionProvider.XML_TAG); - for (NewTemplateFileOptionProvider provider : providers) { + Set providers = ExtraDesignClassManager.getInstance().getArray(ReportSupportedFileUIProvider.XML_TAG); + for (ReportSupportedFileUIProvider provider : providers) { addAppExtensions(provider.getSupportedFile().getFileExtensions()); } supportFileType.addAll(Arrays.asList(FRContext.getFileNodes().getSupportedTypes())); diff --git a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileTreeIcon.java b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileTreeIcon.java index 68c877fb6c..b418c1db4c 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileTreeIcon.java +++ b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileTreeIcon.java @@ -3,7 +3,7 @@ package com.fr.design.gui.itree.filetree; import com.fr.base.BaseUtils; import com.fr.design.ExtraDesignClassManager; import com.fr.design.icon.LockIcon; -import com.fr.design.fun.NewTemplateFileOptionProvider; +import com.fr.design.fun.ReportSupportedFileUIProvider; import com.fr.file.filetree.FileNode; import com.fr.general.ComparatorUtils; import com.fr.stable.StableUtils; @@ -176,8 +176,8 @@ public class FileTreeIcon { } private static Icon getExtraIcon(String path, boolean isShowLock) { - Set providers = ExtraDesignClassManager.getInstance().getArray(NewTemplateFileOptionProvider.XML_TAG); - for (NewTemplateFileOptionProvider provider : providers) { + Set providers = ExtraDesignClassManager.getInstance().getArray(ReportSupportedFileUIProvider.XML_TAG); + for (ReportSupportedFileUIProvider provider : providers) { if (provider.getFileIcon(path, isShowLock) != null) { return provider.getFileIcon(path, isShowLock); } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java index 85bd81a721..4118578dec 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java @@ -27,7 +27,7 @@ import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.file.TemplateTreePane; import com.fr.design.fun.DesignerFrameUpButtonProvider; import com.fr.design.fun.MenuHandler; -import com.fr.design.fun.NewTemplateFileOptionProvider; +import com.fr.design.fun.ReportSupportedFileUIProvider; import com.fr.design.fun.PreviewProvider; import com.fr.design.gui.frpane.HyperlinkGroupPane; import com.fr.design.gui.frpane.HyperlinkGroupPaneActionProvider; @@ -658,8 +658,8 @@ public abstract class JTemplate> protected boolean saveToNewFile(String oldName){ boolean result = false; - Set providers = ExtraDesignClassManager.getInstance().getArray(NewTemplateFileOptionProvider.XML_TAG); - for (NewTemplateFileOptionProvider provider : providers) { + Set providers = ExtraDesignClassManager.getInstance().getArray(ReportSupportedFileUIProvider.XML_TAG); + for (ReportSupportedFileUIProvider provider : providers) { result = result || provider.saveToNewFile(this.editingFILE.getPath(), this); } if(!result && FileExtension.CPT.matchExtension(this.editingFILE.getPath())){ diff --git a/designer-base/src/test/java/com/fr/design/gui/itree/filetree/FileNodeConstantsTest.java b/designer-base/src/test/java/com/fr/design/gui/itree/filetree/FileNodeConstantsTest.java index 8431344bae..5ddc3b8b29 100644 --- a/designer-base/src/test/java/com/fr/design/gui/itree/filetree/FileNodeConstantsTest.java +++ b/designer-base/src/test/java/com/fr/design/gui/itree/filetree/FileNodeConstantsTest.java @@ -3,8 +3,8 @@ package com.fr.design.gui.itree.filetree; import com.fr.base.extension.FileExtension; import com.fr.decision.extension.report.ReportSupportedFileProvider; import com.fr.design.ExtraDesignClassManager; -import com.fr.design.fun.NewTemplateFileOptionProvider; -import com.fr.design.fun.impl.AbstractNewTemplateFileOptionProvider; +import com.fr.design.fun.ReportSupportedFileUIProvider; +import com.fr.design.fun.impl.AbstractReportSupportedFileUIProvider; import com.fr.stable.fun.mark.Mutable; import org.easymock.EasyMock; import org.junit.Assert; @@ -25,8 +25,8 @@ public class FileNodeConstantsTest { @Test public void supportFileTypesTest() { ExtraDesignClassManager extra = mockExtraDesignClassManager(); - Assert.assertEquals(1, extra.getArray(NewTemplateFileOptionProvider.XML_TAG).size()); - NewTemplateFileOptionProvider option = (NewTemplateFileOptionProvider) extra.getArray(NewTemplateFileOptionProvider.XML_TAG).iterator().next(); + Assert.assertEquals(1, extra.getArray(ReportSupportedFileUIProvider.XML_TAG).size()); + ReportSupportedFileUIProvider option = (ReportSupportedFileUIProvider) extra.getArray(ReportSupportedFileUIProvider.XML_TAG).iterator().next(); Assert.assertEquals(FileExtension.CPTX, option.getSupportedFile().getFileExtensions()[0]); } @@ -46,12 +46,12 @@ public class FileNodeConstantsTest { Set options = new HashSet() {{ add(new MockNewTemplateFileOption()); }}; - EasyMock.expect(extra.getArray(NewTemplateFileOptionProvider.XML_TAG)).andReturn(options).anyTimes(); + EasyMock.expect(extra.getArray(ReportSupportedFileUIProvider.XML_TAG)).andReturn(options).anyTimes(); EasyMock.replay(extra); return extra; } - private class MockNewTemplateFileOption extends AbstractNewTemplateFileOptionProvider { + private class MockNewTemplateFileOption extends AbstractReportSupportedFileUIProvider { @Override public ReportSupportedFileProvider getSupportedFile() { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java b/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java index 4edae780b2..713b34c542 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java @@ -34,7 +34,7 @@ import com.fr.design.event.TargetModifiedEvent; import com.fr.design.event.TargetModifiedListener; import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.file.MutilTempalteTabPane; -import com.fr.design.fun.NewTemplateFileOptionProvider; +import com.fr.design.fun.ReportSupportedFileUIProvider; import com.fr.design.fun.PreviewProvider; import com.fr.design.gui.frpane.HyperlinkGroupPane; import com.fr.design.gui.frpane.HyperlinkGroupPaneActionProvider; @@ -1171,8 +1171,8 @@ public class JWorkBook extends JTemplate { protected void addChooseFILEFilter(FILEChooserPane fileChooser){ super.addChooseFILEFilter(fileChooser); - Set providers = ExtraDesignClassManager.getInstance().getArray(NewTemplateFileOptionProvider.XML_TAG); - for (NewTemplateFileOptionProvider provider : providers) { + Set providers = ExtraDesignClassManager.getInstance().getArray(ReportSupportedFileUIProvider.XML_TAG); + for (ReportSupportedFileUIProvider provider : providers) { provider.addChooseFileFilter(fileChooser, this.suffix()); } } From f8cf8a8a7a65d1fdee197e905ada3e91cb8c6eb5 Mon Sep 17 00:00:00 2001 From: kerry Date: Wed, 16 Oct 2019 14:57:55 +0800 Subject: [PATCH 35/95] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=91=BD=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fun/NewTemplateFileOptionProvider.java | 47 ------------------- ...AbstractNewTemplateFileOptionProvider.java | 46 ------------------ 2 files changed, 93 deletions(-) delete mode 100644 designer-base/src/main/java/com/fr/design/fun/NewTemplateFileOptionProvider.java delete mode 100644 designer-base/src/main/java/com/fr/design/fun/impl/AbstractNewTemplateFileOptionProvider.java diff --git a/designer-base/src/main/java/com/fr/design/fun/NewTemplateFileOptionProvider.java b/designer-base/src/main/java/com/fr/design/fun/NewTemplateFileOptionProvider.java deleted file mode 100644 index feec821ba0..0000000000 --- a/designer-base/src/main/java/com/fr/design/fun/NewTemplateFileOptionProvider.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.fr.design.fun; - -import com.fr.decision.extension.report.ReportSupportedFileProvider; -import com.fr.design.mainframe.JTemplate; -import com.fr.file.FILEChooserPane; -import com.fr.stable.fun.mark.Mutable; - -import javax.swing.Icon; - -/** - * Created by kerry on 2019-10-11 - */ -public interface NewTemplateFileOptionProvider extends Mutable { - - int CURRENT_LEVEL = 1; - - String XML_TAG = "NewTemplateFileOptionProvider"; - - /** - * 向文件选择器中添加指定文件类型过滤器 - * @param fileChooser 文件选择器 - * @param suffix 文件后缀 - */ - void addChooseFileFilter(FILEChooserPane fileChooser, String suffix); - - - /** - * 获取对应的新增的支持文件类型 - * @return ReportTemplateFileProvider - */ - ReportSupportedFileProvider getSupportedFile(); - - /** - * 获取文件关联的icon - * @param path 文件路径 - * @param isShowLock 是否显示被锁住 - * @return 对应的图标 - */ - Icon getFileIcon(String path,boolean isShowLock); - - /** - * 保存为新类型文件 - * @param targetPath 目标路径 - * @param jTemplate 模板对象 - */ - boolean saveToNewFile(String targetPath, JTemplate jTemplate); -} diff --git a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractNewTemplateFileOptionProvider.java b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractNewTemplateFileOptionProvider.java deleted file mode 100644 index 4d420ada09..0000000000 --- a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractNewTemplateFileOptionProvider.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.fr.design.fun.impl; - -import com.fr.decision.extension.report.ReportSupportedFileProvider; -import com.fr.design.fun.NewTemplateFileOptionProvider; -import com.fr.design.mainframe.JTemplate; -import com.fr.file.FILEChooserPane; -import com.fr.stable.fun.impl.AbstractProvider; -import com.fr.stable.fun.mark.API; - -import javax.swing.Icon; - -/** - * Created by kerry on 2019-10-14 - */ -@API(level = NewTemplateFileOptionProvider.CURRENT_LEVEL) -public abstract class AbstractNewTemplateFileOptionProvider extends AbstractProvider implements NewTemplateFileOptionProvider { - @Override - public void addChooseFileFilter(FILEChooserPane fileChooser, String suffix) { - - } - - @Override - public ReportSupportedFileProvider getSupportedFile() { - return null; - } - - @Override - public Icon getFileIcon(String path, boolean isShowLock) { - return null; - } - - @Override - public boolean saveToNewFile(String targetPath, JTemplate jTemplate) { - return false; - } - - @Override - public int currentAPILevel() { - return CURRENT_LEVEL; - } - - @Override - public String mark4Provider() { - return getClass().getName(); - } -} From f791ce188fef01026e7db8225b6609390cdd468b Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 17 Oct 2019 11:08:31 +0800 Subject: [PATCH 36/95] =?UTF-8?q?REPORT-22795=20=E3=80=901004=E5=9B=9E?= =?UTF-8?q?=E5=BD=92=E3=80=91=E8=AE=BE=E8=AE=A1=E9=9D=A2=E6=9D=BF-?= =?UTF-8?q?=E6=8E=A7=E4=BB=B6=E8=AE=BE=E7=BD=AE-=E6=96=87=E6=9C=AC?= =?UTF-8?q?=E6=8E=A7=E4=BB=B6=E5=9F=BA=E6=9C=AC=E8=AE=BE=E7=BD=AE=20&&=20R?= =?UTF-8?q?EPORT-21152=20=E8=8B=B1=E6=96=87=E3=80=81=E9=9F=A9=E6=96=87?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8cell->other=E8=B7=B3=E8=BD=AC?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/gui/frpane/RegPane.java | 2 +- .../java/com/fr/design/actions/cell/CellAttributeAction.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/RegPane.java b/designer-base/src/main/java/com/fr/design/gui/frpane/RegPane.java index 2df45f8923..f84d0f5fdb 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/RegPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/RegPane.java @@ -111,8 +111,8 @@ public class RegPane extends BasicPane { cardPane.setPreferredSize(new Dimension(0,0 )); detailedCardLayout.show(cardPane, "Default"); } - fireRegChangeAction(); } + fireRegChangeAction(); } }); } diff --git a/designer-realize/src/main/java/com/fr/design/actions/cell/CellAttributeAction.java b/designer-realize/src/main/java/com/fr/design/actions/cell/CellAttributeAction.java index 4e4cdb0cc7..e9d5501a4f 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/cell/CellAttributeAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/cell/CellAttributeAction.java @@ -17,7 +17,7 @@ public class CellAttributeAction extends CellAttributeTableAction { @Override protected String getID() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Datasource_Other_Attributes"); + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Datasource_Other_Attributes"); } } \ No newline at end of file From ee1f910ccdb8750c298df118d697cb712ea4abfe Mon Sep 17 00:00:00 2001 From: Bryant Date: Thu, 17 Oct 2019 13:23:25 +0800 Subject: [PATCH 37/95] =?UTF-8?q?REPORT-22779=20=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E5=90=8E=E6=97=A0=E6=B3=95=E9=87=8D=E5=90=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/RestartHelper.java | 57 ++++++++++++++++- .../fr/design/mainframe/DesignerFrame.java | 64 ++++++++++--------- .../update/actions/RecoverForDesigner.java | 4 +- .../update/ui/dialog/UpdateMainDialog.java | 11 ++-- 4 files changed, 97 insertions(+), 39 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/RestartHelper.java b/designer-base/src/main/java/com/fr/design/RestartHelper.java index 1fef32bb30..8a6d02823f 100644 --- a/designer-base/src/main/java/com/fr/design/RestartHelper.java +++ b/designer-base/src/main/java/com/fr/design/RestartHelper.java @@ -6,11 +6,12 @@ import com.fr.general.ComparatorUtils; import com.fr.general.GeneralUtils; import com.fr.log.FineLoggerFactory; import com.fr.stable.ArrayUtils; -import com.fr.stable.os.OperatingSystem; import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; +import com.fr.stable.os.OperatingSystem; import com.fr.stable.os.support.OSBasedAction; import com.fr.stable.os.support.OSSupportCenter; +import com.fr.workspace.WorkContext; import java.io.File; import java.io.FileInputStream; @@ -146,6 +147,59 @@ public class RestartHelper { restart(ArrayUtils.EMPTY_STRING_ARRAY); } + public static void restartForUpdate(String installHome) { + try { + if (OperatingSystem.isMacos()) { + restartInMacOS(installHome, ArrayUtils.EMPTY_STRING_ARRAY); + } else if (OperatingSystem.isLinux()){ + restartInLinux(installHome, ArrayUtils.EMPTY_STRING_ARRAY); + } else { + restartInWindows(installHome,ArrayUtils.EMPTY_STRING_ARRAY); + } + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage()); + } finally { + WorkContext.getCurrent().close(); + System.exit(0); + } + } + + private static void restartInMacOS(String installHome, String[] filesToBeDelete) throws Exception { + ProcessBuilder builder = new ProcessBuilder(); + List commands = new ArrayList<>(); + commands.add("open"); + commands.add(installHome + File.separator + "bin" + File.separator + "restart.app"); + if (ArrayUtils.isNotEmpty(filesToBeDelete)) { + commands.add("--args"); + commands.add(StableUtils.join(filesToBeDelete, "+")); + } + builder.command(commands); + builder.start(); + } + + private static void restartInWindows(String installHome, String[] filesToBeDelete) throws Exception { + ProcessBuilder builder = new ProcessBuilder(); + List commands = new ArrayList<>(); + commands.add(installHome + File.separator + "bin" + File.separator + "restart.exe"); + if (ArrayUtils.isNotEmpty(filesToBeDelete)) { + commands.add(StableUtils.join(filesToBeDelete, "+")); + } + builder.command(commands); + builder.start(); + } + + private static void restartInLinux(String installHome, String[] filesToBeDelete) throws Exception { + ProcessBuilder builder = new ProcessBuilder(); + List commands = new ArrayList<>(); + //现在先写的是restart.sh + commands.add(installHome + File.separator + "bin" + File.separator + "restart.sh"); + if (ArrayUtils.isNotEmpty(filesToBeDelete)) { + commands.add(StableUtils.join(filesToBeDelete, "+")); + } + builder.command(commands); + builder.start(); + } + /** * 重启设计器并删除某些特定的文件 * @@ -171,7 +225,6 @@ public class RestartHelper { }catch (Exception e){ FineLoggerFactory.getLogger().error(e.getMessage(), e); } - restartAction.execute(filesToBeDelete); } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java index 56e119d6a7..082775a62d 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java @@ -4,7 +4,6 @@ package com.fr.design.mainframe; import com.fr.base.BaseUtils; -import com.fr.base.vcs.DesignerMode; import com.fr.design.DesignModelAdapter; import com.fr.design.DesignState; import com.fr.design.DesignerEnvManager; @@ -113,9 +112,9 @@ import java.util.Set; public class DesignerFrame extends JFrame implements JTemplateActionListener, TargetModifiedListener { - public static final String DESIGNER_FRAME_NAME = "designer_frame"; + private static final String DESIGNER_FRAME_NAME = "designer_frame"; - public static final Dimension MIN_SIZE = new Dimension(100, 100); + private static final Dimension MIN_SIZE = new Dimension(100, 100); private static final long serialVersionUID = -8732559571067484460L; @@ -145,9 +144,9 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta private UIToolbar combineUp; - private NewTemplatePane newWorkBookPane = null; + private NewTemplatePane newWorkBookPane; - private Icon closeMode = UIConstants.CLOSE_OF_AUTHORITY; + private Icon closeMode; private JLayeredPane layeredPane = this.getLayeredPane(); @@ -184,7 +183,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta SaveSomeTemplatePane saveSomeTempaltePane = new SaveSomeTemplatePane(true); // 只有一个文件未保存时 - if (HistoryTemplateListPane.getInstance().getHistoryCount() == 1) { + if (HistoryTemplateListCache.getInstance().getHistoryCount() == 1) { int choose = saveSomeTempaltePane.saveLastOneTemplate(); if (choose != JOptionPane.CANCEL_OPTION) { DesignerFrame.this.exit(); @@ -318,7 +317,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta public void componentResized(ComponentEvent e) { reCalculateFrameSize(); - if (DesignerMode.isAuthorityEditing()) { + if (DesignModeContext.isAuthorityEditing()) { doResize(); } } @@ -334,9 +333,9 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta public void resizeFrame() { - HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().setComposite(); + HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().setComposite(); reCalculateFrameSize(); - HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().doResize(); + HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().doResize(); } public void closeAuthorityEditing() { @@ -416,8 +415,8 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta } /** - * @param ad - * @return + * @param ad 菜单栏 + * @return panel */ protected JPanel initNorthEastPane(final ToolBarMenuDock ad) { //hugh: private修改为protected方便oem的时候修改右上的组件构成 @@ -515,7 +514,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta protected ArrayList getFrameListeners() { - ArrayList arrayList = new ArrayList(); + ArrayList arrayList = new ArrayList<>(); arrayList.add(windowAdapter); return arrayList; } @@ -593,7 +592,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta */ public void refreshDottedLine() { - if (DesignerMode.isAuthorityEditing()) { + if (DesignModeContext.isAuthorityEditing()) { populateAuthorityArea(); populateCloseButton(); addDottedLine(); @@ -633,7 +632,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta */ private void fireAuthorityStateToNormal() { - java.util.List> opendedTemplate = HistoryTemplateListPane.getInstance().getHistoryList(); + List> opendedTemplate = HistoryTemplateListCache.getInstance().getHistoryList(); for (JTemplate jTemplate : opendedTemplate) { // 如果在权限编辑时做过操作,则将做过的操作作为一个整体状态赋给正在报表 if (jTemplate.isDoSomethingInAuthority()) { @@ -676,7 +675,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta for (UIButton fixButton : fixButtons) { combineUp.add(fixButton); } - if (!DesignerMode.isAuthorityEditing()) { + if (!DesignModeContext.isAuthorityEditing()) { combineUp.addSeparator(new Dimension(2, 16)); if (toolbar4Form != null) { for (JComponent jComponent : toolbar4Form) { @@ -692,7 +691,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta private void addExtraButtons() { - JTemplate jt = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); + JTemplate jt = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); if (jt == null) { return; } @@ -709,7 +708,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta private void addShareButton() { - JTemplate jt = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); + JTemplate jt = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); if (jt == null) { return; } @@ -784,13 +783,13 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta */ public void needToAddAuhtorityPaint() { - newWorkBookPane.setButtonGray(DesignerMode.isAuthorityEditing()); + newWorkBookPane.setButtonGray(DesignModeContext.isAuthorityEditing()); // 进入或退出权限编辑模式,通知插件 Set extraShortCuts = ExtraDesignClassManager.getInstance().getExtraShortCuts(); for (ShortCut shortCut : extraShortCuts) { if (shortCut instanceof AbstractTemplateTreeShortCutProvider) { - shortCut.notifyFromAuhtorityChange(DesignerMode.isAuthorityEditing()); + shortCut.notifyFromAuhtorityChange(DesignModeContext.isAuthorityEditing()); } } } @@ -811,7 +810,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta */ public void setTitle() { - JTemplate editingTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); + JTemplate editingTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); StringBuilder defaultTitleSB = new StringBuilder(); defaultTitleSB.append(ProductConstants.PRODUCT_NAME); defaultTitleSB.append(" "); @@ -909,7 +908,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta public void saveCurrentEditingTemplate() { - JTemplate editingTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); + JTemplate editingTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); if (editingTemplate == null) { return; } @@ -1092,7 +1091,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta if (inValidDesigner(jt)) { this.addAndActivateJTemplate(); MutilTempalteTabPane.getInstance().setTemTemplate( - HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()); + HistoryTemplateListCache.getInstance().getCurrentEditingTemplate()); } else { activeTemplate(jt); } @@ -1106,8 +1105,8 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta */ private void activeTemplate(JTemplate jt) { // 如果该模板已经打开,则进行激活就可以了 - int index = HistoryTemplateListPane.getInstance().contains(jt); - List> historyList = HistoryTemplateListPane.getInstance().getHistoryList(); + int index = HistoryTemplateListCache.getInstance().contains(jt); + List> historyList = HistoryTemplateListCache.getInstance().getHistoryList(); if (index != -1) { historyList.get(index).activeJTemplate(index, jt); } else { @@ -1115,11 +1114,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta } } - /** - * Exit退出 - */ - public void exit() { - + public void prepareForExit() { Thread thread = new Thread() { @Override @@ -1138,7 +1133,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta } DesignerEnvManager.getEnvManager().setLastOpenFile( - HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getEditingFILE().getPath()); + HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getEditingFILE().getPath()); DesignerEnvManager.getEnvManager().setLastWestRegionToolPaneY( WestRegionContainerPane.getInstance().getToolPaneY()); @@ -1150,6 +1145,13 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta EastRegionContainerPane.getInstance().getContainerWidth()); DesignerEnvManager.getEnvManager().saveXMLFile(); + } + + /** + * Exit退出 + */ + public void exit() { + prepareForExit(); //关闭当前环境 WorkContext.getCurrent().close(); @@ -1251,7 +1253,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta /** * 更新进度框进度 * - * @param progress + * @param progress 进度值 */ public void updateProgress(int progress) { diff --git a/designer-base/src/main/java/com/fr/design/update/actions/RecoverForDesigner.java b/designer-base/src/main/java/com/fr/design/update/actions/RecoverForDesigner.java index 318beb5fc7..75b5e3fadd 100644 --- a/designer-base/src/main/java/com/fr/design/update/actions/RecoverForDesigner.java +++ b/designer-base/src/main/java/com/fr/design/update/actions/RecoverForDesigner.java @@ -3,6 +3,7 @@ package com.fr.design.update.actions; import com.fr.decision.update.backup.Recover; import com.fr.decision.update.data.UpdateConstants; import com.fr.decision.update.exception.UpdateException; +import com.fr.design.mainframe.DesignerContext; import com.fr.general.CommonIOUtils; import com.fr.general.GeneralUtils; import com.fr.general.IOUtils; @@ -46,8 +47,9 @@ public class RecoverForDesigner implements Recover { CommonUtils.mkdirs(file); IOUtils.copyFilesInDirByPath(StableUtils.pathJoin(installHome,ProjectConstants.LIB_NAME), StableUtils.pathJoin(installHome, UpdateConstants.DESIGNERBACKUPPATH)); + DesignerContext.getDesignerFrame().prepareForExit(); return true; - }catch (IOException e) { + } catch (IOException e) { UpdateException exception = new UpdateException("Backup Exception for designer" + e.getMessage()); FineLoggerFactory.getLogger().error(exception.getMessage(),exception); return false; diff --git a/designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java b/designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java index e8f3e5986b..8633c0616d 100644 --- a/designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java +++ b/designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java @@ -30,6 +30,7 @@ import com.fr.json.JSONArray; import com.fr.json.JSONObject; import com.fr.log.FineLoggerFactory; import com.fr.stable.*; +import com.fr.stable.project.ProjectConstants; import com.fr.third.org.apache.http.client.methods.CloseableHttpResponse; import com.fr.third.org.apache.http.client.methods.HttpGet; import com.fr.third.org.apache.http.impl.client.CloseableHttpClient; @@ -47,10 +48,8 @@ import java.io.*; import java.nio.charset.StandardCharsets; import java.text.ParsePosition; import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; +import java.util.*; import java.util.List; -import java.util.Locale; import java.util.concurrent.ExecutionException; import static java.nio.charset.StandardCharsets.*; @@ -594,19 +593,21 @@ public class UpdateMainDialog extends UIDialog { UpdateCallBack callBack = new UpdateProgressCallBack(progressBar); updateButton.setEnabled(false); updateLabel.setVisible(false); + RestoreResultDialog.deletePreviousPropertyFile(); + final String installHome = StableUtils.getInstallHome(); new FileProcess(callBack) { @Override public void onDownloadSuccess() { progressBar.setVisible(false); deleteForDesignerUpdate(); - RestartHelper.restart(); + RestartHelper.restartForUpdate(installHome); } @Override public void onDownloadFailed() { progressBar.setVisible(false); deleteForDesignerUpdate(); JOptionPane.showMessageDialog(getParent(), Toolkit.i18nText("Fine-Design_Update_Info_Failed_Message")); - RestartHelper.restart(); + RestartHelper.restartForUpdate(installHome); } }.execute(); } From 39fbddc8ca48019f6ff99e745c1ad6c704cb1dfc Mon Sep 17 00:00:00 2001 From: "Hugh.C" Date: Thu, 17 Oct 2019 13:57:03 +0800 Subject: [PATCH 38/95] =?UTF-8?q?REPORT-22877=20=E3=80=9010.0.4=E5=9B=9E?= =?UTF-8?q?=E5=BD=92=E3=80=91=E6=A8=A1=E7=89=88=E7=89=88=E6=9C=AC=E6=8E=A7?= =?UTF-8?q?=E5=88=B6=EF=BC=8C=E9=9B=86=E7=BE=A4=E7=8E=AF=E5=A2=83=E4=BB=8D?= =?UTF-8?q?=E7=84=B6=E8=83=BD=E8=BF=9B=E5=85=A5=E7=89=88=E6=9C=AC=E7=AE=A1?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/DesignerFrameFileDealerPane.java | 3 ++- .../java/com/fr/design/mainframe/vcs/common/VcsHelper.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java index c8f8280a49..a3bca31aa3 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java @@ -3,6 +3,7 @@ package com.fr.design.mainframe; import com.fr.base.BaseUtils; import com.fr.base.vcs.DesignerMode; import com.fr.cluster.ClusterBridge; +import com.fr.cluster.engine.base.FineClusterConfig; import com.fr.design.DesignModelAdapter; import com.fr.design.DesignerEnvManager; import com.fr.design.ExtraDesignClassManager; @@ -367,7 +368,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt private void fireVcsActionChange() { if (!DesignerEnvManager.getEnvManager().getVcsConfigManager().isVcsEnable() || VcsHelper.getInstance().isUnSelectedTemplate() - || ClusterBridge.isClusterMode()) { + || FineClusterConfig.getInstance().isCluster()) { setEnabled(false); return; } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java b/designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java index dc4af8750e..547ddf6ae6 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/vcs/common/VcsHelper.java @@ -1,6 +1,7 @@ package com.fr.design.mainframe.vcs.common; import com.fr.cluster.ClusterBridge; +import com.fr.cluster.engine.base.FineClusterConfig; import com.fr.concurrent.NamedThreadFactory; import com.fr.design.DesignerEnvManager; import com.fr.design.file.HistoryTemplateListCache; @@ -173,7 +174,7 @@ public class VcsHelper implements JTemplateActionListener { public void templateSaved(JTemplate jt) { if (needInit() && DesignerEnvManager.getEnvManager().getVcsConfigManager().isVcsEnable() - && !ClusterBridge.isClusterMode()) { + && !FineClusterConfig.getInstance().isCluster()) { fireVcs(jt); } } From ae154d063c68d88a3c264679f49e22e81596c4b8 Mon Sep 17 00:00:00 2001 From: kerry Date: Thu, 17 Oct 2019 14:56:53 +0800 Subject: [PATCH 39/95] =?UTF-8?q?REPORT-21017=E3=80=90=E6=96=B0=E5=BC=95?= =?UTF-8?q?=E6=93=8E=E3=80=91=E5=A2=9E=E5=8A=A0cptx=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E5=8F=8A=E7=9B=B8=E5=85=B3=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/DesignerFrameFileDealerPane.java | 13 +++++++++++-- .../java/com/fr/design/mainframe/JTemplate.java | 10 ++++++++-- .../src/main/java/com/fr/file/FILEChooserPane.java | 2 -- .../java/com/fr/design/mainframe/JPolyWorkBook.java | 7 ++++++- .../java/com/fr/design/mainframe/JWorkBook.java | 9 +++++---- 5 files changed, 30 insertions(+), 11 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java index c8f8280a49..8f79649067 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java @@ -1,6 +1,7 @@ package com.fr.design.mainframe; import com.fr.base.BaseUtils; +import com.fr.base.extension.FileExtension; import com.fr.base.vcs.DesignerMode; import com.fr.cluster.ClusterBridge; import com.fr.design.DesignModelAdapter; @@ -374,10 +375,11 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt if (WorkContext.getCurrent() != null) { + boolean pathSupportVcsAction = selectedOperation.getFilePath() != null && pathSupportVcsAction(selectedOperation.getFilePath()); if (!WorkContext.getCurrent().isLocal()) { //当前环境为远程环境时 FileNode node = TemplateTreePane.getInstance().getTemplateFileTree().getSelectedFileNode(); - if (selectedOperation.getFilePath() != null) { + if (pathSupportVcsAction) { if (node.getLock() != null && !ComparatorUtils.equals(node.getUserID(), node.getLock())) { setEnabled(false); } else { @@ -388,11 +390,18 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt } } else { //当前环境为本地环境时 - setEnabled(selectedOperation.getFilePath() != null); + setEnabled(pathSupportVcsAction); } } } + private boolean pathSupportVcsAction(String path) { + if (FileExtension.CPT.matchExtension(path) || FileExtension.FRM.matchExtension(path)) { + return true; + } + return false; + } + private void closeOpenedTemplate(String path, boolean isCurrentEditing) { for (JTemplate jTemplate : HistoryTemplateListCache.getInstance().getHistoryList()) { if (ComparatorUtils.equals(jTemplate.getEditingFILE().getPath(), path)) { diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java index 4118578dec..22ffc54036 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java @@ -628,13 +628,19 @@ public abstract class JTemplate> } } - protected void addChooseFILEFilter(FILEChooserPane fileChooser){ + private void addChooseFILEFilter(FILEChooserPane fileChooser){ String appName = ProductConstants.APP_NAME; - fileChooser.addChooseFILEFilter(new ChooseFileFilter(FileExtension.CPT, appName + Toolkit.i18nText("Fine-Design_Report_Template_File"))); + if (FileExtension.CPT.matchExtension(this.suffix())){ + fileChooser.addChooseFILEFilter(new ChooseFileFilter(FileExtension.CPT, appName + Toolkit.i18nText("Fine-Design_Report_Template_File"))); + } if (FileExtension.FRM.matchExtension(this.suffix())) { // richer:form文件 daniel 改成三个字 fileChooser.addChooseFILEFilter(new ChooseFileFilter(FileExtension.FRM, appName + Toolkit.i18nText("Fine-Design_Report_Template_File"))); } + addExtraChooseFILEFilter(fileChooser); + } + + protected void addExtraChooseFILEFilter(FILEChooserPane fileChooser){ } diff --git a/designer-base/src/main/java/com/fr/file/FILEChooserPane.java b/designer-base/src/main/java/com/fr/file/FILEChooserPane.java index 7c6e56bb7d..7f03b6672d 100644 --- a/designer-base/src/main/java/com/fr/file/FILEChooserPane.java +++ b/designer-base/src/main/java/com/fr/file/FILEChooserPane.java @@ -725,11 +725,9 @@ public class FILEChooserPane extends BasicPane { // ben:filefilter设置初值为cpt过滤 this.addChooseFILEFilter(new ChooseFileFilter(FileExtension.CPT, appName + Toolkit.i18nText("Fine-Design_Report_Template_File"))); - this.addChooseFILEFilter(new ChooseFileFilter(FileExtension.CPTX, appName + Toolkit.i18nText("Fine-Design_Report_Template_File"))); // richer:form文件 daniel 改成三个字 this.addChooseFILEFilter(new ChooseFileFilter(FileExtension.FRM, appName + Toolkit.i18nText("Fine-Design_Report_Template_File"))); - this.addChooseFILEFilter(new ChooseFileFilter(FileExtension.FRMX, appName + Toolkit.i18nText("Fine-Design_Report_Template_File"))); } else { if (type == JFileChooser.OPEN_DIALOG) { this.addChooseFILEFilter(new ChooseFileFilter(EnumSet.of(FileExtension.XLS, FileExtension.XLSX), Toolkit.i18nText("Fine-Design_Basic_Import_Excel_Source"))); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/JPolyWorkBook.java b/designer-realize/src/main/java/com/fr/design/mainframe/JPolyWorkBook.java index f93d473f6e..b68e49e168 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/JPolyWorkBook.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/JPolyWorkBook.java @@ -3,6 +3,7 @@ */ package com.fr.design.mainframe; +import com.fr.file.FILEChooserPane; import com.fr.main.impl.WorkBook; import com.fr.report.poly.PolyWorkSheet; @@ -44,4 +45,8 @@ public class JPolyWorkBook extends JWorkBook { public void refreshEastPropertiesPane() { EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.POLY); } -} \ No newline at end of file + + protected void addExtraChooseFILEFilter(FILEChooserPane fileChooser) { + + } +} diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java b/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java index 713b34c542..f06a5ef2c2 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java @@ -671,11 +671,13 @@ public class JWorkBook extends JTemplate { // Export - MenuDef MenuDef exportMenuDef = new MenuDef(KeySetUtils.EXPORT.getMenuName()); exportMenuDef.setIconPath("/com/fr/design/images/m_file/export.png"); + addShortCut(exportMenuDef, excelExportMenuDef); + return exportMenuDef; + } + protected void addShortCut(MenuDef exportMenuDef, MenuDef excelExportMenuDef) { exportMenuDef.addShortCut(excelExportMenuDef, new PDFExportAction(this), new WordExportAction(this), new SVGExportAction(this), new CSVExportAction(this), new TextExportAction(this), new EmbeddedExportExportAction(this)); - - return exportMenuDef; } /** @@ -1169,8 +1171,7 @@ public class JWorkBook extends JTemplate { return ViewRequestConstants.REPORT_VIEW_PATH; } - protected void addChooseFILEFilter(FILEChooserPane fileChooser){ - super.addChooseFILEFilter(fileChooser); + protected void addExtraChooseFILEFilter(FILEChooserPane fileChooser){ Set providers = ExtraDesignClassManager.getInstance().getArray(ReportSupportedFileUIProvider.XML_TAG); for (ReportSupportedFileUIProvider provider : providers) { provider.addChooseFileFilter(fileChooser, this.suffix()); From be4d346eb2eabc66a41f10fe4bc2885217858e90 Mon Sep 17 00:00:00 2001 From: kerry Date: Thu, 17 Oct 2019 15:14:48 +0800 Subject: [PATCH 40/95] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/fun/ReportSupportedFileUIProvider.java | 9 +++++---- .../impl/AbstractReportSupportedFileUIProvider.java | 7 ++++--- .../design/gui/itree/filetree/FileNodeConstants.java | 2 +- .../gui/itree/filetree/FileNodeConstantsTest.java | 12 ++++-------- 4 files changed, 14 insertions(+), 16 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/fun/ReportSupportedFileUIProvider.java b/designer-base/src/main/java/com/fr/design/fun/ReportSupportedFileUIProvider.java index c68c8813dd..2ccfd9363e 100644 --- a/designer-base/src/main/java/com/fr/design/fun/ReportSupportedFileUIProvider.java +++ b/designer-base/src/main/java/com/fr/design/fun/ReportSupportedFileUIProvider.java @@ -1,6 +1,6 @@ package com.fr.design.fun; -import com.fr.decision.extension.report.ReportSupportedFileProvider; +import com.fr.base.extension.FileExtension; import com.fr.design.mainframe.JTemplate; import com.fr.file.FILEChooserPane; import com.fr.stable.fun.mark.Mutable; @@ -25,10 +25,11 @@ public interface ReportSupportedFileUIProvider extends Mutable { /** - * 获取对应的新增的支持文件类型 - * @return ReportTemplateFileProvider + * 获取可支持的文件类型 + * @return 文件扩展 */ - ReportSupportedFileProvider getSupportedFile(); + FileExtension[] getFileExtensions(); + /** * 获取文件关联的icon diff --git a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractReportSupportedFileUIProvider.java b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractReportSupportedFileUIProvider.java index f307a91e28..3e8046e6f7 100644 --- a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractReportSupportedFileUIProvider.java +++ b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractReportSupportedFileUIProvider.java @@ -1,6 +1,6 @@ package com.fr.design.fun.impl; -import com.fr.decision.extension.report.ReportSupportedFileProvider; +import com.fr.base.extension.FileExtension; import com.fr.design.fun.ReportSupportedFileUIProvider; import com.fr.design.mainframe.JTemplate; import com.fr.file.FILEChooserPane; @@ -20,10 +20,11 @@ public abstract class AbstractReportSupportedFileUIProvider extends AbstractProv } @Override - public ReportSupportedFileProvider getSupportedFile() { - return null; + public FileExtension[] getFileExtensions() { + return new FileExtension[0]; } + @Override public Icon getFileIcon(String path, boolean isShowLock) { return null; diff --git a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileNodeConstants.java b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileNodeConstants.java index 82cae94c1c..617051dc63 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileNodeConstants.java +++ b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileNodeConstants.java @@ -60,7 +60,7 @@ public class FileNodeConstants { //通过插件扩展的 Set providers = ExtraDesignClassManager.getInstance().getArray(ReportSupportedFileUIProvider.XML_TAG); for (ReportSupportedFileUIProvider provider : providers) { - addAppExtensions(provider.getSupportedFile().getFileExtensions()); + addAppExtensions(provider.getFileExtensions()); } supportFileType.addAll(Arrays.asList(FRContext.getFileNodes().getSupportedTypes())); diff --git a/designer-base/src/test/java/com/fr/design/gui/itree/filetree/FileNodeConstantsTest.java b/designer-base/src/test/java/com/fr/design/gui/itree/filetree/FileNodeConstantsTest.java index 5ddc3b8b29..e62091048f 100644 --- a/designer-base/src/test/java/com/fr/design/gui/itree/filetree/FileNodeConstantsTest.java +++ b/designer-base/src/test/java/com/fr/design/gui/itree/filetree/FileNodeConstantsTest.java @@ -1,7 +1,6 @@ package com.fr.design.gui.itree.filetree; import com.fr.base.extension.FileExtension; -import com.fr.decision.extension.report.ReportSupportedFileProvider; import com.fr.design.ExtraDesignClassManager; import com.fr.design.fun.ReportSupportedFileUIProvider; import com.fr.design.fun.impl.AbstractReportSupportedFileUIProvider; @@ -27,7 +26,7 @@ public class FileNodeConstantsTest { ExtraDesignClassManager extra = mockExtraDesignClassManager(); Assert.assertEquals(1, extra.getArray(ReportSupportedFileUIProvider.XML_TAG).size()); ReportSupportedFileUIProvider option = (ReportSupportedFileUIProvider) extra.getArray(ReportSupportedFileUIProvider.XML_TAG).iterator().next(); - Assert.assertEquals(FileExtension.CPTX, option.getSupportedFile().getFileExtensions()[0]); + Assert.assertEquals(FileExtension.CPTX, option.getFileExtensions()[0]); } @Test @@ -54,14 +53,11 @@ public class FileNodeConstantsTest { private class MockNewTemplateFileOption extends AbstractReportSupportedFileUIProvider { @Override - public ReportSupportedFileProvider getSupportedFile() { - ReportSupportedFileProvider supportedFileProvider = EasyMock.mock(ReportSupportedFileProvider.class); - EasyMock.expect(supportedFileProvider.getFileExtensions()).andReturn(new FileExtension[]{FileExtension.CPTX}).anyTimes(); - EasyMock.replay(supportedFileProvider); - return supportedFileProvider; + public FileExtension[] getFileExtensions() { + return new FileExtension[]{FileExtension.CPTX + }; } - } } From 1bca44b7c73e5d7c244509008d8fff987496a2f9 Mon Sep 17 00:00:00 2001 From: Bryant Date: Thu, 17 Oct 2019 16:16:18 +0800 Subject: [PATCH 41/95] =?UTF-8?q?REPORT-22779=20=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E5=90=8E=E6=97=A0=E6=B3=95=E9=87=8D=E5=90=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/RestartHelper.java | 60 ++----------------- .../com/fr/design/os/impl/RestartAction.java | 11 +++- .../update/ui/dialog/UpdateMainDialog.java | 8 +-- .../fr/start/module/DesignerActivator.java | 2 - 4 files changed, 19 insertions(+), 62 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/RestartHelper.java b/designer-base/src/main/java/com/fr/design/RestartHelper.java index 8a6d02823f..cdb4fc532e 100644 --- a/designer-base/src/main/java/com/fr/design/RestartHelper.java +++ b/designer-base/src/main/java/com/fr/design/RestartHelper.java @@ -8,11 +8,10 @@ import com.fr.log.FineLoggerFactory; import com.fr.stable.ArrayUtils; import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; -import com.fr.stable.os.OperatingSystem; import com.fr.stable.os.support.OSBasedAction; -import com.fr.stable.os.support.OSSupportCenter; import com.fr.workspace.WorkContext; +import javax.swing.*; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; @@ -20,8 +19,6 @@ import java.io.IOException; import java.io.RandomAccessFile; import java.nio.channels.FileChannel; import java.nio.channels.FileLock; -import java.util.ArrayList; -import java.util.List; import java.util.Map; import java.util.Properties; @@ -34,7 +31,7 @@ public class RestartHelper { public static final String RECORD_FILE = StableUtils.pathJoin(StableUtils.getInstallHome(), "delete.properties"); public static final String MOVE_FILE = StableUtils.pathJoin(StableUtils.getInstallHome(), "move.properties"); - private static OSBasedAction restartAction; + private static final OSBasedAction restartAction = new RestartAction(); /** * 把要删除的文件都记录到delete.properties中 @@ -147,58 +144,19 @@ public class RestartHelper { restart(ArrayUtils.EMPTY_STRING_ARRAY); } - public static void restartForUpdate(String installHome) { + public static void restartForUpdate(JFrame frame) { try { - if (OperatingSystem.isMacos()) { - restartInMacOS(installHome, ArrayUtils.EMPTY_STRING_ARRAY); - } else if (OperatingSystem.isLinux()){ - restartInLinux(installHome, ArrayUtils.EMPTY_STRING_ARRAY); - } else { - restartInWindows(installHome,ArrayUtils.EMPTY_STRING_ARRAY); - } + restartAction.execute(ArrayUtils.EMPTY_STRING_ARRAY); } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage()); } finally { WorkContext.getCurrent().close(); + frame.dispose(); System.exit(0); } } - private static void restartInMacOS(String installHome, String[] filesToBeDelete) throws Exception { - ProcessBuilder builder = new ProcessBuilder(); - List commands = new ArrayList<>(); - commands.add("open"); - commands.add(installHome + File.separator + "bin" + File.separator + "restart.app"); - if (ArrayUtils.isNotEmpty(filesToBeDelete)) { - commands.add("--args"); - commands.add(StableUtils.join(filesToBeDelete, "+")); - } - builder.command(commands); - builder.start(); - } - private static void restartInWindows(String installHome, String[] filesToBeDelete) throws Exception { - ProcessBuilder builder = new ProcessBuilder(); - List commands = new ArrayList<>(); - commands.add(installHome + File.separator + "bin" + File.separator + "restart.exe"); - if (ArrayUtils.isNotEmpty(filesToBeDelete)) { - commands.add(StableUtils.join(filesToBeDelete, "+")); - } - builder.command(commands); - builder.start(); - } - - private static void restartInLinux(String installHome, String[] filesToBeDelete) throws Exception { - ProcessBuilder builder = new ProcessBuilder(); - List commands = new ArrayList<>(); - //现在先写的是restart.sh - commands.add(installHome + File.separator + "bin" + File.separator + "restart.sh"); - if (ArrayUtils.isNotEmpty(filesToBeDelete)) { - commands.add(StableUtils.join(filesToBeDelete, "+")); - } - builder.command(commands); - builder.start(); - } /** * 重启设计器并删除某些特定的文件 @@ -239,12 +197,4 @@ public class RestartHelper { DesignerContext.getDesignerFrame().exit(); } } - - /** - * 提前初始化重启动作 - */ - public static void initRestartAction(){ - restartAction = OSSupportCenter.getAction(RestartAction.class); - } - } \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/os/impl/RestartAction.java b/designer-base/src/main/java/com/fr/design/os/impl/RestartAction.java index b18254c113..47a7ae43bf 100644 --- a/designer-base/src/main/java/com/fr/design/os/impl/RestartAction.java +++ b/designer-base/src/main/java/com/fr/design/os/impl/RestartAction.java @@ -10,10 +10,19 @@ import java.util.ArrayList; import java.util.List; public class RestartAction implements OSBasedAction { + + private static String installHome; + + public RestartAction() { + installHome = StableUtils.getInstallHome(); + } + @Override public void execute(Object... objects) { String[] filesToBeDelete = (String[])objects; - String installHome = StableUtils.getInstallHome(); + if (installHome == null) { + installHome = StableUtils.getInstallHome(); + } try{ if (OperatingSystem.isMacos()) { restartInMacOS(installHome, filesToBeDelete); diff --git a/designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java b/designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java index 8633c0616d..c736b6383b 100644 --- a/designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java +++ b/designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java @@ -30,7 +30,6 @@ import com.fr.json.JSONArray; import com.fr.json.JSONObject; import com.fr.log.FineLoggerFactory; import com.fr.stable.*; -import com.fr.stable.project.ProjectConstants; import com.fr.third.org.apache.http.client.methods.CloseableHttpResponse; import com.fr.third.org.apache.http.client.methods.HttpGet; import com.fr.third.org.apache.http.impl.client.CloseableHttpClient; @@ -594,20 +593,21 @@ public class UpdateMainDialog extends UIDialog { updateButton.setEnabled(false); updateLabel.setVisible(false); RestoreResultDialog.deletePreviousPropertyFile(); - final String installHome = StableUtils.getInstallHome(); + final JFrame frame = DesignerContext.getDesignerFrame(); + final RestartHelper helper = new RestartHelper(); new FileProcess(callBack) { @Override public void onDownloadSuccess() { progressBar.setVisible(false); deleteForDesignerUpdate(); - RestartHelper.restartForUpdate(installHome); + helper.restartForUpdate(frame); } @Override public void onDownloadFailed() { progressBar.setVisible(false); deleteForDesignerUpdate(); JOptionPane.showMessageDialog(getParent(), Toolkit.i18nText("Fine-Design_Update_Info_Failed_Message")); - RestartHelper.restartForUpdate(installHome); + helper.restartForUpdate(frame); } }.execute(); } diff --git a/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java b/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java index 051857c330..1727906fb0 100644 --- a/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java +++ b/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java @@ -11,7 +11,6 @@ import com.fr.config.MarketConfig; import com.fr.decision.update.backup.RecoverManager; import com.fr.design.DesignerEnvManager; import com.fr.design.ExtraDesignClassManager; -import com.fr.design.RestartHelper; import com.fr.design.actions.NewFormAction; import com.fr.design.actions.core.ActionFactory; import com.fr.design.actions.insert.cell.BiasCellAction; @@ -140,7 +139,6 @@ public class DesignerActivator extends Activator { storePassport(); AlphaFineHelper.switchConfig4Locale(); RecoverManager.register(new RecoverForDesigner()); - RestartHelper.initRestartAction(); } @Override From fd7ba3b406d0bc9c725962f7f2a6aa6ad73e93ca Mon Sep 17 00:00:00 2001 From: "Joe.Jiang" Date: Fri, 18 Oct 2019 13:36:50 +0800 Subject: [PATCH 42/95] =?UTF-8?q?REPORT-20492=20=E5=8D=95=E5=85=83?= =?UTF-8?q?=E6=A0=BC=E5=B1=9E=E6=80=A7=E8=AE=BE=E7=BD=AE=E5=BD=A2=E6=80=81?= =?UTF-8?q?-=E6=95=B0=E6=8D=AE=E5=AD=97=E5=85=B8=EF=BC=8C=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=BA=93=E8=BF=9E=E6=8E=A5=E5=A4=B1=E8=B4=A5=E7=9A=84?= =?UTF-8?q?=E5=BC=B9=E6=A1=86=E4=B8=AD=E5=9B=BE=E6=A0=87=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/data/datapane/ChoosePane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java index 413a0f00d1..bfa2c20250 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java @@ -461,7 +461,7 @@ public class ChoosePane extends BasicBeanPane implements Refresha if (!connect) { DesignerFrame designerFrame = DesignerContext.getDesignerFrame(); JOptionPane.showMessageDialog(designerFrame, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Database_Connection_Failed"), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Failed"), JOptionPane.INFORMATION_MESSAGE); + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Failed"), JOptionPane.ERROR_MESSAGE); failedToFindTable(); return null; } From 28b30e7ddb5f9dcaf988f0d17f9cbd0d0ea052ff Mon Sep 17 00:00:00 2001 From: "Joe.Jiang" Date: Fri, 18 Oct 2019 14:15:30 +0800 Subject: [PATCH 43/95] =?UTF-8?q?REPORT-15424=20=E7=94=A8=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8=E8=BF=9E=E6=8E=A5swift=E8=BF=9B=E8=A1=8C=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E5=88=86=E6=9E=90=E7=9A=84=E6=97=B6=E5=80=99=EF=BC=8C?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E9=80=89=E5=8F=96=E5=88=B0swift=E9=A9=B1?= =?UTF-8?q?=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/data/datapane/connect/JDBCDefPane.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java index d6137b986e..7bbcda825f 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java @@ -43,7 +43,8 @@ public class JDBCDefPane extends JPanel { jdbcMap.put(OTHER_DB, new DriverURLName[]{new DriverURLName("sun.jdbc.odbc.JdbcOdbcDriver", "jdbc:odbc:"), new DriverURLName("org.hsqldb.jdbcDriver", "jdbc:hsqldb:file:[PATH_TO_DB_FILES]"), new DriverURLName("com.inet.tds.TdsDriver", "jdbc:inetdae7:localhost:1433/"), new DriverURLName("COM.cloudscape.JDBCDriver", "jdbc:cloudscape:/cloudscape/"), - new DriverURLName("com.internetcds.jdbc.tds.Driver", "jdbc:freetds:sqlserver://localhost/")}); + new DriverURLName("com.internetcds.jdbc.tds.Driver", "jdbc:freetds:sqlserver://localhost/"), + new DriverURLName("com.fr.swift.jdbc.Driver", "jdbc:swift:emb://default")}); jdbcMap.put("Inceptor",new DriverURLName[]{new DriverURLName("org.apache.hive.jdbc.HiveDriver","jdbc:inceptor2://localhost:10000/default"), new DriverURLName("org.apache.hadoop.hive.jdbc.HiveDriver","jdbc:inceptor://localhost:10000/default")}); jdbcMap.put("Oracle", new DriverURLName[]{new DriverURLName("oracle.jdbc.driver.OracleDriver", "jdbc:oracle:thin:@localhost:1521:databaseName")}); From 84da5ceb617e0b4d471a6d1c8fdeec4d962c1c2f Mon Sep 17 00:00:00 2001 From: kerry Date: Fri, 18 Oct 2019 16:53:05 +0800 Subject: [PATCH 44/95] =?UTF-8?q?REPORT-23017=20=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=20*.frm=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/JTemplate.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java index 22ffc54036..b9b08552f2 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java @@ -668,7 +668,7 @@ public abstract class JTemplate> for (ReportSupportedFileUIProvider provider : providers) { result = result || provider.saveToNewFile(this.editingFILE.getPath(), this); } - if(!result && FileExtension.CPT.matchExtension(this.editingFILE.getPath())){ + if(!result){ result = result || this.saveFile(); //更换最近打开 DesignerEnvManager.getEnvManager().replaceRecentOpenedFilePath(oldName, this.getPath()); From 28062c164d79499bd11a932791b2a960538b1658 Mon Sep 17 00:00:00 2001 From: "Joe.Jiang" Date: Mon, 21 Oct 2019 14:46:17 +0800 Subject: [PATCH 45/95] =?UTF-8?q?REPORT-21592=20=E5=8D=95=E5=85=83?= =?UTF-8?q?=E6=A0=BC=E5=B1=9E=E6=80=A7-=E5=BD=A2=E6=80=81-=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=AD=97=E5=85=B8=EF=BC=8C=E9=80=89=E6=8B=A9=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E9=9C=80=E8=A6=81=E5=86=85=E7=BD=91=E8=BF=9E=E6=8E=A5?= =?UTF-8?q?=E7=9A=84=E6=95=B0=E6=8D=AE=E5=BA=93=EF=BC=8C=E4=B8=80=E7=9B=B4?= =?UTF-8?q?=E5=9C=A8=E5=8A=A0=E8=BD=BD=EF=BC=8C=E6=B2=A1=E6=9C=89=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD=E6=88=90=E5=8A=9F=E6=88=96=E8=80=85=E5=A4=B1=E8=B4=A5?= =?UTF-8?q?=E7=9A=84=E5=BC=B9=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/data/datapane/ChoosePane.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java index bfa2c20250..d075d79f83 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java @@ -438,6 +438,9 @@ public class ChoosePane extends BasicBeanPane implements Refresha } } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); + DesignerFrame designerFrame = DesignerContext.getDesignerFrame(); + JOptionPane.showMessageDialog(designerFrame, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Database_Connection_Failed"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Failed"), JOptionPane.ERROR_MESSAGE); } } From 3f5f9b40dbc5e7df7c94ddaa6cb5344d851adddc Mon Sep 17 00:00:00 2001 From: "Joe.Jiang" Date: Mon, 21 Oct 2019 15:03:20 +0800 Subject: [PATCH 46/95] =?UTF-8?q?REPORT-21592=20=E5=8D=95=E5=85=83?= =?UTF-8?q?=E6=A0=BC=E5=B1=9E=E6=80=A7-=E5=BD=A2=E6=80=81-=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=AD=97=E5=85=B8=EF=BC=8C=E9=80=89=E6=8B=A9=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E9=9C=80=E8=A6=81=E5=86=85=E7=BD=91=E8=BF=9E=E6=8E=A5?= =?UTF-8?q?=E7=9A=84=E6=95=B0=E6=8D=AE=E5=BA=93=EF=BC=8C=E4=B8=80=E7=9B=B4?= =?UTF-8?q?=E5=9C=A8=E5=8A=A0=E8=BD=BD=EF=BC=8C=E6=B2=A1=E6=9C=89=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD=E6=88=90=E5=8A=9F=E6=88=96=E8=80=85=E5=A4=B1=E8=B4=A5?= =?UTF-8?q?=E7=9A=84=E5=BC=B9=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/data/datapane/ChoosePane.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java index d075d79f83..028f71363b 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java @@ -438,8 +438,7 @@ public class ChoosePane extends BasicBeanPane implements Refresha } } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); - DesignerFrame designerFrame = DesignerContext.getDesignerFrame(); - JOptionPane.showMessageDialog(designerFrame, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Database_Connection_Failed"), + JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Database_Connection_Failed"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Failed"), JOptionPane.ERROR_MESSAGE); } } From 3fd4e107a3170dd5dc467a7bfebc71a38481f55a Mon Sep 17 00:00:00 2001 From: kerry Date: Tue, 22 Oct 2019 13:38:18 +0800 Subject: [PATCH 47/95] =?UTF-8?q?REPORT-23053=E3=80=9010.0.4=E5=9B=9E?= =?UTF-8?q?=E5=BD=92=E3=80=91=E8=BF=9C=E7=A8=8B=E8=AE=BE=E8=AE=A1=E8=BE=93?= =?UTF-8?q?=E5=87=BAExcel=E3=80=81=E5=86=85=E7=BD=AE=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9B=86=E6=A8=A1=E7=89=88=EF=BC=8C=E6=96=87=E4=BB=B6=E5=90=8E?= =?UTF-8?q?=E7=BC=80=E9=87=8D=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/JTemplate.java | 15 +----- .../fr/design/module/DesignModuleFactory.java | 5 +- .../java/com/fr/file/FILEChooserPane.java | 48 ++++++++++++++----- .../java/com/fr/file/FILEChooserPaneTest.java | 17 +++---- .../java/com/fr/design/mainframe/JForm.java | 7 +-- .../com/fr/design/mainframe/JWorkBook.java | 10 ++++ 6 files changed, 62 insertions(+), 40 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java index b9b08552f2..2b06fb2e93 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java @@ -628,22 +628,11 @@ public abstract class JTemplate> } } - private void addChooseFILEFilter(FILEChooserPane fileChooser){ - String appName = ProductConstants.APP_NAME; - if (FileExtension.CPT.matchExtension(this.suffix())){ - fileChooser.addChooseFILEFilter(new ChooseFileFilter(FileExtension.CPT, appName + Toolkit.i18nText("Fine-Design_Report_Template_File"))); - } - if (FileExtension.FRM.matchExtension(this.suffix())) { - // richer:form文件 daniel 改成三个字 - fileChooser.addChooseFILEFilter(new ChooseFileFilter(FileExtension.FRM, appName + Toolkit.i18nText("Fine-Design_Report_Template_File"))); - } - addExtraChooseFILEFilter(fileChooser); - } - - protected void addExtraChooseFILEFilter(FILEChooserPane fileChooser){ + protected void addChooseFILEFilter(FILEChooserPane fileChooser){ } + // 保存新模板时会进入此方法(新建模板直接保存,或者另存为) protected boolean saveNewFile(FILE editingFILE, String oldName) { String originID = StringUtils.EMPTY; diff --git a/designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java b/designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java index 74cf7cbd35..9669b7cf92 100644 --- a/designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java +++ b/designer-base/src/main/java/com/fr/design/module/DesignModuleFactory.java @@ -15,6 +15,7 @@ import com.fr.design.parameter.ParameterDesignerProvider; import com.fr.design.parameter.ParameterReader; import com.fr.form.ui.Widget; import com.fr.log.FineLoggerFactory; +import com.fr.plugin.solution.sandbox.collection.PluginSandboxCollections; import com.fr.stable.StableUtils; import org.jetbrains.annotations.NotNull; @@ -235,7 +236,7 @@ public class DesignModuleFactory { public static void registerParameterReader(ParameterReader reader) { if (instance.parameterReaderList == null) { - instance.parameterReaderList = new ArrayList(); + instance.parameterReaderList = PluginSandboxCollections.newSandboxList(); } instance.parameterReaderList.add(reader); } @@ -246,4 +247,4 @@ public class DesignModuleFactory { } return instance.parameterReaderList.toArray(new ParameterReader[instance.parameterReaderList.size()]); } -} \ No newline at end of file +} diff --git a/designer-base/src/main/java/com/fr/file/FILEChooserPane.java b/designer-base/src/main/java/com/fr/file/FILEChooserPane.java index 7f03b6672d..b938845380 100644 --- a/designer-base/src/main/java/com/fr/file/FILEChooserPane.java +++ b/designer-base/src/main/java/com/fr/file/FILEChooserPane.java @@ -4,12 +4,14 @@ import com.fr.base.BaseUtils; import com.fr.base.FRContext; import com.fr.base.extension.FileExtension; import com.fr.design.DesignerEnvManager; +import com.fr.design.ExtraDesignClassManager; import com.fr.design.actions.UpdateAction; import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.UIDialog; import com.fr.design.env.DesignerWorkspaceInfo; import com.fr.design.env.DesignerWorkspaceType; import com.fr.design.file.HistoryTemplateListPane; +import com.fr.design.fun.ReportSupportedFileUIProvider; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButtonUI; import com.fr.design.gui.icombobox.UIComboBox; @@ -90,6 +92,7 @@ import java.util.ArrayList; import java.util.EnumSet; import java.util.Iterator; import java.util.List; +import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -475,8 +478,9 @@ public class FILEChooserPane extends BasicPane { @Override public void itemStateChanged(ItemEvent e) { Object ss = postfixComboBox.getSelectedItem(); - if (ss instanceof FILEFilter) { - setFILEFilter((FILEFilter) ss); + if (ss instanceof ChooseFileFilter) { + setFILEFilter((ChooseFileFilter) ss); + fileNameTextField.setText(calProperFileName(fileNameTextField.getText(), (ChooseFileFilter) ss)); } else { setFILEFilter(null); } @@ -484,6 +488,21 @@ public class FILEChooserPane extends BasicPane { }); } + private String calProperFileName(String fileName, ChooseFileFilter fileFilter) { + if(fileFilter == null){ + return fileName; + } + String filterExtension = fileFilter.getExtensionString(); + int lastDotIndex = fileName.lastIndexOf(".") != -1 ? fileName.lastIndexOf(".") : fileName.length(); + String fileNameWithOutExtension = fileName.substring(0, lastDotIndex); + String fileNameExtension = fileName.substring(lastDotIndex); + FileExtension fileExtension = FileExtension.parse(fileNameExtension); + if (StringUtils.isEmpty(fileName) || StringUtils.isEmpty(filterExtension) || fileFilter.containsExtension(fileExtension.getExtension())) { + return fileName; + } + return fileNameWithOutExtension + filterExtension; + } + private void doCancel() { this.locationBtnPane.setPopDir(null); dialogExit(); @@ -720,7 +739,14 @@ public class FILEChooserPane extends BasicPane { if (editing == null || !editing.isChartBook()) { if (type == JFileChooser.OPEN_DIALOG) { - this.addChooseFILEFilter(new ChooseFileFilter(FRContext.getFileNodes().getSupportedTypes(), appName + Toolkit.i18nText("Fine-Design_Report_Template_File"))); + ChooseFileFilter supportedTypes = new ChooseFileFilter(FRContext.getFileNodes().getSupportedTypes(), appName + Toolkit.i18nText("Fine-Design_Report_Template_File")); + Set providers = ExtraDesignClassManager.getInstance().getArray(ReportSupportedFileUIProvider.XML_TAG); + for (ReportSupportedFileUIProvider provider : providers) { + for (FileExtension fileExtension : provider.getFileExtensions()){ + supportedTypes.addExtension(fileExtension.getExtension()); + } + } + this.addChooseFILEFilter(supportedTypes); } // ben:filefilter设置初值为cpt过滤 @@ -728,6 +754,11 @@ public class FILEChooserPane extends BasicPane { // richer:form文件 daniel 改成三个字 this.addChooseFILEFilter(new ChooseFileFilter(FileExtension.FRM, appName + Toolkit.i18nText("Fine-Design_Report_Template_File"))); + + Set providers = ExtraDesignClassManager.getInstance().getArray(ReportSupportedFileUIProvider.XML_TAG); + for (ReportSupportedFileUIProvider provider : providers) { + provider.addChooseFileFilter(this, StringUtils.EMPTY); + } } else { if (type == JFileChooser.OPEN_DIALOG) { this.addChooseFILEFilter(new ChooseFileFilter(EnumSet.of(FileExtension.XLS, FileExtension.XLSX), Toolkit.i18nText("Fine-Design_Basic_Import_Excel_Source"))); @@ -834,7 +865,8 @@ public class FILEChooserPane extends BasicPane { private void saveDialog() { String filename = fileNameTextField.getText(); - fileNameTextField.setText(calFileNameText(filename, (ChooseFileFilter) (postfixComboBox.getSelectedItem()))); + filename = calProperFileName(filename, (ChooseFileFilter) (postfixComboBox.getSelectedItem())); + fileNameTextField.setText(filename); option = OK_OPTION; FILE selectedFile = this.getSelectedFILE(); @@ -860,14 +892,6 @@ public class FILEChooserPane extends BasicPane { } } - private String calFileNameText(String currentValue, ChooseFileFilter selectFileFilter) { - if (selectFileFilter == null || StringUtils.isEmpty(selectFileFilter.getExtensionString())) { - return currentValue + this.suffix; - } else if (!currentValue.endsWith(selectFileFilter.getExtensionString())) { - return currentValue + selectFileFilter.getExtensionString(); - } - return currentValue; - } private boolean access(FILE selectedFile) { boolean access = false; diff --git a/designer-base/src/test/java/com/fr/file/FILEChooserPaneTest.java b/designer-base/src/test/java/com/fr/file/FILEChooserPaneTest.java index d3d601c288..c8431a8621 100644 --- a/designer-base/src/test/java/com/fr/file/FILEChooserPaneTest.java +++ b/designer-base/src/test/java/com/fr/file/FILEChooserPaneTest.java @@ -15,23 +15,24 @@ public class FILEChooserPaneTest { @Test public void testAddChooseFileFilter() { FILEChooserPane chooserPane = Reflect.on(FILEChooserPane.class).field("INSTANCE").get(); - String result1 = Reflect.on(chooserPane).call("calFileNameText", "WorkBook1.cpt", null).get(); - Assert.assertEquals("WorkBook1.cptnull", result1); + Reflect.on(chooserPane).set("suffix", ".cpt"); + String result1 = Reflect.on(chooserPane).call("calProperFileName", "WorkBook1.cpt", null).get(); + Assert.assertEquals("WorkBook1.cpt", result1); ChooseFileFilter chooseFileFilter1 = new ChooseFileFilter(FileExtension.CPT, StringUtils.EMPTY); - String result2 = Reflect.on(chooserPane).call("calFileNameText", "WorkBook1.cpt", chooseFileFilter1).get(); + String result2 = Reflect.on(chooserPane).call("calProperFileName", "WorkBook1.cpt", chooseFileFilter1).get(); Assert.assertEquals("WorkBook1.cpt", result2); ChooseFileFilter chooseFileFilter2 = new ChooseFileFilter(FileExtension.CPTX, StringUtils.EMPTY); - String result3 = Reflect.on(chooserPane).call("calFileNameText", "WorkBook1.cpt", chooseFileFilter2).get(); - Assert.assertEquals("WorkBook1.cpt.cptx", result3); + String result3 = Reflect.on(chooserPane).call("calProperFileName", "WorkBook1.cpt", chooseFileFilter2).get(); + Assert.assertEquals("WorkBook1.cptx", result3); ChooseFileFilter chooseFileFilter3 = new ChooseFileFilter(FileExtension.CPT, StringUtils.EMPTY); - String result4 = Reflect.on(chooserPane).call("calFileNameText", "WorkBook1.cptx", chooseFileFilter3).get(); - Assert.assertEquals("WorkBook1.cptx.cpt", result4); + String result4 = Reflect.on(chooserPane).call("calProperFileName", "WorkBook1.cptx", chooseFileFilter3).get(); + Assert.assertEquals("WorkBook1.cpt", result4); ChooseFileFilter chooseFileFilter5 = new ChooseFileFilter(FileExtension.CPTX, StringUtils.EMPTY); - String result5 = Reflect.on(chooserPane).call("calFileNameText", "WorkBook1.cptx", chooseFileFilter5).get(); + String result5 = Reflect.on(chooserPane).call("calProperFileName", "WorkBook1.cptx", chooseFileFilter5).get(); Assert.assertEquals("WorkBook1.cptx", result5); } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java index 0abafdabdd..a37a1c4665 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java @@ -957,10 +957,7 @@ public class JForm extends JTemplate implements BaseJForm { return ViewRequestConstants.REPORT_VIEW_PATH; } + protected void addChooseFILEFilter(FILEChooserPane fileChooser) { + String appName = ProductConstants.APP_NAME; + fileChooser.addChooseFILEFilter(new ChooseFileFilter(FileExtension.CPT, appName + Toolkit.i18nText("Fine-Design_Report_Template_File"))); + addExtraChooseFILEFilter(fileChooser); + } + protected void addExtraChooseFILEFilter(FILEChooserPane fileChooser){ Set providers = ExtraDesignClassManager.getInstance().getArray(ReportSupportedFileUIProvider.XML_TAG); for (ReportSupportedFileUIProvider provider : providers) { From e3c464758a5ec2e99eafe8e905b748783700eb43 Mon Sep 17 00:00:00 2001 From: vito Date: Tue, 22 Oct 2019 16:49:17 +0800 Subject: [PATCH 48/95] =?UTF-8?q?REPORT-23038=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E9=83=A8=E5=88=86=E6=8F=92=E4=BB=B6=E4=B8=8E=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E8=BE=93=E5=87=BA=E6=AD=BB=E9=94=81=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../loghandler/DesignerLogHandler.java | 188 +++++++++--------- 1 file changed, 98 insertions(+), 90 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/loghandler/DesignerLogHandler.java b/designer-base/src/main/java/com/fr/design/mainframe/loghandler/DesignerLogHandler.java index 53802507c8..57d1d457f6 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/loghandler/DesignerLogHandler.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/loghandler/DesignerLogHandler.java @@ -4,6 +4,7 @@ import com.fr.base.BaseUtils; import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.imenu.UIMenuItem; import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.ui.util.UIUtil; import com.fr.general.ComparatorUtils; import com.fr.general.log.Log4jConfig; import com.fr.log.FineLoggerFactory; @@ -41,66 +42,66 @@ import java.util.Date; import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER; public class DesignerLogHandler { - + private final SimpleDateFormat LOG_SIMPLE_DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - + private static final int GAP_X = -150; - + private static final int INFO_GAP_Y = -60; - + private static final int ERRO_GAP_Y = -40; - + private static final int SERVER_GAP_Y = -20; - + public static DesignerLogHandler getInstance() { - + return HOLDER.singleton; } - + private static class HOLDER { - + private static DesignerLogHandler singleton = new DesignerLogHandler(); } - + // 所有的面板 private LogHandlerBar caption; - + private JCheckBoxMenuItem showInfo; - + private JCheckBoxMenuItem showError; - + private JCheckBoxMenuItem showServer; - + private LogHandlerArea logHandlerArea; - + public DesignerLogHandler() { - + logHandlerArea = new LogHandlerArea(); caption = new LogHandlerBar(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Log")); - + caption.addClearListener(new ActionListener() { - + @Override public void actionPerformed(ActionEvent e) { - + logHandlerArea.jTextArea.setText(""); caption.clearMessage(); } }); caption.addSelectedListener(new ActionListener() { - + @Override public void actionPerformed(ActionEvent e) { - + logHandlerArea.jTextArea.requestFocus(); logHandlerArea.jTextArea.selectAll(); } }); ItemListener itemlistener = new ItemListener() { - + @Override public void itemStateChanged(ItemEvent e) { - + logHandlerArea.jTextArea.setText(""); caption.clearMessage(); } @@ -112,12 +113,12 @@ public class DesignerLogHandler { showServer = new JCheckBoxMenuItem(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Log_Level_Error"), true); showServer.addItemListener(itemlistener); caption.addSetListener(new ActionListener() { - + @Override public void actionPerformed(ActionEvent e) { - + JPopupMenu jPopupMenu = new JPopupMenu(); - + int logLevelInt = Log4jConfig.getInstance().getRootLevel().toInt(); if (logLevelInt <= DesignerLogger.INFO_INT) { jPopupMenu.add(showInfo); @@ -135,72 +136,73 @@ public class DesignerLogHandler { } }); } - + public JComponent getLogHandlerArea() { - + return logHandlerArea; } - + public JComponent getCaption() { - + return caption; } - + public void printRemoteLog(String message, Level level, Date date) { - + logHandlerArea.printStackTrace(message, level, date); } - + private class LogHandlerArea extends JPanel { - + private static final long serialVersionUID = 8215630927304621660L; - + private JTextPane jTextArea; - + private JPopupMenu popup; - + private UIMenuItem selectAll; - + private UIMenuItem copy; - + private UIMenuItem clear; - + private LogHandlerArea() { - + jTextArea = initLogJTextArea(); this.setLayout(FRGUIPaneFactory.createBorderLayout()); UIScrollPane js = new UIScrollPane(jTextArea); this.add(js, BorderLayout.CENTER); this.setPreferredSize(new Dimension(super.getPreferredSize().width, 150)); - + jTextArea.setEditable(false); jTextArea.setBackground(Color.WHITE); - + popup = new JPopupMenu(); selectAll = new UIMenuItem(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Select_All")); selectAll.addActionListener(popupListener); selectAll.setIcon(BaseUtils.readIcon("/com/fr/design/images/log/selectedall.png")); popup.add(selectAll); - + copy = new UIMenuItem(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Copy")); copy.addActionListener(popupListener); copy.setIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/copy.png")); popup.add(copy); - + clear = new UIMenuItem(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Clear_All")); clear.addActionListener(popupListener); clear.setIcon(BaseUtils.readIcon("/com/fr/design/images/log/clear.png")); popup.add(clear); - + selectAll.setAccelerator(KeyStroke.getKeyStroke('A', DEFAULT_MODIFIER)); copy.setAccelerator(KeyStroke.getKeyStroke('C', DEFAULT_MODIFIER)); clear.setAccelerator(KeyStroke.getKeyStroke('L', DEFAULT_MODIFIER)); - + jTextArea.addMouseListener(new MouseAdapter() { - + // check for right click + @Override public void mousePressed(MouseEvent event) { - + if (event.getButton() == MouseEvent.BUTTON3) { popup.show(jTextArea, event.getX(), event.getY()); checkEnabled(); @@ -208,9 +210,9 @@ public class DesignerLogHandler { } }); } - + private JTextPane initLogJTextArea() { - + final JTextPane resultPane = new JTextPane(); InputMap inputMap = resultPane.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_C, DEFAULT_MODIFIER), DefaultEditorKit.copyAction); @@ -218,18 +220,19 @@ public class DesignerLogHandler { inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_L, DEFAULT_MODIFIER), "clear"); ActionMap actionMap = resultPane.getActionMap(); actionMap.put("clear", new AbstractAction() { - + + @Override public void actionPerformed(ActionEvent evt) { - + resultPane.setText(""); caption.clearMessage(); } }); return resultPane; } - + public void printStackTrace(LoggingEvent event) { - + int intLevel = event.getLevel().toInt(); Date date = new Date(event.getTimeStamp()); ThrowableInformation information = event.getThrowableInformation(); @@ -241,9 +244,9 @@ public class DesignerLogHandler { printMessage(event.getRenderedMessage(), intLevel, date, information == null ? null : information.getThrowable()); } } - + public void printStackTrace(String message, Level level, Date date) { - + int intLevel = level.toInt(); if (intLevel == DesignerLogger.INFO_INT && showInfo.isSelected()) { printMessage(message, intLevel, date); @@ -252,32 +255,36 @@ public class DesignerLogHandler { } else if (intLevel == DesignerLogger.WARN_INT && showServer.isSelected()) { printMessage(message, intLevel, date); } - + } - + private void printMessage(String message, int intLevel, Date date) { - + printMessage(message, intLevel, date, null); } - - private void printMessage(String msg, int intLevel, Date date, Throwable e) { - - this.log(LOG_SIMPLE_DATE_FORMAT.format(date) + "\n", 0); - String message = appendLocaleMark(msg, intLevel); - this.log(message, intLevel); - setMessage(message, intLevel); - if (e == null) { - return; - } - - StackTraceElement[] traceElements = e.getStackTrace(); - for (int i = 0; i < traceElements.length; i++) { - this.log("\t" + "at " + traceElements[i].toString() + "\n", 0); - } + + private void printMessage(final String msg, final int intLevel, final Date date, final Throwable e) { + UIUtil.invokeLaterIfNeeded(new Runnable() { + @Override + public void run() { + LogHandlerArea.this.log(LOG_SIMPLE_DATE_FORMAT.format(date) + "\n", 0); + String message = appendLocaleMark(msg, intLevel); + LogHandlerArea.this.log(message, intLevel); + setMessage(message, intLevel); + if (e == null) { + return; + } + + StackTraceElement[] traceElements = e.getStackTrace(); + for (StackTraceElement traceElement : traceElements) { + LogHandlerArea.this.log("\t" + "at " + traceElement.toString() + "\n", 0); + } + } + }); } - + private void log(String str, int style) { - + SimpleAttributeSet attrSet = new SimpleAttributeSet(); if (style == DesignerLogger.ERROR_INT) { StyleConstants.setForeground(attrSet, new Color(247, 148, 29)); @@ -299,9 +306,9 @@ public class DesignerLogHandler { FineLoggerFactory.getLogger().error(e.getMessage(), e); } } - + private String appendLocaleMark(String str, int style) { - + if (style == DesignerLogger.ERROR_INT) { str = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Alert") + ":" + str + "\n"; } else if (style == DesignerLogger.WARN_INT) { @@ -311,9 +318,9 @@ public class DesignerLogHandler { } return str; } - + private void setMessage(String message, int level) { - + LogMessageBar.getInstance().setMessage(message); if (level == DesignerLogger.INFO_INT && showInfo.isSelected()) { caption.infoAdd(); @@ -323,31 +330,32 @@ public class DesignerLogHandler { caption.serverAdd(); } } - + private void checkEnabled() { - + this.selectAll.setEnabled(true); this.copy.setEnabled(true); this.clear.setEnabled(true); - + if (ComparatorUtils.equals(this.jTextArea.getText(), "")) { this.selectAll.setEnabled(false); this.clear.setEnabled(false); } - + if (ComparatorUtils.equals(this.jTextArea.getSelectionStart(), this.jTextArea.getSelectionEnd())) { this.copy.setEnabled(false); } - + if (this.jTextArea.getSelectionStart() == 0 && ComparatorUtils.equals(this.jTextArea.getSelectionEnd(), this.jTextArea.getText().length())) { this.selectAll.setEnabled(false); } } - + ActionListener popupListener = new ActionListener() { - + + @Override public void actionPerformed(ActionEvent evt) { - + if (ComparatorUtils.equals(evt.getActionCommand(), LogHandlerArea.this.selectAll.getText())) { LogHandlerArea.this.jTextArea.selectAll(); } else if (ComparatorUtils.equals(evt.getActionCommand(), LogHandlerArea.this.copy.getText())) { @@ -358,6 +366,6 @@ public class DesignerLogHandler { } } }; - + } } From 057b99da9133e4b050b11bafe040ac6282b060ea Mon Sep 17 00:00:00 2001 From: "Joe.Jiang" Date: Tue, 22 Oct 2019 19:37:35 +0800 Subject: [PATCH 49/95] =?UTF-8?q?REPORT-19102=20=E3=80=90=E6=96=87?= =?UTF-8?q?=E6=9C=AC=E6=8E=A7=E4=BB=B6=E3=80=91=E7=94=B5=E8=AF=9D-?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E8=A7=84=E5=88=99=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E5=90=8E=EF=BC=8C=E8=A7=84=E5=88=99=E6=9C=AA=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E6=88=90=E5=8A=9F=EF=BC=8C=E4=B8=94=E4=B8=8B=E6=8B=89=E6=A1=86?= =?UTF-8?q?=E5=87=BA=E7=8E=B0=E7=A9=BA=E7=99=BD=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/mainframe/CellWidgetPropertyPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/CellWidgetPropertyPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/CellWidgetPropertyPane.java index f7c1f78250..59a58231ab 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/CellWidgetPropertyPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/CellWidgetPropertyPane.java @@ -109,7 +109,7 @@ public class CellWidgetPropertyPane extends BasicPane { if (finalCS.isSelectedOneCell(ePane)) { if (tplEC.getTemplateCellElement(cellElement.getColumn(), cellElement.getRow()) == null) {//cellElement未加入到report中时要添加进去 tplEC.addCellElement(cellElement); - } else { + } else if (tplEC.getTemplateCellElement(finalCS.getColumn(), finalCS.getRow()) != null) { cellElement = tplEC.getTemplateCellElement(finalCS.getColumn(), finalCS.getRow()); } setCellWidget(cellWidget, cellElement); From d8375487c27064bec966cce3fe8c04d0a491a6c0 Mon Sep 17 00:00:00 2001 From: "Joe.Jiang" Date: Wed, 23 Oct 2019 09:27:08 +0800 Subject: [PATCH 50/95] =?UTF-8?q?REPORT-23090=20=E6=A8=A1=E6=9D=BF-?= =?UTF-8?q?=E9=87=8D=E5=A4=8D=E4=B8=8E=E5=86=BB=E7=BB=93=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=EF=BC=8C=E7=BC=BA=E5=B0=91=E4=B8=80=E5=88=97=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/report/freeze/RepeatAndFreezeSettingPane.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/designer-realize/src/main/java/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java b/designer-realize/src/main/java/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java index 349735ac0b..1dd75e1633 100644 --- a/designer-realize/src/main/java/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java @@ -69,6 +69,7 @@ public class RepeatAndFreezeSettingPane extends BasicPane { soverlapRowStartPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Title_Start_Row_Form"))); repeatTitleRowPane = new RepeatRowPane(); soverlapRowStartPane.add(repeatTitleRowPane); + soverlapRowStartPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Row"))); return soverlapRowStartPane; } @@ -85,6 +86,7 @@ public class RepeatAndFreezeSettingPane extends BasicPane { // 重复打印标题的结束列 repeatTitleColPane = new RepeatColPane(); soverlapColStartPane.add(repeatTitleColPane); + soverlapColStartPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Column"))); return soverlapColStartPane; } @@ -100,6 +102,7 @@ public class RepeatAndFreezeSettingPane extends BasicPane { foverlapRowStartPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Finis_Start_Row_Form"))); repeatFinisRowPane = new RepeatRowPane(); foverlapRowStartPane.add(repeatFinisRowPane); + foverlapRowStartPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Row"))); return foverlapRowStartPane; } @@ -115,6 +118,7 @@ public class RepeatAndFreezeSettingPane extends BasicPane { foverlapColStartPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Finis_Start_Column_Form"))); repeatFinisColPane = new RepeatColPane(); foverlapColStartPane.add(repeatFinisColPane); + foverlapColStartPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Column"))); return foverlapColStartPane; } From 95afad2ff8af399b852a732f58ddf1977c514c33 Mon Sep 17 00:00:00 2001 From: kerry Date: Wed, 23 Oct 2019 14:38:07 +0800 Subject: [PATCH 51/95] =?UTF-8?q?REPORT-16531=E3=80=90=E8=87=AA=E9=80=82?= =?UTF-8?q?=E5=BA=94=E5=86=85=E7=BD=AE=E3=80=91=E5=90=8D=E7=A7=B0=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E4=B8=8D=E5=AF=B9=EF=BC=8C=E8=A1=A8=E5=8D=95cpt?= =?UTF-8?q?=E9=83=BD=E5=AD=98=E5=9C=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/report/fit/menupane/ReportFitAttrPane.java | 4 ++-- .../fr/design/report/fit/menupane/TemplateFitAttrPane.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/report/fit/menupane/ReportFitAttrPane.java b/designer-base/src/main/java/com/fr/design/report/fit/menupane/ReportFitAttrPane.java index 55e11e9fd2..3381df3e46 100644 --- a/designer-base/src/main/java/com/fr/design/report/fit/menupane/ReportFitAttrPane.java +++ b/designer-base/src/main/java/com/fr/design/report/fit/menupane/ReportFitAttrPane.java @@ -50,7 +50,7 @@ public class ReportFitAttrPane extends BasicBeanPane { * @return 标题 */ protected String title4PopupWindow() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Fit-Attr"); + return com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_PC_Element_Case_Fit_Attr"); } -} \ No newline at end of file +} diff --git a/designer-base/src/main/java/com/fr/design/report/fit/menupane/TemplateFitAttrPane.java b/designer-base/src/main/java/com/fr/design/report/fit/menupane/TemplateFitAttrPane.java index 01b3196f5d..66673fc5f5 100644 --- a/designer-base/src/main/java/com/fr/design/report/fit/menupane/TemplateFitAttrPane.java +++ b/designer-base/src/main/java/com/fr/design/report/fit/menupane/TemplateFitAttrPane.java @@ -50,6 +50,6 @@ public class TemplateFitAttrPane extends BasicBeanPane { * @return 标题 */ protected String title4PopupWindow() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Fit-Attr"); + return com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_PC_Fit_Attr"); } } From 74c014f79fa58570423a094614dd884ff6dbe627 Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 23 Oct 2019 16:38:58 +0800 Subject: [PATCH 52/95] =?UTF-8?q?REPORT-20625=20=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C=E4=B8=93=E9=A2=98=20=E6=A8=A1=E6=9D=BFweb?= =?UTF-8?q?=E5=B1=9E=E6=80=A7-=E5=A1=AB=E6=8A=A5=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE-=E5=A1=AB=E6=8A=A5=E5=89=8D=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6=20=E5=88=A0=E9=99=A4=E6=97=B6=E5=BC=B9=E5=87=BA?= =?UTF-8?q?=E6=A1=86=E4=BD=8D=E7=BD=AE=E5=9C=A8=E4=B8=8B=E6=96=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/webattr/EventPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/webattr/EventPane.java b/designer-realize/src/main/java/com/fr/design/webattr/EventPane.java index a4f1537106..525ee2863f 100644 --- a/designer-realize/src/main/java/com/fr/design/webattr/EventPane.java +++ b/designer-realize/src/main/java/com/fr/design/webattr/EventPane.java @@ -168,7 +168,7 @@ public class EventPane extends BasicPane { return; } - int val = JOptionPane.showConfirmDialog(EventPane.this, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Are_You_Sure_To_Delete_The_Data") + "?", "Message", + int val = JOptionPane.showConfirmDialog(SwingUtilities.getWindowAncestor(EventPane.this), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Are_You_Sure_To_Delete_The_Data") + "?", "Message", JOptionPane.YES_NO_OPTION); if (val != JOptionPane.YES_OPTION) { return; From 5f34014679f5e75863433904919c1e2e08fc8535 Mon Sep 17 00:00:00 2001 From: Bryant Date: Thu, 24 Oct 2019 09:07:58 +0800 Subject: [PATCH 53/95] =?UTF-8?q?REPORT-23155=20=E8=A7=A3=E5=86=B3?= =?UTF-8?q?=E4=BB=8E=E6=96=B0=E7=89=88=E6=9C=AC=E9=80=80=E5=9B=9E=E5=88=B0?= =?UTF-8?q?=E8=80=81=E7=89=88=E6=9C=AC=E7=9A=84=E8=BF=98=E5=8E=9F=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../update/ui/dialog/RestoreResultDialog.java | 57 +++++++++++++++---- 1 file changed, 45 insertions(+), 12 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/update/ui/dialog/RestoreResultDialog.java b/designer-base/src/main/java/com/fr/design/update/ui/dialog/RestoreResultDialog.java index 83ffbe5fe2..d69d595e21 100644 --- a/designer-base/src/main/java/com/fr/design/update/ui/dialog/RestoreResultDialog.java +++ b/designer-base/src/main/java/com/fr/design/update/ui/dialog/RestoreResultDialog.java @@ -143,7 +143,6 @@ public class RestoreResultDialog extends JDialog { jTextArea.setFont(new Font("Default", Font.PLAIN, 12)); infoPane.add(jTextArea); pane.add(infoPane, BorderLayout.CENTER); - this.setSize(RESTORE_OLD_VERSION); this.setTitle(com.fr.design.i18n.Toolkit.i18nText("FR-Designer_Updater_Restore_to_V8")); } @@ -163,33 +162,67 @@ public class RestoreResultDialog extends JDialog { String installHome = StableUtils.getInstallHome(); putJarBackupFilesToInstallLib(installHome, map, list); - putJarBackupFilesToInstallEnv(installHome, map, list); + putJarBackupFilesToInstallEnv(list); RestartHelper.saveFilesWhichToMove(map); RestartHelper.saveFilesWhichToDelete(list.toArray(new String[list.size()])); } private void putJarBackupFilesToInstallLib(String installHome, Map map, List list) { String backupDir = UpdateConstants.DESIGNER_BACKUP_DIR; + String envHome = WorkContext.getCurrent().getPath(); File installLib = new File(StableUtils.pathJoin(installHome, backupDir, jarRestoreDir, UpdateConstants.DESIGNERBACKUPPATH)); - File[] files = installLib.listFiles(); + File envLib = new File(StableUtils.pathJoin(installHome, backupDir, jarRestoreDir, UpdateConstants.BACKUPPATH)); + File[] files; + if (installLib.exists() && envLib.exists()) { + files = installLib.listFiles(); + if (files != null) { + for (File file : files) { + map.put(file.getAbsolutePath(), + StableUtils.pathJoin(installHome, ProjectConstants.LIB_NAME, file.getName())); + } + } + files = envLib.listFiles(); + if (files != null) { + for (File file : files) { + map.put(file.getAbsolutePath(), + StableUtils.pathJoin(envHome, ProjectConstants.LIB_NAME, file.getName())); + } + } + } else { + installLib = new File(StableUtils.pathJoin(installHome, backupDir, jarRestoreDir)); + files = installLib.listFiles(); + if (files != null) { + for (File file : files) { + if (file.getName().contains(UpdateConstants.DESIGNER) || file.getName().equals(UpdateConstants.ASPECTJRT)) { + map.put(file.getAbsolutePath(), + StableUtils.pathJoin(installHome, ProjectConstants.LIB_NAME, file.getName())); + } else { + map.put(file.getAbsolutePath(), + StableUtils.pathJoin(envHome, ProjectConstants.LIB_NAME, file.getName())); + } + } + } + } + installLib = new File(StableUtils.pathJoin(installHome,ProjectConstants.LIB_NAME)); + files = installLib.listFiles(); if (files != null) { for (File file : files) { - map.put(file.getAbsolutePath(), - StableUtils.pathJoin(installHome, ProjectConstants.LIB_NAME, file.getName())); - list.add(StableUtils.pathJoin(installHome, ProjectConstants.LIB_NAME, file.getName())); + if (file.getName().startsWith(UpdateConstants.FINE) || file.getName().equals(UpdateConstants.ASPECTJRT)) { + list.add(StableUtils.pathJoin(installHome, ProjectConstants.LIB_NAME, file.getName())); + } } } } - private void putJarBackupFilesToInstallEnv(String installHome, Map map, List list) { - String backupDir = UpdateConstants.DESIGNER_BACKUP_DIR; - File installEnv = new File(StableUtils.pathJoin(installHome, backupDir, jarRestoreDir, UpdateConstants.BACKUPPATH)); + private void putJarBackupFilesToInstallEnv(List list) { + String envHome = WorkContext.getCurrent().getPath(); + File installEnv = new File(StableUtils.pathJoin(envHome,ProjectConstants.LIB_NAME)); File[] files = installEnv.listFiles(); if (files != null) { for (File file : files) { - map.put(file.getAbsolutePath(), - StableUtils.pathJoin(WorkContext.getCurrent().getPath(), ProjectConstants.LIB_NAME, file.getName())); - list.add(StableUtils.pathJoin(WorkContext.getCurrent().getPath(), ProjectConstants.LIB_NAME, file.getName())); + if (file.getName().startsWith(UpdateConstants.FINE)) { + list.add(StableUtils.pathJoin(envHome, ProjectConstants.LIB_NAME, file.getName())); + } } } } From 04e4b2459767a82f877139f253cb90a44a7d28a0 Mon Sep 17 00:00:00 2001 From: "Joe.Jiang" Date: Thu, 24 Oct 2019 09:23:36 +0800 Subject: [PATCH 54/95] =?UTF-8?q?REPORT-19102=20=E3=80=90=E6=96=87?= =?UTF-8?q?=E6=9C=AC=E6=8E=A7=E4=BB=B6=E3=80=91=E7=94=B5=E8=AF=9D-?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E8=A7=84=E5=88=99=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E5=90=8E=EF=BC=8C=E8=A7=84=E5=88=99=E6=9C=AA=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E6=88=90=E5=8A=9F=EF=BC=8C=E4=B8=94=E4=B8=8B=E6=8B=89=E6=A1=86?= =?UTF-8?q?=E5=87=BA=E7=8E=B0=E7=A9=BA=E7=99=BD=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/CellWidgetPropertyPane.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/CellWidgetPropertyPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/CellWidgetPropertyPane.java index 59a58231ab..246bb72aa8 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/CellWidgetPropertyPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/CellWidgetPropertyPane.java @@ -109,8 +109,11 @@ public class CellWidgetPropertyPane extends BasicPane { if (finalCS.isSelectedOneCell(ePane)) { if (tplEC.getTemplateCellElement(cellElement.getColumn(), cellElement.getRow()) == null) {//cellElement未加入到report中时要添加进去 tplEC.addCellElement(cellElement); - } else if (tplEC.getTemplateCellElement(finalCS.getColumn(), finalCS.getRow()) != null) { - cellElement = tplEC.getTemplateCellElement(finalCS.getColumn(), finalCS.getRow()); + } else { + TemplateCellElement newCellElement = tplEC.getTemplateCellElement(finalCS.getColumn(), finalCS.getRow()); + if (newCellElement != null) { + cellElement = newCellElement; + } } setCellWidget(cellWidget, cellElement); } else { From 8b7eb9baefa572b3a88922b159b9c38eee8adbf3 Mon Sep 17 00:00:00 2001 From: "Hugh.C" Date: Thu, 24 Oct 2019 09:42:41 +0800 Subject: [PATCH 55/95] =?UTF-8?q?REPORT-22877=20=E6=A8=A1=E7=89=88?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E6=8E=A7=E5=88=B6=EF=BC=8C=E9=9B=86=E7=BE=A4?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=E6=97=B6=EF=BC=8C=E7=A6=81=E7=94=A8=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E9=85=8D=E7=BD=AE=E9=80=89=E9=A1=B9=E7=9A=84=E4=BD=BF?= =?UTF-8?q?=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/actions/file/PreferencePane.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java index d308cbe009..c4728bad65 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java @@ -1,6 +1,7 @@ package com.fr.design.actions.file; import com.fr.cluster.ClusterBridge; +import com.fr.cluster.engine.base.FineClusterConfig; import com.fr.config.Configuration; import com.fr.config.ServerPreferenceConfig; import com.fr.design.DesignerEnvManager; @@ -263,7 +264,7 @@ public class PreferencePane extends BasicPane { @Override public void stateChanged(ChangeEvent e) { boolean selected = vcsEnableCheckBox.isSelected(); - if (selected) { + if (selected && vcsEnableCheckBox.isEnabled()) { saveCommitCheckBox.setEnabled(true); saveIntervalEditor.setEnabled(true); useIntervalCheckBox.setEnabled(true); @@ -307,14 +308,9 @@ public class PreferencePane extends BasicPane { gcEnableCheckBox.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { - gcButton.setEnabled(gcEnableCheckBox.isSelected()); + gcButton.setEnabled(gcEnableCheckBox.isSelected() && gcEnableCheckBox.isEnabled()); } }); - //集群下禁用 - if (ClusterBridge.isClusterMode()) { - gcEnableCheckBox.setEnabled(false); - gcButton.setEnabled(false); - } return gcControlPane; } @@ -672,6 +668,11 @@ public class PreferencePane extends BasicPane { defaultStringToFormulaBox.setSelected(false); } VcsConfigManager vcsConfigManager = designerEnvManager.getVcsConfigManager(); + if (FineClusterConfig.getInstance().isCluster()) { + vcsEnableCheckBox.setEnabled(false); + gcEnableCheckBox.setEnabled(false); + } + if (VcsHelper.getInstance().needInit()) { vcsEnableCheckBox.setSelected(vcsConfigManager.isVcsEnable()); } else { From e6a9b4298e0b512a56b813489e181a4e34056376 Mon Sep 17 00:00:00 2001 From: kerry Date: Thu, 24 Oct 2019 10:01:13 +0800 Subject: [PATCH 56/95] =?UTF-8?q?REPORT-23181=20&&=20REPORT-23179=20window?= =?UTF-8?q?s=E4=B8=8B=E4=BF=9D=E5=AD=98=E5=A4=B1=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer-base/src/main/java/com/fr/file/FILEChooserPane.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/file/FILEChooserPane.java b/designer-base/src/main/java/com/fr/file/FILEChooserPane.java index b938845380..08c16fd178 100644 --- a/designer-base/src/main/java/com/fr/file/FILEChooserPane.java +++ b/designer-base/src/main/java/com/fr/file/FILEChooserPane.java @@ -480,7 +480,9 @@ public class FILEChooserPane extends BasicPane { Object ss = postfixComboBox.getSelectedItem(); if (ss instanceof ChooseFileFilter) { setFILEFilter((ChooseFileFilter) ss); - fileNameTextField.setText(calProperFileName(fileNameTextField.getText(), (ChooseFileFilter) ss)); + if (fileNameTextField.isShowing()) { + fileNameTextField.setText(calProperFileName(fileNameTextField.getText(), (ChooseFileFilter) ss)); + } } else { setFILEFilter(null); } From 091d310f3fa7609c38619d5f7a464703b62957a1 Mon Sep 17 00:00:00 2001 From: Bryant Date: Thu, 24 Oct 2019 16:04:20 +0800 Subject: [PATCH 57/95] =?UTF-8?q?REPORT-23155=20=E8=A7=A3=E5=86=B3?= =?UTF-8?q?=E4=BB=8E=E6=96=B0=E7=89=88=E6=9C=AC=E9=80=80=E5=9B=9E=E5=88=B0?= =?UTF-8?q?=E8=80=81=E7=89=88=E6=9C=AC=E7=9A=84=E8=BF=98=E5=8E=9F=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../update/ui/dialog/RestoreResultDialog.java | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/update/ui/dialog/RestoreResultDialog.java b/designer-base/src/main/java/com/fr/design/update/ui/dialog/RestoreResultDialog.java index d69d595e21..40516e2082 100644 --- a/designer-base/src/main/java/com/fr/design/update/ui/dialog/RestoreResultDialog.java +++ b/designer-base/src/main/java/com/fr/design/update/ui/dialog/RestoreResultDialog.java @@ -161,13 +161,13 @@ public class RestoreResultDialog extends JDialog { List list = new ArrayList<>(); String installHome = StableUtils.getInstallHome(); - putJarBackupFilesToInstallLib(installHome, map, list); - putJarBackupFilesToInstallEnv(list); + filesToMove(installHome, map); + filesToDelete(installHome, list); RestartHelper.saveFilesWhichToMove(map); RestartHelper.saveFilesWhichToDelete(list.toArray(new String[list.size()])); } - private void putJarBackupFilesToInstallLib(String installHome, Map map, List list) { + private void filesToMove(String installHome, Map map) { String backupDir = UpdateConstants.DESIGNER_BACKUP_DIR; String envHome = WorkContext.getCurrent().getPath(); File installLib = new File(StableUtils.pathJoin(installHome, backupDir, jarRestoreDir, UpdateConstants.DESIGNERBACKUPPATH)); @@ -203,18 +203,9 @@ public class RestoreResultDialog extends JDialog { } } } - installLib = new File(StableUtils.pathJoin(installHome,ProjectConstants.LIB_NAME)); - files = installLib.listFiles(); - if (files != null) { - for (File file : files) { - if (file.getName().startsWith(UpdateConstants.FINE) || file.getName().equals(UpdateConstants.ASPECTJRT)) { - list.add(StableUtils.pathJoin(installHome, ProjectConstants.LIB_NAME, file.getName())); - } - } - } } - private void putJarBackupFilesToInstallEnv(List list) { + private void filesToDelete(String installHome, List list) { String envHome = WorkContext.getCurrent().getPath(); File installEnv = new File(StableUtils.pathJoin(envHome,ProjectConstants.LIB_NAME)); File[] files = installEnv.listFiles(); @@ -225,5 +216,14 @@ public class RestoreResultDialog extends JDialog { } } } + installEnv = new File(StableUtils.pathJoin(installHome,ProjectConstants.LIB_NAME)); + files = installEnv.listFiles(); + if (files != null) { + for (File file : files) { + if (file.getName().startsWith(UpdateConstants.FINE) || file.getName().equals(UpdateConstants.ASPECTJRT)) { + list.add(StableUtils.pathJoin(installHome, ProjectConstants.LIB_NAME, file.getName())); + } + } + } } } \ No newline at end of file From 6058f32aeea5c0b7a16298b358e077e2dbb13471 Mon Sep 17 00:00:00 2001 From: kerry Date: Fri, 25 Oct 2019 13:57:24 +0800 Subject: [PATCH 58/95] =?UTF-8?q?REPORT-22998=20=E6=96=B0=E5=BB=BA?= =?UTF-8?q?=E4=B8=80=E5=BC=A0cpt=EF=BC=8C=E7=BC=96=E8=BE=91-=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=EF=BC=8C=E6=97=A0=E6=B3=95=E8=A7=A6=E5=8F=91=E7=BC=96?= =?UTF-8?q?=E8=AF=91=E6=8C=89=E9=92=AE=EF=BC=88=E5=8F=AA=E6=9C=89=E9=87=8D?= =?UTF-8?q?=E6=96=B0=E6=89=93=E5=BC=80=E6=89=8D=E8=A1=8C=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/JTemplate.java | 1 + 1 file changed, 1 insertion(+) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java index 2b06fb2e93..31944deb03 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java @@ -661,6 +661,7 @@ public abstract class JTemplate> result = result || this.saveFile(); //更换最近打开 DesignerEnvManager.getEnvManager().replaceRecentOpenedFilePath(oldName, this.getPath()); + this.refreshToolArea(); } return result; } From 736a90379ec0a6cfe3ac34e611fe43f1ef4fa70a Mon Sep 17 00:00:00 2001 From: "yaoh.wu" Date: Fri, 25 Oct 2019 14:38:21 +0800 Subject: [PATCH 59/95] =?UTF-8?q?REPORT-23267=20=E8=BF=9C=E7=A8=8B?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E6=B5=8B=E8=AF=95=E8=BF=9E=E6=8E=A5=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E6=B2=A1=E6=9C=89=E6=8F=90=E9=86=92=EF=BC=8C=E5=8F=8A?= =?UTF-8?q?=E9=A1=BA=E5=B8=A6=E5=A4=84=E7=90=86=E7=9A=84sonar=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/env/RemoteEnvPane.java | 78 +++++++++---------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java b/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java index 5045766dfb..20f698a3fa 100644 --- a/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java +++ b/designer-base/src/main/java/com/fr/env/RemoteEnvPane.java @@ -52,15 +52,16 @@ import java.awt.event.MouseEvent; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.io.File; -import java.util.concurrent.ExecutionException; import static com.fr.design.layout.TableLayout.FILL; import static com.fr.design.layout.TableLayout.PREFERRED; +import static com.fr.env.TestConnectionResult.AUTH_FAILED; import static com.fr.third.guava.base.Optional.fromNullable; /** * @author yaohwu */ +@SuppressWarnings("squid:MaximumInheritanceDepth") public class RemoteEnvPane extends BasicBeanPane { private static final Color TIPS_FONT_COLOR = new Color(0x8f8f92); @@ -118,6 +119,7 @@ public class RemoteEnvPane extends BasicBeanPane { /** * 主机位置 */ + @SuppressWarnings("squid:S1948") private RemoteWorkspaceURL remoteWorkspaceURL = new RemoteWorkspaceURL(""); /** * https 配置面板 @@ -138,6 +140,7 @@ public class RemoteEnvPane extends BasicBeanPane { /** * 主机名,web应用,Servlet,端口监听器 */ + @SuppressWarnings("squid:S1948") private DocumentListener individualDocListener = new DocumentListener() { @Override @@ -148,19 +151,32 @@ public class RemoteEnvPane extends BasicBeanPane { @Override public void insertUpdate(DocumentEvent e) { - updateRemoteURL(); - fillRemoteEnvURLField(); + changedUpdate(e); } @Override public void removeUpdate(DocumentEvent e) { - updateRemoteURL(); - fillRemoteEnvURLField(); + changedUpdate(e); + } + + private void updateRemoteURL() { + boolean isHttps = httpsCheckbox.isSelected(); + String host = hostNameInput.getText(); + String port = portInput.getText(); + String web = webAppNameInput.getText(); + String servlet = servletNameInput.getText(); + remoteWorkspaceURL.setHttps(isHttps); + remoteWorkspaceURL.setHost(host); + remoteWorkspaceURL.setPort(port); + remoteWorkspaceURL.setWeb(web); + remoteWorkspaceURL.setServlet(servlet); + remoteWorkspaceURL.resetUrl(); } }; /** * 路径输入框监听器 */ + @SuppressWarnings("squid:S1948") private DocumentListener overallDocListener = new DocumentListener() { @Override public void insertUpdate(DocumentEvent e) { @@ -169,7 +185,6 @@ public class RemoteEnvPane extends BasicBeanPane { @Override public void removeUpdate(DocumentEvent e) { - actionURLInputChange(); } @@ -177,10 +192,22 @@ public class RemoteEnvPane extends BasicBeanPane { public void changedUpdate(DocumentEvent e) { actionURLInputChange(); } + + private void actionURLInputChange() { + remoteWorkspaceURL = new RemoteWorkspaceURL(remoteEnvURLInput.getText()); + fillIndividualField(); + + httpsCheckbox.setSelected(remoteWorkspaceURL.getHttps()); + boolean isHttps = httpsCheckbox.isSelected(); + DesignerEnvManager.getEnvManager().setHttps(isHttps); + fileChooserButton.setEnabled(isHttps); + updateHttpsConfigPanel(); + } }; /** * https checkbox listener */ + @SuppressWarnings("squid:S1948") private ActionListener httpsCheckboxListener = new ActionListener() { @Override @@ -523,17 +550,17 @@ public class RemoteEnvPane extends BasicBeanPane { final RemoteDesignerWorkspaceInfo remoteEnv = updateBean(); final WorkspaceConnectionInfo connection = remoteEnv.getConnection(); - final SwingWorker worker = new SwingWorker() { + final SwingWorker worker = new SwingWorker() { @Override - protected Boolean doInBackground() throws Exception { + protected TestConnectionResult doInBackground() throws Exception { DesignerEnvManager.getEnvManager().setCertificatePath(connection.getCertPath()); DesignerEnvManager.getEnvManager().setCertificatePass(connection.getCertSecretKey()); try { - return WorkContext.getConnector().testConnection(connection); + return TestConnectionResult.parse(WorkContext.getConnector().testConnection(connection), connection); } catch (WorkspaceAuthException ignored) { - return null; + return AUTH_FAILED; } } @@ -541,14 +568,13 @@ public class RemoteEnvPane extends BasicBeanPane { protected void done() { okButton.setEnabled(true); try { - TestConnectionResult result = TestConnectionResult.parse(get(), connection); + TestConnectionResult result = get(); message.setText(result.getText()); uiLabel.setIcon(result.getIcon()); - } catch (InterruptedException | ExecutionException e) { + } catch (Exception e) { FineLoggerFactory.getLogger().error(e, e.getMessage()); message.setText(Toolkit.i18nText("Fine-Design_Basic_Remote_Connect_Failed")); uiLabel.setIcon(UIManager.getIcon("OptionPane.errorIcon")); - Thread.currentThread().interrupt(); } dialogDownPane.remove(cancelButton); dialogDownPane.revalidate(); @@ -633,36 +659,10 @@ public class RemoteEnvPane extends BasicBeanPane { enableSubDocListener(); } - private void updateRemoteURL() { - boolean isHttps = httpsCheckbox.isSelected(); - String host = hostNameInput.getText(); - String port = portInput.getText(); - String web = webAppNameInput.getText(); - String servlet = servletNameInput.getText(); - remoteWorkspaceURL.setHttps(isHttps); - remoteWorkspaceURL.setHost(host); - remoteWorkspaceURL.setPort(port); - remoteWorkspaceURL.setWeb(web); - remoteWorkspaceURL.setServlet(servlet); - remoteWorkspaceURL.resetUrl(); - } - - private void updateHttpsConfigPanel() { httpsConfigPanel.removeAll(); packHttpsConfigPanel(); httpsConfigPanel.revalidate(); httpsConfigPanel.repaint(); } - - private void actionURLInputChange() { - remoteWorkspaceURL = new RemoteWorkspaceURL(remoteEnvURLInput.getText()); - fillIndividualField(); - - httpsCheckbox.setSelected(remoteWorkspaceURL.getHttps()); - boolean isHttps = httpsCheckbox.isSelected(); - DesignerEnvManager.getEnvManager().setHttps(isHttps); - fileChooserButton.setEnabled(isHttps); - updateHttpsConfigPanel(); - } } From 51d57103fe25bb97fb448518bd4e7d9c21c494b9 Mon Sep 17 00:00:00 2001 From: kerry Date: Fri, 25 Oct 2019 16:35:03 +0800 Subject: [PATCH 60/95] =?UTF-8?q?REPORT-23022=20=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E4=B8=8B=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fun/ReportSupportedFileUIProvider.java | 8 ------ ...AbstractReportSupportedFileUIProvider.java | 7 ----- .../gui/itree/filetree/FileNodeConstants.java | 8 +++--- .../java/com/fr/file/FILEChooserPane.java | 6 ++-- .../itree/filetree/FileNodeConstantsTest.java | 28 +++++++++---------- 5 files changed, 22 insertions(+), 35 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/fun/ReportSupportedFileUIProvider.java b/designer-base/src/main/java/com/fr/design/fun/ReportSupportedFileUIProvider.java index 2ccfd9363e..4f4ea45c3c 100644 --- a/designer-base/src/main/java/com/fr/design/fun/ReportSupportedFileUIProvider.java +++ b/designer-base/src/main/java/com/fr/design/fun/ReportSupportedFileUIProvider.java @@ -1,6 +1,5 @@ package com.fr.design.fun; -import com.fr.base.extension.FileExtension; import com.fr.design.mainframe.JTemplate; import com.fr.file.FILEChooserPane; import com.fr.stable.fun.mark.Mutable; @@ -24,13 +23,6 @@ public interface ReportSupportedFileUIProvider extends Mutable { void addChooseFileFilter(FILEChooserPane fileChooser, String suffix); - /** - * 获取可支持的文件类型 - * @return 文件扩展 - */ - FileExtension[] getFileExtensions(); - - /** * 获取文件关联的icon * @param path 文件路径 diff --git a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractReportSupportedFileUIProvider.java b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractReportSupportedFileUIProvider.java index 3e8046e6f7..e8d1dfcc19 100644 --- a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractReportSupportedFileUIProvider.java +++ b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractReportSupportedFileUIProvider.java @@ -1,6 +1,5 @@ package com.fr.design.fun.impl; -import com.fr.base.extension.FileExtension; import com.fr.design.fun.ReportSupportedFileUIProvider; import com.fr.design.mainframe.JTemplate; import com.fr.file.FILEChooserPane; @@ -19,12 +18,6 @@ public abstract class AbstractReportSupportedFileUIProvider extends AbstractProv } - @Override - public FileExtension[] getFileExtensions() { - return new FileExtension[0]; - } - - @Override public Icon getFileIcon(String path, boolean isShowLock) { return null; diff --git a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileNodeConstants.java b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileNodeConstants.java index 617051dc63..f5da5302c4 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileNodeConstants.java +++ b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileNodeConstants.java @@ -2,14 +2,14 @@ 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.fun.ReportSupportedFileUIProvider; import com.fr.general.GeneralContext; import com.fr.plugin.context.PluginContext; import com.fr.plugin.injectable.PluginModule; import com.fr.plugin.manage.PluginFilter; import com.fr.plugin.observer.PluginEvent; import com.fr.plugin.observer.PluginEventListener; +import com.fr.report.ExtraReportClassManager; +import com.fr.report.fun.ReportSupportedFileProvider; import java.util.ArrayList; import java.util.Arrays; @@ -58,8 +58,8 @@ public class FileNodeConstants { rwl.writeLock().lock(); supportFileType = new ArrayList(); //通过插件扩展的 - Set providers = ExtraDesignClassManager.getInstance().getArray(ReportSupportedFileUIProvider.XML_TAG); - for (ReportSupportedFileUIProvider provider : providers) { + Set providers = ExtraReportClassManager.getInstance().getArray(ReportSupportedFileProvider.XML_TAG); + for (ReportSupportedFileProvider provider : providers) { addAppExtensions(provider.getFileExtensions()); } supportFileType.addAll(Arrays.asList(FRContext.getFileNodes().getSupportedTypes())); diff --git a/designer-base/src/main/java/com/fr/file/FILEChooserPane.java b/designer-base/src/main/java/com/fr/file/FILEChooserPane.java index 08c16fd178..52e63c9bfa 100644 --- a/designer-base/src/main/java/com/fr/file/FILEChooserPane.java +++ b/designer-base/src/main/java/com/fr/file/FILEChooserPane.java @@ -33,6 +33,8 @@ import com.fr.file.filter.FILEFilter; import com.fr.general.ComparatorUtils; import com.fr.general.GeneralContext; import com.fr.log.FineLoggerFactory; +import com.fr.report.ExtraReportClassManager; +import com.fr.report.fun.ReportSupportedFileProvider; import com.fr.stable.CoreConstants; import com.fr.stable.ProductConstants; import com.fr.stable.StableUtils; @@ -742,8 +744,8 @@ public class FILEChooserPane extends BasicPane { if (type == JFileChooser.OPEN_DIALOG) { ChooseFileFilter supportedTypes = new ChooseFileFilter(FRContext.getFileNodes().getSupportedTypes(), appName + Toolkit.i18nText("Fine-Design_Report_Template_File")); - Set providers = ExtraDesignClassManager.getInstance().getArray(ReportSupportedFileUIProvider.XML_TAG); - for (ReportSupportedFileUIProvider provider : providers) { + Set providers = ExtraReportClassManager.getInstance().getArray(ReportSupportedFileProvider.XML_TAG); + for (ReportSupportedFileProvider provider : providers) { for (FileExtension fileExtension : provider.getFileExtensions()){ supportedTypes.addExtension(fileExtension.getExtension()); } diff --git a/designer-base/src/test/java/com/fr/design/gui/itree/filetree/FileNodeConstantsTest.java b/designer-base/src/test/java/com/fr/design/gui/itree/filetree/FileNodeConstantsTest.java index e62091048f..3358ac8be9 100644 --- a/designer-base/src/test/java/com/fr/design/gui/itree/filetree/FileNodeConstantsTest.java +++ b/designer-base/src/test/java/com/fr/design/gui/itree/filetree/FileNodeConstantsTest.java @@ -1,9 +1,9 @@ package com.fr.design.gui.itree.filetree; import com.fr.base.extension.FileExtension; -import com.fr.design.ExtraDesignClassManager; -import com.fr.design.fun.ReportSupportedFileUIProvider; -import com.fr.design.fun.impl.AbstractReportSupportedFileUIProvider; +import com.fr.report.ExtraReportClassManager; +import com.fr.report.fun.ReportSupportedFileProvider; +import com.fr.report.fun.impl.AbstractReportSupportedFileProvider; import com.fr.stable.fun.mark.Mutable; import org.easymock.EasyMock; import org.junit.Assert; @@ -19,38 +19,38 @@ import java.util.Set; * Created by alex sung on 2019/7/25. */ @RunWith(PowerMockRunner.class) -@PrepareForTest(ExtraDesignClassManager.class) +@PrepareForTest(ExtraReportClassManager.class) public class FileNodeConstantsTest { @Test public void supportFileTypesTest() { - ExtraDesignClassManager extra = mockExtraDesignClassManager(); - Assert.assertEquals(1, extra.getArray(ReportSupportedFileUIProvider.XML_TAG).size()); - ReportSupportedFileUIProvider option = (ReportSupportedFileUIProvider) extra.getArray(ReportSupportedFileUIProvider.XML_TAG).iterator().next(); + ExtraReportClassManager extra = mockExtraReportClassManager(); + Assert.assertEquals(1, extra.getArray(ReportSupportedFileProvider.XML_TAG).size()); + ReportSupportedFileProvider option = (ReportSupportedFileProvider) extra.getArray(ReportSupportedFileProvider.XML_TAG).iterator().next(); Assert.assertEquals(FileExtension.CPTX, option.getFileExtensions()[0]); } @Test public void testSupportFileTypesOrder() { - ExtraDesignClassManager extra = mockExtraDesignClassManager(); - PowerMock.mockStatic(ExtraDesignClassManager.class); - EasyMock.expect(ExtraDesignClassManager.getInstance()).andReturn(extra).once(); + ExtraReportClassManager extra = mockExtraReportClassManager(); + PowerMock.mockStatic(ExtraReportClassManager.class); + EasyMock.expect(ExtraReportClassManager.getInstance()).andReturn(extra).once(); PowerMock.replayAll(); String[] fileTypes = FileNodeConstants.getSupportFileTypes(); Assert.assertEquals("cptx", fileTypes[0]); Assert.assertEquals("cpt", fileTypes[1]); } - private ExtraDesignClassManager mockExtraDesignClassManager() { - ExtraDesignClassManager extra = EasyMock.mock(ExtraDesignClassManager.class); + private ExtraReportClassManager mockExtraReportClassManager() { + ExtraReportClassManager extra = EasyMock.mock(ExtraReportClassManager.class); Set options = new HashSet() {{ add(new MockNewTemplateFileOption()); }}; - EasyMock.expect(extra.getArray(ReportSupportedFileUIProvider.XML_TAG)).andReturn(options).anyTimes(); + EasyMock.expect(extra.getArray(ReportSupportedFileProvider.XML_TAG)).andReturn(options).anyTimes(); EasyMock.replay(extra); return extra; } - private class MockNewTemplateFileOption extends AbstractReportSupportedFileUIProvider { + private class MockNewTemplateFileOption extends AbstractReportSupportedFileProvider { @Override public FileExtension[] getFileExtensions() { From cadaf3f8f3d751b326bf2b0a8e8cb00432ab1fc2 Mon Sep 17 00:00:00 2001 From: "alex.sung" Date: Fri, 25 Oct 2019 17:58:04 +0800 Subject: [PATCH 61/95] =?UTF-8?q?=E6=97=A0jira=E4=BB=BB=E5=8A=A1=EF=BC=8C?= =?UTF-8?q?=E4=B9=8B=E5=89=8D=E4=BB=A3=E7=A0=81=E5=90=88=E6=B2=A1=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/mainframe/InformationCollector.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/InformationCollector.java b/designer-realize/src/main/java/com/fr/design/mainframe/InformationCollector.java index 52440d9e3d..62d1d4a3ea 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/InformationCollector.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/InformationCollector.java @@ -9,6 +9,7 @@ import com.fr.config.MarketConfig; import com.fr.design.DesignerEnvManager; import com.fr.design.mainframe.errorinfo.ErrorInfoUploader; import com.fr.design.mainframe.messagecollect.impl.FocusPointMessageUploader; +import com.fr.design.mainframe.messagecollect.solid.SolidCollector; import com.fr.design.mainframe.template.info.TemplateInfoCollector; import com.fr.general.CloudCenter; import com.fr.general.ComparatorUtils; @@ -230,6 +231,7 @@ public class InformationCollector implements XMLReadable, XMLWriter { service.schedule(new Runnable() { @Override public void run() { + SolidCollector.getInstance().sendToCloudCenterAndDeleteFile(); sendUserInfo(); FocusPointMessageUploader.getInstance().sendToCloudCenter(); TemplateInfoCollector.getInstance().sendTemplateInfo(); From bff39359e1f614a29cadd0d0dd2ae72c1986d4bb Mon Sep 17 00:00:00 2001 From: "alex.sung" Date: Sun, 27 Oct 2019 21:57:22 +0800 Subject: [PATCH 62/95] =?UTF-8?q?=E6=8F=92=E4=BB=B6error=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E5=9F=8B=E7=82=B9=E7=9A=84json=E7=9B=B4=E6=8E=A5save?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/mainframe/errorinfo/ErrorInfo.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/errorinfo/ErrorInfo.java b/designer-realize/src/main/java/com/fr/design/mainframe/errorinfo/ErrorInfo.java index 4e733c7b1d..9bfd729dd4 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/errorinfo/ErrorInfo.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/errorinfo/ErrorInfo.java @@ -37,6 +37,9 @@ public class ErrorInfo { this.uploadtime = dateToString(); } + public ErrorInfo() { + } + public String getUsername() { return username; } @@ -123,7 +126,7 @@ public class ErrorInfo { saveFileToCache(jo); } - private void saveFileToCache(JSONObject jo) { + public void saveFileToCache(JSONObject jo) { String content = jo.toString(); String fileName = UUID.randomUUID() + ErrorInfoUploader.SUFFIX; File file = new File(StableUtils.pathJoin(ProductConstants.getEnvHome(), ErrorInfoUploader.FOLDER_NAME, fileName)); From 8853b10f8e7d0381b8ecc7d4fe8b5a6b3b980783 Mon Sep 17 00:00:00 2001 From: kerry Date: Mon, 28 Oct 2019 15:39:08 +0800 Subject: [PATCH 63/95] =?UTF-8?q?REPORT-23241=20tab=E5=9D=97=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E5=88=87=E6=8D=A2=E6=97=B6=EF=BC=8C=E9=A2=84=E8=A7=88?= =?UTF-8?q?=E4=B8=8D=E4=B8=80=E5=AE=9A=E5=8F=91=E9=80=81=E6=94=B9=E5=8F=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/widget/accessibles/MobileTemplateStylePane.java | 2 +- .../design/mainframe/widget/accessibles/TemplateStylePane.java | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/MobileTemplateStylePane.java b/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/MobileTemplateStylePane.java index 73a8935dca..76434545ed 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/MobileTemplateStylePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/MobileTemplateStylePane.java @@ -66,7 +66,7 @@ public class MobileTemplateStylePane extends AbstractTemplateStylePane centerPane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview"), null)); centerPane.add(previewPane); styleList.addMouseListener(new MouseAdapter() { - public void mouseClicked(MouseEvent e) { + public void mouseReleased(MouseEvent e) { previewPane.repaint((TemplateStyle) styleList.getSelectedValue()); } }); From 763a7276814a1ef982d420b41c17345d7ad3b542 Mon Sep 17 00:00:00 2001 From: "Wim.Zhai" Date: Tue, 29 Oct 2019 19:29:07 +0800 Subject: [PATCH 64/95] =?UTF-8?q?CHART-10921=20=E5=85=BC=E5=AE=B9=E6=89=A9?= =?UTF-8?q?=E5=B1=95=E5=9B=BE=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/chart/ChartCommonWizardPane.java | 2 +- .../main/java/com/fr/design/chart/ChartTypePane.java | 2 +- .../com/fr/design/chartx/AbstractChartDataPane.java | 4 ++-- .../com/fr/design/chartx/impl/AbstractDataPane.java | 4 ++-- .../com/fr/design/chartx/impl/AbstractOtherPane.java | 4 ++-- .../fr/design/mainframe/MiddleChartPropertyPane.java | 2 +- .../com/fr/design/mainframe/chart/ChartEditPane.java | 4 ++-- .../mainframe/chart/gui/ChartTypeButtonPane.java | 12 ++++++------ .../fr/design/mainframe/chart/gui/ChartTypePane.java | 8 ++++---- 9 files changed, 21 insertions(+), 21 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/chart/ChartCommonWizardPane.java b/designer-chart/src/main/java/com/fr/design/chart/ChartCommonWizardPane.java index e4de3686ef..a1f8ed6943 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/ChartCommonWizardPane.java +++ b/designer-chart/src/main/java/com/fr/design/chart/ChartCommonWizardPane.java @@ -12,7 +12,7 @@ public abstract class ChartCommonWizardPane extends ChartWizardPane { return; } - populate(cc.getSelectedChart(ChartProvider.class)); + populate(cc.getTheSelectedChart(ChartProvider.class)); } public abstract void populate(ChartProvider chart); diff --git a/designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java b/designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java index 3cc9ba6a72..a55e1aa487 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java +++ b/designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java @@ -123,7 +123,7 @@ public class ChartTypePane extends ChartCommonWizardPane { return; } - ChartProvider chart4Update = cc.getSelectedChart(ChartProvider.class); + ChartProvider chart4Update = cc.getTheSelectedChart(ChartProvider.class); if (chart4Update == null) { String plotID = this.chartIDs[mainTypeList.getSelectedIndex()]; ChartProvider chart = ChartTypeManager.getInstance().getCharts(plotID)[iconViewList.getSelectedIndex()]; diff --git a/designer-chart/src/main/java/com/fr/design/chartx/AbstractChartDataPane.java b/designer-chart/src/main/java/com/fr/design/chartx/AbstractChartDataPane.java index 61359d91b7..86ee76b451 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/AbstractChartDataPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/AbstractChartDataPane.java @@ -26,7 +26,7 @@ public abstract class AbstractChartDataPane extends if (collection == null) { return; } - AbstractChartWithData chart = collection.getSelectedChart(AbstractChartWithData.class); + AbstractChartWithData chart = collection.getTheSelectedChart(AbstractChartWithData.class); if (chart == null) { return; } @@ -32,7 +32,7 @@ public abstract class AbstractOtherPane extends if (collection == null) { return; } - AbstractChartWithData chart = collection.getSelectedChart(AbstractChartWithData.class); + AbstractChartWithData chart = collection.getTheSelectedChart(AbstractChartWithData.class); if (chart == null) { return; } diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/MiddleChartPropertyPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/MiddleChartPropertyPane.java index 7d77a0ac60..fc5e1135d6 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/MiddleChartPropertyPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/MiddleChartPropertyPane.java @@ -93,7 +93,7 @@ public abstract class MiddleChartPropertyPane extends BaseChartPropertyPane{ * @param ePane 面板 */ public void populateChartPropertyPane(ChartCollection collection, TargetComponent ePane) { - addChartEditPane(collection.getSelectedChart(ChartProvider.class).getID()); + addChartEditPane(collection.getTheSelectedChart(ChartProvider.class).getID()); setSupportCellData(true); this.container.setEPane(ePane); chartEditPane.populate(collection); diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartEditPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartEditPane.java index 6bd6383212..c1a51e0296 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartEditPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartEditPane.java @@ -111,7 +111,7 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4 if (!ComparatorUtils.equals(collection, lastCollection)) { - VanChart vanChart = collection.getSelectedChart(VanChart.class); + VanChart vanChart = collection.getTheSelectedChart(VanChart.class); if (vanChart != null) { //此处画图 vanChart.demoImgEvent(true); @@ -230,7 +230,7 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4 return; } - ChartProvider chartProvider = collection.getSelectedChart(ChartProvider.class); + ChartProvider chartProvider = collection.getTheSelectedChart(ChartProvider.class); if (checkNeedsReLayout(chartProvider)) { String chartID = chartProvider.getID(); if ("WaferChipChart".equals(chartID) || "BoxPlotChart".equals(chartID)) { diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java index 7d64588c50..226929ed57 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java @@ -176,7 +176,7 @@ public class ChartTypeButtonPane extends BasicBeanPane implemen * @return */ public ChartProvider getChangeStateNewChart() { - ChartProvider chart = editingCollection.getSelectedChart(ChartProvider.class); + ChartProvider chart = editingCollection.getTheSelectedChart(ChartProvider.class); String chartID = chart.getID(); String priority = ChartTypeManager.getInstanceWithCheck().getPriority(chartID); return ChartTypeManager.getInstanceWithCheck().getFirstChart(priority); @@ -199,7 +199,7 @@ public class ChartTypeButtonPane extends BasicBeanPane implemen } private boolean supportChange() { - return supportChangeConfigChartClassSet.contains(editingCollection.getSelectedChart(ChartProvider.class).getClass()); + return supportChangeConfigChartClassSet.contains(editingCollection.getTheSelectedChart(ChartProvider.class).getClass()); } ActionListener configListener = new ActionListener() { @@ -354,9 +354,9 @@ public class ChartTypeButtonPane extends BasicBeanPane implemen } private void checkConfigButtonVisible() { - addButton.setVisible(ChartTypeManager.enabledChart(editingCollection.getSelectedChart(ChartProvider.class).getID())); + addButton.setVisible(ChartTypeManager.enabledChart(editingCollection.getTheSelectedChart(ChartProvider.class).getID())); //新建一个collection - if (editingCollection.getChartCount() == 1 && editingCollection.getSelectedChart(ChartProvider.class) != null) { + if (editingCollection.getChartCount() == 1 && editingCollection.getTheSelectedChart(ChartProvider.class) != null) { //Chart 不支持图表切换 configButton.setVisible(supportChange()); } @@ -484,7 +484,7 @@ public class ChartTypeButtonPane extends BasicBeanPane implemen private void deleteAButton() { //先重构属性,在重构面板,否则面板在重构过程中,会重新将属性中的切换图表加到indexList中,导致面板无法删除 //记录改变前的plotID - String lastPlotID = editingCollection == null ? StringUtils.EMPTY : editingCollection.getSelectedChart(ChartProvider.class).getID(); + String lastPlotID = editingCollection == null ? StringUtils.EMPTY : editingCollection.getTheSelectedChart(ChartProvider.class).getID(); if (editingCollection != null) { int count = editingCollection.getChartCount(); for (int i = 0; i < count; i++) { @@ -564,7 +564,7 @@ public class ChartTypeButtonPane extends BasicBeanPane implemen if (isEnabled()) { noSelected(); //记录改变前的plotID - String lastPlotID = editingCollection == null ? StringUtils.EMPTY : editingCollection.getSelectedChart(ChartProvider.class).getID(); + String lastPlotID = editingCollection == null ? StringUtils.EMPTY : editingCollection.getTheSelectedChart(ChartProvider.class).getID(); changeCollectionSelected(getButtonName()); setSelectedWithFireListener(true); fireSelectedChanged(); diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java index 26f0a38e9c..d60db4dfaf 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java @@ -208,7 +208,7 @@ public class ChartTypePane extends AbstractChartAttrPane{ //处理办法:这边除了重构 下拉项选项和cardNames 还需要把cards重构下(不需要init pane,只需要我需要的拿出来就好了) private void relayout(ChartCollection collection){ //重构需要重构下拉框选项和cardNames - ChartProvider chart = collection.getSelectedChart(ChartProvider.class); + ChartProvider chart = collection.getTheSelectedChart(ChartProvider.class); String chartID = chart.getID(); String priority = ChartTypeManager.getInstanceWithCheck().getPriority(chartID); boolean enabledChart = ChartTypeManager.enabledChart(chartID); @@ -294,7 +294,7 @@ public class ChartTypePane extends AbstractChartAttrPane{ * @param collection */ public void reLayoutEditPane(String lastPlotID, ChartCollection collection){ - ChartProvider chart = collection.getSelectedChart(ChartProvider.class); + ChartProvider chart = collection.getTheSelectedChart(ChartProvider.class); String plotID = chart.getID(); boolean isUseDefault = ChartTypeInterfaceManager.getInstance().isUseDefaultPane(plotID); if (editPane != null && editPane.isDefaultPane() != isUseDefault || (!isUseDefault && !ComparatorUtils.equals(lastPlotID, plotID))){ @@ -315,7 +315,7 @@ public class ChartTypePane extends AbstractChartAttrPane{ public void populate(ChartCollection collection) { editingCollection = collection; - ChartProvider chart = collection.getSelectedChart(ChartProvider.class); + ChartProvider chart = collection.getTheSelectedChart(ChartProvider.class); this.remove(leftContentPane); initContentPane(); @@ -333,7 +333,7 @@ public class ChartTypePane extends AbstractChartAttrPane{ public void update(ChartCollection collection) { editingCollection = collection; buttonPane.update(collection);// 内部操作时 已经做过处理. - ChartProvider chart = collection.getSelectedChart(ChartProvider.class); + ChartProvider chart = collection.getTheSelectedChart(ChartProvider.class); chartTypeComBox.updateBean(chart); } From 903a6bc110590bc27a4e22a46df37574665afe11 Mon Sep 17 00:00:00 2001 From: "Wim.Zhai" Date: Wed, 30 Oct 2019 09:58:32 +0800 Subject: [PATCH 65/95] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B4=A8=E9=87=8F=20?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E5=91=BD=E5=90=8D=E6=9B=B4=E6=9C=89=E9=92=88?= =?UTF-8?q?=E5=AF=B9=E6=80=A7=E4=BA=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/chart/ChartCommonWizardPane.java | 2 +- .../main/java/com/fr/design/chart/ChartTypePane.java | 2 +- .../com/fr/design/chartx/AbstractChartDataPane.java | 4 ++-- .../com/fr/design/chartx/impl/AbstractDataPane.java | 4 ++-- .../com/fr/design/chartx/impl/AbstractOtherPane.java | 4 ++-- .../fr/design/mainframe/MiddleChartPropertyPane.java | 2 +- .../com/fr/design/mainframe/chart/ChartEditPane.java | 4 ++-- .../mainframe/chart/gui/ChartTypeButtonPane.java | 12 ++++++------ .../fr/design/mainframe/chart/gui/ChartTypePane.java | 8 ++++---- 9 files changed, 21 insertions(+), 21 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/chart/ChartCommonWizardPane.java b/designer-chart/src/main/java/com/fr/design/chart/ChartCommonWizardPane.java index a1f8ed6943..0e11e84132 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/ChartCommonWizardPane.java +++ b/designer-chart/src/main/java/com/fr/design/chart/ChartCommonWizardPane.java @@ -12,7 +12,7 @@ public abstract class ChartCommonWizardPane extends ChartWizardPane { return; } - populate(cc.getTheSelectedChart(ChartProvider.class)); + populate(cc.getSelectedChartProvider(ChartProvider.class)); } public abstract void populate(ChartProvider chart); diff --git a/designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java b/designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java index a55e1aa487..19c6137858 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java +++ b/designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java @@ -123,7 +123,7 @@ public class ChartTypePane extends ChartCommonWizardPane { return; } - ChartProvider chart4Update = cc.getTheSelectedChart(ChartProvider.class); + ChartProvider chart4Update = cc.getSelectedChartProvider(ChartProvider.class); if (chart4Update == null) { String plotID = this.chartIDs[mainTypeList.getSelectedIndex()]; ChartProvider chart = ChartTypeManager.getInstance().getCharts(plotID)[iconViewList.getSelectedIndex()]; diff --git a/designer-chart/src/main/java/com/fr/design/chartx/AbstractChartDataPane.java b/designer-chart/src/main/java/com/fr/design/chartx/AbstractChartDataPane.java index 86ee76b451..b8690f8df6 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/AbstractChartDataPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/AbstractChartDataPane.java @@ -26,7 +26,7 @@ public abstract class AbstractChartDataPane extends if (collection == null) { return; } - AbstractChartWithData chart = collection.getTheSelectedChart(AbstractChartWithData.class); + AbstractChartWithData chart = collection.getSelectedChartProvider(AbstractChartWithData.class); if (chart == null) { return; } @@ -32,7 +32,7 @@ public abstract class AbstractOtherPane extends if (collection == null) { return; } - AbstractChartWithData chart = collection.getTheSelectedChart(AbstractChartWithData.class); + AbstractChartWithData chart = collection.getSelectedChartProvider(AbstractChartWithData.class); if (chart == null) { return; } diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/MiddleChartPropertyPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/MiddleChartPropertyPane.java index fc5e1135d6..39832c3777 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/MiddleChartPropertyPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/MiddleChartPropertyPane.java @@ -93,7 +93,7 @@ public abstract class MiddleChartPropertyPane extends BaseChartPropertyPane{ * @param ePane 面板 */ public void populateChartPropertyPane(ChartCollection collection, TargetComponent ePane) { - addChartEditPane(collection.getTheSelectedChart(ChartProvider.class).getID()); + addChartEditPane(collection.getSelectedChartProvider(ChartProvider.class).getID()); setSupportCellData(true); this.container.setEPane(ePane); chartEditPane.populate(collection); diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartEditPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartEditPane.java index c1a51e0296..4ef5beffb1 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartEditPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/ChartEditPane.java @@ -111,7 +111,7 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4 if (!ComparatorUtils.equals(collection, lastCollection)) { - VanChart vanChart = collection.getTheSelectedChart(VanChart.class); + VanChart vanChart = collection.getSelectedChartProvider(VanChart.class); if (vanChart != null) { //此处画图 vanChart.demoImgEvent(true); @@ -230,7 +230,7 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4 return; } - ChartProvider chartProvider = collection.getTheSelectedChart(ChartProvider.class); + ChartProvider chartProvider = collection.getSelectedChartProvider(ChartProvider.class); if (checkNeedsReLayout(chartProvider)) { String chartID = chartProvider.getID(); if ("WaferChipChart".equals(chartID) || "BoxPlotChart".equals(chartID)) { diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java index 226929ed57..8877ed9dac 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java @@ -176,7 +176,7 @@ public class ChartTypeButtonPane extends BasicBeanPane implemen * @return */ public ChartProvider getChangeStateNewChart() { - ChartProvider chart = editingCollection.getTheSelectedChart(ChartProvider.class); + ChartProvider chart = editingCollection.getSelectedChartProvider(ChartProvider.class); String chartID = chart.getID(); String priority = ChartTypeManager.getInstanceWithCheck().getPriority(chartID); return ChartTypeManager.getInstanceWithCheck().getFirstChart(priority); @@ -199,7 +199,7 @@ public class ChartTypeButtonPane extends BasicBeanPane implemen } private boolean supportChange() { - return supportChangeConfigChartClassSet.contains(editingCollection.getTheSelectedChart(ChartProvider.class).getClass()); + return supportChangeConfigChartClassSet.contains(editingCollection.getSelectedChartProvider(ChartProvider.class).getClass()); } ActionListener configListener = new ActionListener() { @@ -354,9 +354,9 @@ public class ChartTypeButtonPane extends BasicBeanPane implemen } private void checkConfigButtonVisible() { - addButton.setVisible(ChartTypeManager.enabledChart(editingCollection.getTheSelectedChart(ChartProvider.class).getID())); + addButton.setVisible(ChartTypeManager.enabledChart(editingCollection.getSelectedChartProvider(ChartProvider.class).getID())); //新建一个collection - if (editingCollection.getChartCount() == 1 && editingCollection.getTheSelectedChart(ChartProvider.class) != null) { + if (editingCollection.getChartCount() == 1 && editingCollection.getSelectedChartProvider(ChartProvider.class) != null) { //Chart 不支持图表切换 configButton.setVisible(supportChange()); } @@ -484,7 +484,7 @@ public class ChartTypeButtonPane extends BasicBeanPane implemen private void deleteAButton() { //先重构属性,在重构面板,否则面板在重构过程中,会重新将属性中的切换图表加到indexList中,导致面板无法删除 //记录改变前的plotID - String lastPlotID = editingCollection == null ? StringUtils.EMPTY : editingCollection.getTheSelectedChart(ChartProvider.class).getID(); + String lastPlotID = editingCollection == null ? StringUtils.EMPTY : editingCollection.getSelectedChartProvider(ChartProvider.class).getID(); if (editingCollection != null) { int count = editingCollection.getChartCount(); for (int i = 0; i < count; i++) { @@ -564,7 +564,7 @@ public class ChartTypeButtonPane extends BasicBeanPane implemen if (isEnabled()) { noSelected(); //记录改变前的plotID - String lastPlotID = editingCollection == null ? StringUtils.EMPTY : editingCollection.getTheSelectedChart(ChartProvider.class).getID(); + String lastPlotID = editingCollection == null ? StringUtils.EMPTY : editingCollection.getSelectedChartProvider(ChartProvider.class).getID(); changeCollectionSelected(getButtonName()); setSelectedWithFireListener(true); fireSelectedChanged(); diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java index d60db4dfaf..3740e3e121 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java @@ -208,7 +208,7 @@ public class ChartTypePane extends AbstractChartAttrPane{ //处理办法:这边除了重构 下拉项选项和cardNames 还需要把cards重构下(不需要init pane,只需要我需要的拿出来就好了) private void relayout(ChartCollection collection){ //重构需要重构下拉框选项和cardNames - ChartProvider chart = collection.getTheSelectedChart(ChartProvider.class); + ChartProvider chart = collection.getSelectedChartProvider(ChartProvider.class); String chartID = chart.getID(); String priority = ChartTypeManager.getInstanceWithCheck().getPriority(chartID); boolean enabledChart = ChartTypeManager.enabledChart(chartID); @@ -294,7 +294,7 @@ public class ChartTypePane extends AbstractChartAttrPane{ * @param collection */ public void reLayoutEditPane(String lastPlotID, ChartCollection collection){ - ChartProvider chart = collection.getTheSelectedChart(ChartProvider.class); + ChartProvider chart = collection.getSelectedChartProvider(ChartProvider.class); String plotID = chart.getID(); boolean isUseDefault = ChartTypeInterfaceManager.getInstance().isUseDefaultPane(plotID); if (editPane != null && editPane.isDefaultPane() != isUseDefault || (!isUseDefault && !ComparatorUtils.equals(lastPlotID, plotID))){ @@ -315,7 +315,7 @@ public class ChartTypePane extends AbstractChartAttrPane{ public void populate(ChartCollection collection) { editingCollection = collection; - ChartProvider chart = collection.getTheSelectedChart(ChartProvider.class); + ChartProvider chart = collection.getSelectedChartProvider(ChartProvider.class); this.remove(leftContentPane); initContentPane(); @@ -333,7 +333,7 @@ public class ChartTypePane extends AbstractChartAttrPane{ public void update(ChartCollection collection) { editingCollection = collection; buttonPane.update(collection);// 内部操作时 已经做过处理. - ChartProvider chart = collection.getTheSelectedChart(ChartProvider.class); + ChartProvider chart = collection.getSelectedChartProvider(ChartProvider.class); chartTypeComBox.updateBean(chart); } From e75b8bc52edbecff70d5f249cc0aaa4090107e3f Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 30 Oct 2019 18:05:39 +0800 Subject: [PATCH 66/95] =?UTF-8?q?REPORT-22824=20mac=E4=B8=8B=20=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E8=BE=93=E5=85=A5=E5=BC=B9=E7=AA=97=20=E4=B8=8D?= =?UTF-8?q?=E5=9C=A8=E6=9C=80=E9=A1=B6=E5=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/data/DesignTableDataManager.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java b/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java index f1e911e7a8..0018d5333b 100644 --- a/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java +++ b/designer-base/src/main/java/com/fr/design/data/DesignTableDataManager.java @@ -38,6 +38,7 @@ import com.fr.stable.ParameterProvider; import com.fr.stable.StringUtils; import com.fr.stable.xml.XMLPrintWriter; +import javax.swing.JFrame; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import java.io.ByteArrayOutputStream; @@ -422,7 +423,7 @@ public abstract class DesignTableDataManager { final Map parameterMap = new HashMap<>(); if (needInputParams(isMustInputParameters, parameters)) { final ParameterInputPane pPane = new ParameterInputPane(parameters); - pPane.showSmallWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() { + pPane.showSmallWindow(new JFrame(), new DialogActionAdapter() { @Override public void doOk() { parameterMap.putAll(pPane.update()); From 8f4880cd6d0bd1d2339b948e22f24aba5105b51f Mon Sep 17 00:00:00 2001 From: Bryant Date: Wed, 30 Oct 2019 18:23:23 +0800 Subject: [PATCH 67/95] =?UTF-8?q?REPORT-23486=20=E4=BF=AE=E5=A4=8Dbug?= =?UTF-8?q?=E4=BB=A5=E5=8F=8A=E6=9B=B4=E6=94=B9=E6=96=87=E4=BB=B6=E5=A4=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../update/actions/RecoverForDesigner.java | 31 +++++++++++-------- .../update/ui/dialog/RestoreResultDialog.java | 2 +- .../update/ui/dialog/UpdateMainDialog.java | 14 ++++----- 3 files changed, 26 insertions(+), 21 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/update/actions/RecoverForDesigner.java b/designer-base/src/main/java/com/fr/design/update/actions/RecoverForDesigner.java index 75b5e3fadd..92493430f4 100644 --- a/designer-base/src/main/java/com/fr/design/update/actions/RecoverForDesigner.java +++ b/designer-base/src/main/java/com/fr/design/update/actions/RecoverForDesigner.java @@ -6,12 +6,10 @@ import com.fr.decision.update.exception.UpdateException; import com.fr.design.mainframe.DesignerContext; import com.fr.general.CommonIOUtils; import com.fr.general.GeneralUtils; -import com.fr.general.IOUtils; import com.fr.log.FineLoggerFactory; import com.fr.stable.CommonUtils; import com.fr.stable.StableUtils; import com.fr.stable.project.ProjectConstants; -import com.fr.workspace.WorkContext; import java.io.File; import java.io.IOException; @@ -23,10 +21,13 @@ import java.io.IOException; */ public class RecoverForDesigner implements Recover { + private final String installHome = StableUtils.getInstallHome(); + @Override public boolean recover() { try{ - CommonIOUtils.copyFilesInDirByPath(StableUtils.pathJoin(StableUtils.getInstallHome(), UpdateConstants.DESIGNERBACKUPPATH), + CommonIOUtils.copyFilesInDirByPath(StableUtils.pathJoin(installHome, ProjectConstants.LOGS_NAME, + UpdateConstants.INSTALL_LIB, UpdateConstants.DESIGNERBACKUPPATH), StableUtils.pathJoin(StableUtils.getInstallHome(), ProjectConstants.LIB_NAME)); return true; } catch (IOException ignore) { @@ -37,16 +38,20 @@ public class RecoverForDesigner implements Recover { @Override public boolean backup() { - String installHome = StableUtils.getInstallHome(); //jar包备份文件的目录为"backup/"+jar包当前版本号 String todayBackupDir = StableUtils.pathJoin(installHome, UpdateConstants.DESIGNER_BACKUP_DIR, (GeneralUtils.readBuildNO())); - backupFilesFromInstallEnv(todayBackupDir); + String envHome = StableUtils.pathJoin(installHome, UpdateConstants.WEBAPPS, ProjectConstants.WEBAPP_NAME, ProjectConstants.WEBINF_NAME); + backupFilesFromInstallEnv(envHome, todayBackupDir); backupFilesFromInstallLib(installHome, todayBackupDir); try { - File file = new File(StableUtils.pathJoin(installHome, UpdateConstants.DOWNLOADPATH)); - CommonUtils.mkdirs(file); - IOUtils.copyFilesInDirByPath(StableUtils.pathJoin(installHome,ProjectConstants.LIB_NAME), - StableUtils.pathJoin(installHome, UpdateConstants.DESIGNERBACKUPPATH)); + String installBackup = StableUtils.pathJoin(installHome, ProjectConstants.LOGS_NAME, + UpdateConstants.INSTALL_LIB); + File installLib = new File(installBackup); + CommonUtils.mkdirs(installLib); + File download = new File(StableUtils.pathJoin(installBackup,UpdateConstants.DOWNLOADPATH)); + CommonUtils.mkdirs(download); + CommonIOUtils.copyFilesInDirByPath(StableUtils.pathJoin(installHome,ProjectConstants.LIB_NAME), + StableUtils.pathJoin(installBackup,UpdateConstants.DESIGNERBACKUPPATH)); DesignerContext.getDesignerFrame().prepareForExit(); return true; } catch (IOException e) { @@ -56,11 +61,11 @@ public class RecoverForDesigner implements Recover { } } - private void backupFilesFromInstallEnv(String todayBackupDir) { + private void backupFilesFromInstallEnv(String envHome, String todayBackupDir) { try { CommonUtils.mkdirs(new File(StableUtils.pathJoin(todayBackupDir,UpdateConstants.BACKUPPATH))); - IOUtils.copyFilesInDirByPath( - StableUtils.pathJoin(WorkContext.getCurrent().getPath(),ProjectConstants.LIB_NAME), + CommonIOUtils.copyFilesInDirByPath( + StableUtils.pathJoin(envHome,ProjectConstants.LIB_NAME), StableUtils.pathJoin(todayBackupDir,UpdateConstants.BACKUPPATH)); } catch (IOException e) { UpdateException exception = new UpdateException(e.getMessage()); @@ -71,7 +76,7 @@ public class RecoverForDesigner implements Recover { private void backupFilesFromInstallLib(String installHome, String todayBackupDir) { try { CommonUtils.mkdirs(new File(StableUtils.pathJoin(todayBackupDir,UpdateConstants.DESIGNERBACKUPPATH))); - IOUtils.copyFilesInDirByPath( + CommonIOUtils.copyFilesInDirByPath( StableUtils.pathJoin(installHome,ProjectConstants.LIB_NAME), StableUtils.pathJoin(todayBackupDir,UpdateConstants.DESIGNERBACKUPPATH)); } catch (IOException e) { diff --git a/designer-base/src/main/java/com/fr/design/update/ui/dialog/RestoreResultDialog.java b/designer-base/src/main/java/com/fr/design/update/ui/dialog/RestoreResultDialog.java index 40516e2082..225ab1312c 100644 --- a/designer-base/src/main/java/com/fr/design/update/ui/dialog/RestoreResultDialog.java +++ b/designer-base/src/main/java/com/fr/design/update/ui/dialog/RestoreResultDialog.java @@ -169,7 +169,7 @@ public class RestoreResultDialog extends JDialog { private void filesToMove(String installHome, Map map) { String backupDir = UpdateConstants.DESIGNER_BACKUP_DIR; - String envHome = WorkContext.getCurrent().getPath(); + String envHome = StableUtils.pathJoin(installHome, UpdateConstants.WEBAPPS, ProjectConstants.WEBAPP_NAME, ProjectConstants.WEBINF_NAME); File installLib = new File(StableUtils.pathJoin(installHome, backupDir, jarRestoreDir, UpdateConstants.DESIGNERBACKUPPATH)); File envLib = new File(StableUtils.pathJoin(installHome, backupDir, jarRestoreDir, UpdateConstants.BACKUPPATH)); File[] files; diff --git a/designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java b/designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java index c736b6383b..1fb21d41cb 100644 --- a/designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java +++ b/designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java @@ -30,6 +30,7 @@ import com.fr.json.JSONArray; import com.fr.json.JSONObject; import com.fr.log.FineLoggerFactory; import com.fr.stable.*; +import com.fr.stable.project.ProjectConstants; import com.fr.third.org.apache.http.client.methods.CloseableHttpResponse; import com.fr.third.org.apache.http.client.methods.HttpGet; import com.fr.third.org.apache.http.impl.client.CloseableHttpClient; @@ -593,19 +594,20 @@ public class UpdateMainDialog extends UIDialog { updateButton.setEnabled(false); updateLabel.setVisible(false); RestoreResultDialog.deletePreviousPropertyFile(); + final String installLib = StableUtils.pathJoin(StableUtils.getInstallHome(), ProjectConstants.LOGS_NAME, UpdateConstants.INSTALL_LIB); final JFrame frame = DesignerContext.getDesignerFrame(); final RestartHelper helper = new RestartHelper(); new FileProcess(callBack) { @Override public void onDownloadSuccess() { progressBar.setVisible(false); - deleteForDesignerUpdate(); + deleteForDesignerUpdate(installLib); helper.restartForUpdate(frame); } @Override public void onDownloadFailed() { progressBar.setVisible(false); - deleteForDesignerUpdate(); + deleteForDesignerUpdate(installLib); JOptionPane.showMessageDialog(getParent(), Toolkit.i18nText("Fine-Design_Update_Info_Failed_Message")); helper.restartForUpdate(frame); } @@ -615,11 +617,9 @@ public class UpdateMainDialog extends UIDialog { }); } - private void deleteForDesignerUpdate() { - File designerBackup = new File(StableUtils.pathJoin(StableUtils.getInstallHome(),UpdateConstants.DESIGNERBACKUPPATH)); - CommonUtils.deleteFile(designerBackup); - File downloadForDesigner = new File(StableUtils.pathJoin(StableUtils.getInstallHome(),UpdateConstants.DOWNLOADPATH)); - CommonUtils.deleteFile(downloadForDesigner); + private void deleteForDesignerUpdate(String installLib) { + File dir = new File(installLib); + CommonUtils.deleteFile(dir); } //获取备份目录 From 256bec10b6accab8a98c6a751cf79d790d427cff Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 31 Oct 2019 09:39:11 +0800 Subject: [PATCH 68/95] =?UTF-8?q?REPORT-7588=20=E7=BB=9D=E5=AF=B9=E7=94=BB?= =?UTF-8?q?=E5=B8=83=E5=9D=97=E5=92=8C=E5=8F=A6=E4=B8=80=E4=B8=AA=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E4=B8=80=E8=B5=B7=E7=A7=BB=E5=8A=A8=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E7=BB=9D=E5=AF=B9=E5=8C=96=E5=B8=83=E5=9D=97=E9=87=8C=E7=9A=84?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E4=BC=9A=E7=BC=A9=E5=B0=8F=20=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=E5=88=B010.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/mainframe/FormSelection.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormSelection.java b/designer-form/src/main/java/com/fr/design/mainframe/FormSelection.java index c7d7d8c157..cbebbcba16 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormSelection.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormSelection.java @@ -265,12 +265,18 @@ public class FormSelection { * @param designer 设计界面组件 */ public void fixCreator(FormDesigner designer) { + int i = 0; for (XCreator creator : selection) { LayoutAdapter layoutAdapter = AdapterBus.searchLayoutAdapter(designer, creator); if (layoutAdapter != null) { - creator.setBackupBound(backupBounds); + if (creator.acceptType(XWAbsoluteLayout.class) && recs.size() > i) { + creator.setBackupBound(recs.get(i)); + } else { + creator.setBackupBound(backupBounds); + } layoutAdapter.fix(creator); } + i++; } } From faba719933b82a8fdd02a8cd28ec8538e8629c45 Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 31 Oct 2019 14:07:37 +0800 Subject: [PATCH 69/95] =?UTF-8?q?=E8=8B=B1=E6=96=87=E4=B8=8B=E6=9C=AA?= =?UTF-8?q?=E5=9B=BD=E9=99=85=E5=8C=96-=E6=A8=A1=E6=9D=BF-=E7=A7=BB?= =?UTF-8?q?=E5=8A=A8=E7=AB=AF=E5=B1=9E=E6=80=A7-=E5=85=B6=E4=BB=96-?= =?UTF-8?q?=E2=80=98=E5=85=81=E8=AE=B8=E5=8F=8C=E5=87=BB/=E5=8F=8C?= =?UTF-8?q?=E6=8C=87=E7=BC=A9=E6=94=BE=E2=80=99=E5=AD=97=E6=AE=B5=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E4=B9=B1=E7=A0=81=EF=BC=88=E7=BC=BA=E5=A4=B1=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/form/mobile/FormMobileOthersPane.java | 2 +- .../main/java/com/fr/design/report/mobile/MobileOthersPane.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/form/mobile/FormMobileOthersPane.java b/designer-form/src/main/java/com/fr/design/form/mobile/FormMobileOthersPane.java index 60cc6d21f0..2e2b16997f 100644 --- a/designer-form/src/main/java/com/fr/design/form/mobile/FormMobileOthersPane.java +++ b/designer-form/src/main/java/com/fr/design/form/mobile/FormMobileOthersPane.java @@ -33,7 +33,7 @@ public class FormMobileOthersPane extends BasicBeanPane { contentPane.add(appearRefreshCheckPane, BorderLayout.WEST); promptWhenLeaveWithoutSubmitCheckPane = new MobileRadioCheckPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Prompt_When_Leave_Without_Submit")); contentPane.add(promptWhenLeaveWithoutSubmitCheckPane, BorderLayout.CENTER); - allowDoubleClickOrZoomCheckPane = new MobileRadioCheckPane(com.fr.design.i18n.Toolkit.i18nText("允许双击/双指缩放")); + allowDoubleClickOrZoomCheckPane = new MobileRadioCheckPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Mobile_Attr_Allow_Zoom")); contentPane.add(allowDoubleClickOrZoomCheckPane, BorderLayout.EAST); borderPane.add(contentPane); this.add(borderPane); diff --git a/designer-realize/src/main/java/com/fr/design/report/mobile/MobileOthersPane.java b/designer-realize/src/main/java/com/fr/design/report/mobile/MobileOthersPane.java index 4f88dcaef2..3948c26f3c 100644 --- a/designer-realize/src/main/java/com/fr/design/report/mobile/MobileOthersPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/mobile/MobileOthersPane.java @@ -32,7 +32,7 @@ public class MobileOthersPane extends BasicBeanPane { contentPane.setBorder(BorderFactory.createEmptyBorder(0, IntervalConstants.INTERVAL_L1, 0, 0)); appearRefreshCheckPane = new MobileRadioCheckPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Appear_Refresh")); contentPane.add(appearRefreshCheckPane, BorderLayout.WEST); - allowDoubleClickOrZoomCheckPane = new MobileRadioCheckPane(com.fr.design.i18n.Toolkit.i18nText("允许双击/双指缩放")); + allowDoubleClickOrZoomCheckPane = new MobileRadioCheckPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Mobile_Attr_Allow_Zoom")); contentPane.add(allowDoubleClickOrZoomCheckPane, BorderLayout.CENTER); borderPane.add(contentPane); this.add(borderPane); From a0dd6a1d86ec1e01c746df664d1974bc1116e547 Mon Sep 17 00:00:00 2001 From: Lucian Date: Thu, 31 Oct 2019 15:41:56 +0800 Subject: [PATCH 70/95] =?UTF-8?q?REPORT-23498=20=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E9=80=89=E9=A1=B9=E4=B8=AD=E5=8E=BB=E6=8E=89?= =?UTF-8?q?=E5=BC=80=E5=8F=91=E8=80=85=E5=B7=A5=E5=85=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/actions/file/PreferencePane.java | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java index c4728bad65..43d7391775 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java @@ -134,7 +134,6 @@ public class PreferencePane extends BasicPane { private IntegerEditor portEditor; private UICheckBox oracleSpace; private UISpinner cachingTemplateSpinner; - private UICheckBox openDebugComboBox; private UICheckBox useOptimizedUPMCheckbox; private UICheckBox useUniverseDBMCheckbox; private UICheckBox joinProductImproveCheckBox; @@ -195,11 +194,6 @@ public class PreferencePane extends BasicPane { oracleSpace = new UICheckBox(i18nText("Fine-Design_Basic_Show_All_Oracle_Tables")); oraclePane.add(oracleSpace); - JPanel debuggerPane = FRGUIPaneFactory.createTitledBorderPane(i18nText("Fine-Design_Basic_Develop_Tools")); - openDebugComboBox = new UICheckBox(i18nText("Fine-Design_Basic_Open_Debug_Window")); - debuggerPane.add(openDebugComboBox, BorderLayout.CENTER); - advancePane.add(debuggerPane); - JPanel upmSelectorPane = FRGUIPaneFactory.createTitledBorderPane(i18nText("Fine-Design_Basic_Update_Plugin_Manager")); useOptimizedUPMCheckbox = new UICheckBox(i18nText("Fine-Design_Basic_Use_New_Update_Plugin_Manager")); upmSelectorPane.add(useOptimizedUPMCheckbox); @@ -708,7 +702,6 @@ public class PreferencePane extends BasicPane { this.portEditor.setValue(new Integer(designerEnvManager.getEmbedServerPort())); - openDebugComboBox.setSelected(designerEnvManager.isOpenDebug()); useOptimizedUPMCheckbox.setSelected(ServerPreferenceConfig.getInstance().isUseOptimizedUPM()); useUniverseDBMCheckbox.setSelected(ServerPreferenceConfig.getInstance().isUseUniverseDBM()); @@ -778,8 +771,6 @@ public class PreferencePane extends BasicPane { designerEnvManager.setJettyServerPort(portEditor.getValue().intValue()); - designerEnvManager.setOpenDebug(openDebugComboBox.isSelected()); - designerEnvManager.setOracleSystemSpace(this.oracleSpace.isSelected()); designerEnvManager.setCachingTemplateLimit((int) this.cachingTemplateSpinner.getValue()); designerEnvManager.setJoinProductImprove(this.joinProductImproveCheckBox.isSelected()); @@ -1071,3 +1062,4 @@ public class PreferencePane extends BasicPane { } } + From 651ce8a3f36bc2f2becd274b549985df24d59a5f Mon Sep 17 00:00:00 2001 From: Bryant Date: Thu, 31 Oct 2019 16:11:14 +0800 Subject: [PATCH 71/95] =?UTF-8?q?REPORT-23486=20=E4=BF=AE=E5=A4=8Dbug?= =?UTF-8?q?=E4=BB=A5=E5=8F=8A=E6=9B=B4=E6=94=B9=E6=96=87=E4=BB=B6=E5=A4=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../update/actions/RecoverForDesigner.java | 32 ++++++++++++++----- .../update/ui/dialog/RestoreResultDialog.java | 3 +- 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/update/actions/RecoverForDesigner.java b/designer-base/src/main/java/com/fr/design/update/actions/RecoverForDesigner.java index 92493430f4..dc26efc59a 100644 --- a/designer-base/src/main/java/com/fr/design/update/actions/RecoverForDesigner.java +++ b/designer-base/src/main/java/com/fr/design/update/actions/RecoverForDesigner.java @@ -1,6 +1,7 @@ package com.fr.design.update.actions; import com.fr.decision.update.backup.Recover; +import com.fr.decision.update.backup.RecoverPathManager; import com.fr.decision.update.data.UpdateConstants; import com.fr.decision.update.exception.UpdateException; import com.fr.design.mainframe.DesignerContext; @@ -40,7 +41,7 @@ public class RecoverForDesigner implements Recover { public boolean backup() { //jar包备份文件的目录为"backup/"+jar包当前版本号 String todayBackupDir = StableUtils.pathJoin(installHome, UpdateConstants.DESIGNER_BACKUP_DIR, (GeneralUtils.readBuildNO())); - String envHome = StableUtils.pathJoin(installHome, UpdateConstants.WEBAPPS, ProjectConstants.WEBAPP_NAME, ProjectConstants.WEBINF_NAME); + String envHome = RecoverPathManager.getInstance().getEnvHome(); backupFilesFromInstallEnv(envHome, todayBackupDir); backupFilesFromInstallLib(installHome, todayBackupDir); try { @@ -63,10 +64,18 @@ public class RecoverForDesigner implements Recover { private void backupFilesFromInstallEnv(String envHome, String todayBackupDir) { try { - CommonUtils.mkdirs(new File(StableUtils.pathJoin(todayBackupDir,UpdateConstants.BACKUPPATH))); - CommonIOUtils.copyFilesInDirByPath( - StableUtils.pathJoin(envHome,ProjectConstants.LIB_NAME), - StableUtils.pathJoin(todayBackupDir,UpdateConstants.BACKUPPATH)); + File file = new File(StableUtils.pathJoin(todayBackupDir,UpdateConstants.BACKUPPATH)); + CommonUtils.mkdirs(file); + file = new File(StableUtils.pathJoin(envHome,ProjectConstants.LIB_NAME)); + File[] files = file.listFiles(); + File dir = new File(StableUtils.pathJoin(todayBackupDir,UpdateConstants.BACKUPPATH)); + if (files != null) { + for (File file1 : files) { + if (file1.getName().startsWith(UpdateConstants.FINE) && file1.getName().endsWith(UpdateConstants.JAR_FILE_SUFFIX)) { + CommonIOUtils.copy(file1, dir); + } + } + } } catch (IOException e) { UpdateException exception = new UpdateException(e.getMessage()); FineLoggerFactory.getLogger().error(exception.getMessage() + "backup for Designer recover in env failed"); @@ -76,9 +85,16 @@ public class RecoverForDesigner implements Recover { private void backupFilesFromInstallLib(String installHome, String todayBackupDir) { try { CommonUtils.mkdirs(new File(StableUtils.pathJoin(todayBackupDir,UpdateConstants.DESIGNERBACKUPPATH))); - CommonIOUtils.copyFilesInDirByPath( - StableUtils.pathJoin(installHome,ProjectConstants.LIB_NAME), - StableUtils.pathJoin(todayBackupDir,UpdateConstants.DESIGNERBACKUPPATH)); + File file = new File(StableUtils.pathJoin(installHome,ProjectConstants.LIB_NAME)); + File[] files = file.listFiles(); + File dir = new File(StableUtils.pathJoin(todayBackupDir,UpdateConstants.DESIGNERBACKUPPATH)); + if (files != null) { + for (File file1 : files) { + if (file1.getName().startsWith(UpdateConstants.FINE) || file1.getName().contains(UpdateConstants.ASPECTJRT)) { + CommonIOUtils.copy(file, dir); + } + } + } } catch (IOException e) { UpdateException exception = new UpdateException(e.getMessage()); FineLoggerFactory.getLogger().error(exception.getMessage() + "backup for Designer recover in install failed"); diff --git a/designer-base/src/main/java/com/fr/design/update/ui/dialog/RestoreResultDialog.java b/designer-base/src/main/java/com/fr/design/update/ui/dialog/RestoreResultDialog.java index 225ab1312c..d94a93c711 100644 --- a/designer-base/src/main/java/com/fr/design/update/ui/dialog/RestoreResultDialog.java +++ b/designer-base/src/main/java/com/fr/design/update/ui/dialog/RestoreResultDialog.java @@ -10,7 +10,6 @@ import com.fr.general.ComparatorUtils; import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; import com.fr.stable.project.ProjectConstants; -import com.fr.workspace.WorkContext; import javax.swing.AbstractAction; import javax.swing.BorderFactory; @@ -206,7 +205,7 @@ public class RestoreResultDialog extends JDialog { } private void filesToDelete(String installHome, List list) { - String envHome = WorkContext.getCurrent().getPath(); + String envHome = StableUtils.pathJoin(installHome, UpdateConstants.WEBAPPS, ProjectConstants.WEBAPP_NAME, ProjectConstants.WEBINF_NAME); File installEnv = new File(StableUtils.pathJoin(envHome,ProjectConstants.LIB_NAME)); File[] files = installEnv.listFiles(); if (files != null) { From 3b1b30f90a6aa96788517b0758dbe2e41a931abe Mon Sep 17 00:00:00 2001 From: Bryant Date: Thu, 31 Oct 2019 16:11:57 +0800 Subject: [PATCH 72/95] =?UTF-8?q?REPORT-23486=20=E4=BF=AE=E5=A4=8Dbug?= =?UTF-8?q?=E4=BB=A5=E5=8F=8A=E6=9B=B4=E6=94=B9=E6=96=87=E4=BB=B6=E5=A4=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/start/module/DesignerActivator.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java b/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java index 1727906fb0..a2f338182e 100644 --- a/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java +++ b/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java @@ -9,6 +9,8 @@ import com.fr.base.process.ProcessOperator; import com.fr.chart.chartattr.ChartCollection; import com.fr.config.MarketConfig; import com.fr.decision.update.backup.RecoverManager; +import com.fr.decision.update.backup.RecoverPathManager; +import com.fr.decision.update.data.UpdateConstants; import com.fr.design.DesignerEnvManager; import com.fr.design.ExtraDesignClassManager; import com.fr.design.actions.NewFormAction; @@ -93,10 +95,12 @@ import com.fr.report.cell.painter.BiasTextPainter; import com.fr.report.cell.painter.CellImagePainter; import com.fr.stable.ArrayUtils; import com.fr.stable.ParameterProvider; +import com.fr.stable.StableUtils; import com.fr.stable.bridge.StableFactory; import com.fr.stable.os.support.OSBasedAction; import com.fr.stable.os.support.OSSupportCenter; import com.fr.stable.plugin.ExtraDesignClassManagerProvider; +import com.fr.stable.project.ProjectConstants; import com.fr.stable.script.CalculatorProviderContext; import com.fr.stable.script.ValueConverter; import com.fr.stable.xml.ObjectTokenizer; @@ -138,6 +142,8 @@ public class DesignerActivator extends Activator { }, SupportOSImpl.USERINFOPANE); storePassport(); AlphaFineHelper.switchConfig4Locale(); + RecoverPathManager.getInstance().setEnvHome(StableUtils.pathJoin(StableUtils.getInstallHome(), UpdateConstants.WEBAPPS, + ProjectConstants.WEBAPP_NAME, ProjectConstants.WEBINF_NAME)); RecoverManager.register(new RecoverForDesigner()); } From 8d6d05cddf32080b4eb1179022c0f40fa3ad03fa Mon Sep 17 00:00:00 2001 From: Bryant Date: Thu, 31 Oct 2019 16:24:13 +0800 Subject: [PATCH 73/95] =?UTF-8?q?REPORT-23486=20=E4=BF=AE=E5=A4=8Dbug?= =?UTF-8?q?=E4=BB=A5=E5=8F=8A=E6=9B=B4=E6=94=B9=E6=96=87=E4=BB=B6=E5=A4=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/start/module/DesignerActivator.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java b/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java index a2f338182e..b88d2f1e84 100644 --- a/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java +++ b/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java @@ -9,7 +9,7 @@ import com.fr.base.process.ProcessOperator; import com.fr.chart.chartattr.ChartCollection; import com.fr.config.MarketConfig; import com.fr.decision.update.backup.RecoverManager; -import com.fr.decision.update.backup.RecoverPathManager; +import com.fr.decision.update.data.LibPathManager; import com.fr.decision.update.data.UpdateConstants; import com.fr.design.DesignerEnvManager; import com.fr.design.ExtraDesignClassManager; @@ -142,7 +142,7 @@ public class DesignerActivator extends Activator { }, SupportOSImpl.USERINFOPANE); storePassport(); AlphaFineHelper.switchConfig4Locale(); - RecoverPathManager.getInstance().setEnvHome(StableUtils.pathJoin(StableUtils.getInstallHome(), UpdateConstants.WEBAPPS, + LibPathManager.getInstance().setEnvHome(StableUtils.pathJoin(StableUtils.getInstallHome(), UpdateConstants.WEBAPPS, ProjectConstants.WEBAPP_NAME, ProjectConstants.WEBINF_NAME)); RecoverManager.register(new RecoverForDesigner()); } From ca05ea8aee7a94d68b4b540fe900fdb92cd4b509 Mon Sep 17 00:00:00 2001 From: Bryant Date: Thu, 31 Oct 2019 16:24:29 +0800 Subject: [PATCH 74/95] =?UTF-8?q?REPORT-23486=20=E4=BF=AE=E5=A4=8Dbug?= =?UTF-8?q?=E4=BB=A5=E5=8F=8A=E6=9B=B4=E6=94=B9=E6=96=87=E4=BB=B6=E5=A4=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/update/actions/RecoverForDesigner.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/update/actions/RecoverForDesigner.java b/designer-base/src/main/java/com/fr/design/update/actions/RecoverForDesigner.java index dc26efc59a..2717bf5dae 100644 --- a/designer-base/src/main/java/com/fr/design/update/actions/RecoverForDesigner.java +++ b/designer-base/src/main/java/com/fr/design/update/actions/RecoverForDesigner.java @@ -1,7 +1,7 @@ package com.fr.design.update.actions; import com.fr.decision.update.backup.Recover; -import com.fr.decision.update.backup.RecoverPathManager; +import com.fr.decision.update.data.LibPathManager; import com.fr.decision.update.data.UpdateConstants; import com.fr.decision.update.exception.UpdateException; import com.fr.design.mainframe.DesignerContext; @@ -41,7 +41,7 @@ public class RecoverForDesigner implements Recover { public boolean backup() { //jar包备份文件的目录为"backup/"+jar包当前版本号 String todayBackupDir = StableUtils.pathJoin(installHome, UpdateConstants.DESIGNER_BACKUP_DIR, (GeneralUtils.readBuildNO())); - String envHome = RecoverPathManager.getInstance().getEnvHome(); + String envHome = LibPathManager.getInstance().getEnvHome(); backupFilesFromInstallEnv(envHome, todayBackupDir); backupFilesFromInstallLib(installHome, todayBackupDir); try { From 9605539faea8efe0624471a156ac80c2fbe728b3 Mon Sep 17 00:00:00 2001 From: Bryant Date: Thu, 31 Oct 2019 16:28:26 +0800 Subject: [PATCH 75/95] =?UTF-8?q?REPORT-23486=20=E4=BF=AE=E5=A4=8Dbug?= =?UTF-8?q?=E4=BB=A5=E5=8F=8A=E6=9B=B4=E6=94=B9=E6=96=87=E4=BB=B6=E5=A4=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/start/module/DesignerActivator.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java b/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java index b88d2f1e84..0ab7ec63c5 100644 --- a/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java +++ b/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java @@ -9,7 +9,7 @@ import com.fr.base.process.ProcessOperator; import com.fr.chart.chartattr.ChartCollection; import com.fr.config.MarketConfig; import com.fr.decision.update.backup.RecoverManager; -import com.fr.decision.update.data.LibPathManager; +import com.fr.decision.workspace.EnvPathManager; import com.fr.decision.update.data.UpdateConstants; import com.fr.design.DesignerEnvManager; import com.fr.design.ExtraDesignClassManager; @@ -142,7 +142,7 @@ public class DesignerActivator extends Activator { }, SupportOSImpl.USERINFOPANE); storePassport(); AlphaFineHelper.switchConfig4Locale(); - LibPathManager.getInstance().setEnvHome(StableUtils.pathJoin(StableUtils.getInstallHome(), UpdateConstants.WEBAPPS, + EnvPathManager.getInstance().setEnvHome(StableUtils.pathJoin(StableUtils.getInstallHome(), UpdateConstants.WEBAPPS, ProjectConstants.WEBAPP_NAME, ProjectConstants.WEBINF_NAME)); RecoverManager.register(new RecoverForDesigner()); } From 050a34b34d5f1803b87c7dfde2dd105013edcaf5 Mon Sep 17 00:00:00 2001 From: Bryant Date: Thu, 31 Oct 2019 16:28:35 +0800 Subject: [PATCH 76/95] =?UTF-8?q?REPORT-23486=20=E4=BF=AE=E5=A4=8Dbug?= =?UTF-8?q?=E4=BB=A5=E5=8F=8A=E6=9B=B4=E6=94=B9=E6=96=87=E4=BB=B6=E5=A4=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/update/actions/RecoverForDesigner.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/update/actions/RecoverForDesigner.java b/designer-base/src/main/java/com/fr/design/update/actions/RecoverForDesigner.java index 2717bf5dae..2e0866d26a 100644 --- a/designer-base/src/main/java/com/fr/design/update/actions/RecoverForDesigner.java +++ b/designer-base/src/main/java/com/fr/design/update/actions/RecoverForDesigner.java @@ -1,7 +1,7 @@ package com.fr.design.update.actions; import com.fr.decision.update.backup.Recover; -import com.fr.decision.update.data.LibPathManager; +import com.fr.decision.workspace.EnvPathManager; import com.fr.decision.update.data.UpdateConstants; import com.fr.decision.update.exception.UpdateException; import com.fr.design.mainframe.DesignerContext; @@ -41,7 +41,7 @@ public class RecoverForDesigner implements Recover { public boolean backup() { //jar包备份文件的目录为"backup/"+jar包当前版本号 String todayBackupDir = StableUtils.pathJoin(installHome, UpdateConstants.DESIGNER_BACKUP_DIR, (GeneralUtils.readBuildNO())); - String envHome = LibPathManager.getInstance().getEnvHome(); + String envHome = EnvPathManager.getInstance().getEnvHome(); backupFilesFromInstallEnv(envHome, todayBackupDir); backupFilesFromInstallLib(installHome, todayBackupDir); try { From 0ad448123248c064b6e76ee34493051763c57cf3 Mon Sep 17 00:00:00 2001 From: Bryant Date: Thu, 31 Oct 2019 17:29:56 +0800 Subject: [PATCH 77/95] =?UTF-8?q?REPORT-23486=20=E4=BF=AE=E5=A4=8Dbug?= =?UTF-8?q?=E4=BB=A5=E5=8F=8A=E6=9B=B4=E6=94=B9=E6=96=87=E4=BB=B6=E5=A4=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/start/module/DesignerActivator.java | 6 ------ 1 file changed, 6 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java b/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java index 0ab7ec63c5..1727906fb0 100644 --- a/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java +++ b/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java @@ -9,8 +9,6 @@ import com.fr.base.process.ProcessOperator; import com.fr.chart.chartattr.ChartCollection; import com.fr.config.MarketConfig; import com.fr.decision.update.backup.RecoverManager; -import com.fr.decision.workspace.EnvPathManager; -import com.fr.decision.update.data.UpdateConstants; import com.fr.design.DesignerEnvManager; import com.fr.design.ExtraDesignClassManager; import com.fr.design.actions.NewFormAction; @@ -95,12 +93,10 @@ import com.fr.report.cell.painter.BiasTextPainter; import com.fr.report.cell.painter.CellImagePainter; import com.fr.stable.ArrayUtils; import com.fr.stable.ParameterProvider; -import com.fr.stable.StableUtils; import com.fr.stable.bridge.StableFactory; import com.fr.stable.os.support.OSBasedAction; import com.fr.stable.os.support.OSSupportCenter; import com.fr.stable.plugin.ExtraDesignClassManagerProvider; -import com.fr.stable.project.ProjectConstants; import com.fr.stable.script.CalculatorProviderContext; import com.fr.stable.script.ValueConverter; import com.fr.stable.xml.ObjectTokenizer; @@ -142,8 +138,6 @@ public class DesignerActivator extends Activator { }, SupportOSImpl.USERINFOPANE); storePassport(); AlphaFineHelper.switchConfig4Locale(); - EnvPathManager.getInstance().setEnvHome(StableUtils.pathJoin(StableUtils.getInstallHome(), UpdateConstants.WEBAPPS, - ProjectConstants.WEBAPP_NAME, ProjectConstants.WEBINF_NAME)); RecoverManager.register(new RecoverForDesigner()); } From 5e682bce9f62a7e1e0b3815dbae696181b072ced Mon Sep 17 00:00:00 2001 From: Bryant Date: Thu, 31 Oct 2019 17:30:07 +0800 Subject: [PATCH 78/95] =?UTF-8?q?REPORT-23486=20=E4=BF=AE=E5=A4=8Dbug?= =?UTF-8?q?=E4=BB=A5=E5=8F=8A=E6=9B=B4=E6=94=B9=E6=96=87=E4=BB=B6=E5=A4=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/update/actions/RecoverForDesigner.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/update/actions/RecoverForDesigner.java b/designer-base/src/main/java/com/fr/design/update/actions/RecoverForDesigner.java index 2e0866d26a..8f3621451e 100644 --- a/designer-base/src/main/java/com/fr/design/update/actions/RecoverForDesigner.java +++ b/designer-base/src/main/java/com/fr/design/update/actions/RecoverForDesigner.java @@ -1,7 +1,6 @@ package com.fr.design.update.actions; import com.fr.decision.update.backup.Recover; -import com.fr.decision.workspace.EnvPathManager; import com.fr.decision.update.data.UpdateConstants; import com.fr.decision.update.exception.UpdateException; import com.fr.design.mainframe.DesignerContext; @@ -9,6 +8,7 @@ import com.fr.general.CommonIOUtils; import com.fr.general.GeneralUtils; import com.fr.log.FineLoggerFactory; import com.fr.stable.CommonUtils; +import com.fr.stable.ProjectLibrary; import com.fr.stable.StableUtils; import com.fr.stable.project.ProjectConstants; @@ -41,7 +41,7 @@ public class RecoverForDesigner implements Recover { public boolean backup() { //jar包备份文件的目录为"backup/"+jar包当前版本号 String todayBackupDir = StableUtils.pathJoin(installHome, UpdateConstants.DESIGNER_BACKUP_DIR, (GeneralUtils.readBuildNO())); - String envHome = EnvPathManager.getInstance().getEnvHome(); + String envHome = ProjectLibrary.getInstance().getLibHome(); backupFilesFromInstallEnv(envHome, todayBackupDir); backupFilesFromInstallLib(installHome, todayBackupDir); try { From f32f39d6f865f263e686fbf0212386c476be470e Mon Sep 17 00:00:00 2001 From: Bryant Date: Thu, 31 Oct 2019 17:44:42 +0800 Subject: [PATCH 79/95] =?UTF-8?q?REPORT-23486=20=E4=BF=AE=E5=A4=8Dbug?= =?UTF-8?q?=E4=BB=A5=E5=8F=8A=E6=9B=B4=E6=94=B9=E6=96=87=E4=BB=B6=E5=A4=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/update/actions/RecoverForDesigner.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/update/actions/RecoverForDesigner.java b/designer-base/src/main/java/com/fr/design/update/actions/RecoverForDesigner.java index 8f3621451e..7cb2826cf0 100644 --- a/designer-base/src/main/java/com/fr/design/update/actions/RecoverForDesigner.java +++ b/designer-base/src/main/java/com/fr/design/update/actions/RecoverForDesigner.java @@ -31,8 +31,8 @@ public class RecoverForDesigner implements Recover { UpdateConstants.INSTALL_LIB, UpdateConstants.DESIGNERBACKUPPATH), StableUtils.pathJoin(StableUtils.getInstallHome(), ProjectConstants.LIB_NAME)); return true; - } catch (IOException ignore) { - FineLoggerFactory.getLogger().error("Recover error for designer"); + } catch (IOException e) { + FineLoggerFactory.getLogger().error("Recover error for designer", e); return false; } } @@ -78,7 +78,7 @@ public class RecoverForDesigner implements Recover { } } catch (IOException e) { UpdateException exception = new UpdateException(e.getMessage()); - FineLoggerFactory.getLogger().error(exception.getMessage() + "backup for Designer recover in env failed"); + FineLoggerFactory.getLogger().error(exception.getMessage() , "backup for Designer recover in env failed"); } } @@ -97,7 +97,7 @@ public class RecoverForDesigner implements Recover { } } catch (IOException e) { UpdateException exception = new UpdateException(e.getMessage()); - FineLoggerFactory.getLogger().error(exception.getMessage() + "backup for Designer recover in install failed"); + FineLoggerFactory.getLogger().error(exception.getMessage() , "backup for Designer recover in install failed"); } } } From 7786d3593792bcbdf8cbe5810b65395b67be78bf Mon Sep 17 00:00:00 2001 From: Bryant Date: Fri, 1 Nov 2019 08:44:55 +0800 Subject: [PATCH 80/95] =?UTF-8?q?REPORT-23486=20=E4=BF=AE=E5=A4=8Dbug?= =?UTF-8?q?=E4=BB=A5=E5=8F=8A=E6=9B=B4=E6=94=B9=E6=96=87=E4=BB=B6=E5=A4=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/update/actions/RecoverForDesigner.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/update/actions/RecoverForDesigner.java b/designer-base/src/main/java/com/fr/design/update/actions/RecoverForDesigner.java index 7cb2826cf0..eb25ccea30 100644 --- a/designer-base/src/main/java/com/fr/design/update/actions/RecoverForDesigner.java +++ b/designer-base/src/main/java/com/fr/design/update/actions/RecoverForDesigner.java @@ -85,12 +85,12 @@ public class RecoverForDesigner implements Recover { private void backupFilesFromInstallLib(String installHome, String todayBackupDir) { try { CommonUtils.mkdirs(new File(StableUtils.pathJoin(todayBackupDir,UpdateConstants.DESIGNERBACKUPPATH))); - File file = new File(StableUtils.pathJoin(installHome,ProjectConstants.LIB_NAME)); - File[] files = file.listFiles(); + File lib = new File(StableUtils.pathJoin(installHome,ProjectConstants.LIB_NAME)); + File[] files = lib.listFiles(); File dir = new File(StableUtils.pathJoin(todayBackupDir,UpdateConstants.DESIGNERBACKUPPATH)); if (files != null) { - for (File file1 : files) { - if (file1.getName().startsWith(UpdateConstants.FINE) || file1.getName().contains(UpdateConstants.ASPECTJRT)) { + for (File file : files) { + if (file.getName().startsWith(UpdateConstants.FINE) || file.getName().contains(UpdateConstants.ASPECTJRT)) { CommonIOUtils.copy(file, dir); } } From 0705f92caf1a50584dcbf65fa70ac2e4102150b7 Mon Sep 17 00:00:00 2001 From: "Hugh.C" Date: Fri, 1 Nov 2019 12:04:17 +0800 Subject: [PATCH 81/95] =?UTF-8?q?REPORT-23570=20=E6=A8=A1=E7=89=88?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E7=AE=A1=E7=90=86=EF=BC=8Cgc=E4=B8=BA?= =?UTF-8?q?=E8=B4=9F=E6=95=B0=E6=97=B6=E5=BA=94=E5=BD=93=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E2=80=9C=E6=97=A0=E5=8F=AF=E4=BC=98=E5=8C=96=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/actions/file/PreferencePane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java index 43d7391775..9fa3849dfc 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java @@ -883,7 +883,7 @@ public class PreferencePane extends BasicPane { } catch (InterruptedException e) { FineLoggerFactory.getLogger().error(e, e.getMessage()); } - updateGcDialogPanelInfo(i18nText("Fine-Design_Vcs_Reduce_File_Size") + fileSizeConvert(size)); + updateGcDialogPanelInfo(size <= 0 ? i18nText("Fine-Design_Vcs_No_Optimization_File") : i18nText("Fine-Design_Vcs_Reduce_File_Size") + fileSizeConvert(size)); gcDialogDownPane.revalidate(); gcDialogDownPane.repaint(); gcDialogDownPane.add(gcOkButton); From 444c8c0682384429fcf8bade8019c8b7f4f21090 Mon Sep 17 00:00:00 2001 From: "Hugh.C" Date: Fri, 1 Nov 2019 12:44:12 +0800 Subject: [PATCH 82/95] =?UTF-8?q?REPORT-23570=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=9B=BD=E9=99=85=E5=8C=96=E5=90=8D=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/actions/file/PreferencePane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java index 9fa3849dfc..4a1c208c91 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java @@ -883,7 +883,7 @@ public class PreferencePane extends BasicPane { } catch (InterruptedException e) { FineLoggerFactory.getLogger().error(e, e.getMessage()); } - updateGcDialogPanelInfo(size <= 0 ? i18nText("Fine-Design_Vcs_No_Optimization_File") : i18nText("Fine-Design_Vcs_Reduce_File_Size") + fileSizeConvert(size)); + updateGcDialogPanelInfo(size <= 0 ? i18nText("Fine-Design_Vcs_No_Optimizable_File") : i18nText("Fine-Design_Vcs_Reduce_File_Size") + fileSizeConvert(size)); gcDialogDownPane.revalidate(); gcDialogDownPane.repaint(); gcDialogDownPane.add(gcOkButton); From ac0c319ae4ee360205e06168af8049cff0d35961 Mon Sep 17 00:00:00 2001 From: Lucian Date: Fri, 1 Nov 2019 17:31:50 +0800 Subject: [PATCH 83/95] =?UTF-8?q?REPORT-23115=20=E8=BF=9C=E7=A8=8B?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E6=9D=83=E9=99=90=E9=85=8D=E7=BD=AE-?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E4=B8=8D=E5=8C=B9=E9=85=8D=E6=97=B6=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E8=A7=92=E8=89=B2=E5=88=97=E8=A1=A8=E9=83=BD=E4=B8=BA?= =?UTF-8?q?=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/file/NodeAuthProcessor.java | 11 ++++++-- .../action/RemoteDesignAuthManagerAction.java | 28 ++++++++++++++----- 2 files changed, 30 insertions(+), 9 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/file/NodeAuthProcessor.java b/designer-base/src/main/java/com/fr/design/file/NodeAuthProcessor.java index 2a1c0cc94e..a1082b62f9 100644 --- a/designer-base/src/main/java/com/fr/design/file/NodeAuthProcessor.java +++ b/designer-base/src/main/java/com/fr/design/file/NodeAuthProcessor.java @@ -13,6 +13,7 @@ import com.fr.workspace.WorkContext; import com.fr.workspace.server.authority.AuthorityOperator; import com.fr.workspace.server.authority.decision.DecisionOperator; +import java.lang.reflect.UndeclaredThrowableException; import java.util.ArrayList; public class NodeAuthProcessor { @@ -41,9 +42,15 @@ public class NodeAuthProcessor { if (!WorkContext.getCurrent().isLocal()) { try { String userName = WorkContext.getCurrent().getConnection().getUserName(); - String userId = WorkContext.getCurrent().get(DecisionOperator.class).getUserIdByName(userName); + DesignAuthority[] authorities = null; + try { + String userId = WorkContext.getCurrent().get(DecisionOperator.class).getUserIdByName(userName); + authorities = WorkContext.getCurrent().get(AuthorityOperator.class).getAuthorities(userId); + } catch(UndeclaredThrowableException e) { + // 兼容旧版本的服务器 + authorities = WorkContext.getCurrent().get(AuthorityOperator.class).getAuthorities(); + } // 远程设计获取设计成员的权限列表 - DesignAuthority[] authorities = WorkContext.getCurrent().get(AuthorityOperator.class).getAuthorities(userId); DesignAuthority authority = null; if (authorities != null) { diff --git a/designer-base/src/main/java/com/fr/design/remote/action/RemoteDesignAuthManagerAction.java b/designer-base/src/main/java/com/fr/design/remote/action/RemoteDesignAuthManagerAction.java index 63929685d9..f48cb12edf 100644 --- a/designer-base/src/main/java/com/fr/design/remote/action/RemoteDesignAuthManagerAction.java +++ b/designer-base/src/main/java/com/fr/design/remote/action/RemoteDesignAuthManagerAction.java @@ -9,11 +9,14 @@ import com.fr.design.mainframe.DesignerContext; import com.fr.design.remote.ui.AuthorityManagerPane; import com.fr.log.FineLoggerFactory; import com.fr.report.DesignAuthority; +import com.fr.report.constant.RoleType; import com.fr.stable.ArrayUtils; import com.fr.workspace.WorkContext; import com.fr.workspace.server.authority.AuthorityOperator; import java.awt.event.ActionEvent; +import java.util.ArrayList; +import java.util.List; /** * @author yaohwu @@ -38,13 +41,24 @@ public class RemoteDesignAuthManagerAction extends UpdateAction { if (!WorkContext.getCurrent().isLocal()) { try { // 远程设计获取全部设计成员的权限列表 - DesignAuthority[] userAuthorities = WorkContext.getCurrent().get(AuthorityOperator.class).getUserAuthorities(); - DesignAuthority[] customAuthorities = WorkContext.getCurrent().get(AuthorityOperator.class).getCustomRoleAuthorities(); - if (userAuthorities != null && userAuthorities.length != 0) { - managerPane.populateByUser(userAuthorities); - } - if (customAuthorities != null && customAuthorities.length != 0) { - managerPane.populateByCustom(customAuthorities); + DesignAuthority[] authorities = WorkContext.getCurrent().get(AuthorityOperator.class).getAuthorities(); + List userAuthorities = new ArrayList(); + List customAuthorities = new ArrayList(); + if (authorities != null) { + for (DesignAuthority authority : authorities) { + if (authority.getRoleType() == RoleType.CUSTOM) { + customAuthorities.add(authority); + } + else { + userAuthorities.add(authority); + } + } + if (userAuthorities.size() != 0) { + managerPane.populateByUser(userAuthorities.toArray(new DesignAuthority[userAuthorities.size()])); + } + if (customAuthorities.size() != 0) { + managerPane.populateByCustom(customAuthorities.toArray(new DesignAuthority[customAuthorities.size()])); + } } } catch (Exception exception) { FineLoggerFactory.getLogger().error(exception.getMessage(), exception); From 043a59e6d6f39bb96a5dc585ebb9f3232a20abfa Mon Sep 17 00:00:00 2001 From: Bryant Date: Mon, 4 Nov 2019 14:54:43 +0800 Subject: [PATCH 84/95] =?UTF-8?q?REPORT-23486=20=E4=BF=AE=E5=A4=8Dbug?= =?UTF-8?q?=E4=BB=A5=E5=8F=8A=E6=9B=B4=E6=94=B9=E6=96=87=E4=BB=B6=E5=A4=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/update/ui/dialog/RestoreResultDialog.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/update/ui/dialog/RestoreResultDialog.java b/designer-base/src/main/java/com/fr/design/update/ui/dialog/RestoreResultDialog.java index d94a93c711..7522041ff0 100644 --- a/designer-base/src/main/java/com/fr/design/update/ui/dialog/RestoreResultDialog.java +++ b/designer-base/src/main/java/com/fr/design/update/ui/dialog/RestoreResultDialog.java @@ -219,7 +219,7 @@ public class RestoreResultDialog extends JDialog { files = installEnv.listFiles(); if (files != null) { for (File file : files) { - if (file.getName().startsWith(UpdateConstants.FINE) || file.getName().equals(UpdateConstants.ASPECTJRT)) { + if (file.getName().startsWith(UpdateConstants.FINE) || file.getName().contains(UpdateConstants.ASPECTJRT)) { list.add(StableUtils.pathJoin(installHome, ProjectConstants.LIB_NAME, file.getName())); } } From 8541021b9dd40d23a3ba0941ec14b78ed431a08d Mon Sep 17 00:00:00 2001 From: pengda Date: Mon, 4 Nov 2019 17:37:23 +0800 Subject: [PATCH 85/95] =?UTF-8?q?REPORT-19946=20Linux=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/os/impl/DemoAction.java | 2 +- .../src/main/java/com/fr/design/os/impl/RestartAction.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/os/impl/DemoAction.java b/designer-base/src/main/java/com/fr/design/os/impl/DemoAction.java index 8feb02952a..c1676a5a9c 100644 --- a/designer-base/src/main/java/com/fr/design/os/impl/DemoAction.java +++ b/designer-base/src/main/java/com/fr/design/os/impl/DemoAction.java @@ -27,7 +27,7 @@ public class DemoAction implements OSBasedAction { } else if(OperatingSystem.isWindows()){ executorPath = StableUtils.pathJoin(installHome, "bin", "designer.exe demo"); }else{ - executorPath = StableUtils.pathJoin(installHome, "bin", "designer.sh demo"); + executorPath = StableUtils.pathJoin(installHome, "bin", "designer demo"); } if (OperatingSystem.isMacos()) { diff --git a/designer-base/src/main/java/com/fr/design/os/impl/RestartAction.java b/designer-base/src/main/java/com/fr/design/os/impl/RestartAction.java index 47a7ae43bf..e31d8fcaf0 100644 --- a/designer-base/src/main/java/com/fr/design/os/impl/RestartAction.java +++ b/designer-base/src/main/java/com/fr/design/os/impl/RestartAction.java @@ -66,7 +66,7 @@ public class RestartAction implements OSBasedAction { ProcessBuilder builder = new ProcessBuilder(); List commands = new ArrayList(); //现在先写的是restart.sh - commands.add(installHome + File.separator + "bin" + File.separator + "restart.sh"); + commands.add(installHome + File.separator + "bin" + File.separator + "restart"); if (ArrayUtils.isNotEmpty(filesToBeDelete)) { commands.add(StableUtils.join(filesToBeDelete, "+")); } From 8eac5482864d14c38731b412d9abb6ce3719a5aa Mon Sep 17 00:00:00 2001 From: pengda Date: Mon, 4 Nov 2019 17:45:35 +0800 Subject: [PATCH 86/95] =?UTF-8?q?REPORT-19946=20Linux=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/os/impl/DemoAction.java | 1 - .../src/main/java/com/fr/design/os/impl/RestartAction.java | 1 - 2 files changed, 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/os/impl/DemoAction.java b/designer-base/src/main/java/com/fr/design/os/impl/DemoAction.java index c1676a5a9c..1696e6ce8a 100644 --- a/designer-base/src/main/java/com/fr/design/os/impl/DemoAction.java +++ b/designer-base/src/main/java/com/fr/design/os/impl/DemoAction.java @@ -21,7 +21,6 @@ public class DemoAction implements OSBasedAction { } String executorPath; - if (OperatingSystem.isMacos()) { executorPath = StableUtils.pathJoin(installHome, "bin", "designer.app"); } else if(OperatingSystem.isWindows()){ diff --git a/designer-base/src/main/java/com/fr/design/os/impl/RestartAction.java b/designer-base/src/main/java/com/fr/design/os/impl/RestartAction.java index e31d8fcaf0..d80fad5546 100644 --- a/designer-base/src/main/java/com/fr/design/os/impl/RestartAction.java +++ b/designer-base/src/main/java/com/fr/design/os/impl/RestartAction.java @@ -65,7 +65,6 @@ public class RestartAction implements OSBasedAction { private static void restartInLinux(String installHome, String[] filesToBeDelete) throws Exception { ProcessBuilder builder = new ProcessBuilder(); List commands = new ArrayList(); - //现在先写的是restart.sh commands.add(installHome + File.separator + "bin" + File.separator + "restart"); if (ArrayUtils.isNotEmpty(filesToBeDelete)) { commands.add(StableUtils.join(filesToBeDelete, "+")); From 882d6219d4177ff1deb0f337f321dded54156c95 Mon Sep 17 00:00:00 2001 From: neil <459208047@qq.com> Date: Wed, 6 Nov 2019 08:31:24 +0800 Subject: [PATCH 87/95] ct --- .../MultiPieIndependentVanChartInterface.java | 33 +++++++------------ 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/multilayer/MultiPieIndependentVanChartInterface.java b/designer-chart/src/main/java/com/fr/van/chart/multilayer/MultiPieIndependentVanChartInterface.java index c7a44d1b88..9b1aa395f5 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/multilayer/MultiPieIndependentVanChartInterface.java +++ b/designer-chart/src/main/java/com/fr/van/chart/multilayer/MultiPieIndependentVanChartInterface.java @@ -2,15 +2,16 @@ package com.fr.van.chart.multilayer; import com.fr.chart.chartattr.Plot; import com.fr.design.beans.BasicBeanPane; +import com.fr.design.chartx.AbstractVanSingleDataPane; +import com.fr.design.chartx.fields.diff.MultiPieCellDataFieldsPane; +import com.fr.design.chartx.fields.diff.MultiPieDataSetFieldsPane; +import com.fr.design.chartx.single.SingleDataPane; import com.fr.design.condition.ConditionAttributesPane; +import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.ChartStylePane; -import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane; -import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane; -import com.fr.van.chart.multilayer.data.MultiPiePlotReportDataContentPane; -import com.fr.van.chart.multilayer.data.MultiPiePlotTableDataContentPane; import com.fr.van.chart.multilayer.other.VanChartMultiPieConditionPane; import com.fr.van.chart.multilayer.style.VanChartMultiPieSeriesPane; import com.fr.van.chart.vanchart.AbstractIndependentVanChartUI; @@ -42,25 +43,15 @@ public class MultiPieIndependentVanChartInterface extends AbstractIndependentVan } @Override - public AbstractTableDataContentPane getTableDataSourcePane(Plot plot, ChartDataPane parent) { - return new MultiPiePlotTableDataContentPane(parent); - } - - @Override - public AbstractReportDataContentPane getReportDataSourcePane(Plot plot, ChartDataPane parent) { - return new MultiPiePlotReportDataContentPane(parent); + public ChartDataPane getChartDataPane(AttributeChangeListener listener) { + return new AbstractVanSingleDataPane(listener) { + @Override + protected SingleDataPane createSingleDataPane() { + return new SingleDataPane(new MultiPieDataSetFieldsPane(), new MultiPieCellDataFieldsPane()); + } + }; } -// @Override -// public ChartDataPane getChartDataPane(AttributeChangeListener listener) { -// return new AbstractDataPane(listener) { -// @Override -// protected SingleDataPane createSingleDataPane() { -// return new SingleDataPane(new MultiPieDataSetFieldsPane(), new MultiPieCellDataFieldsPane()); -// } -// }; -// } - public BasicBeanPane getPlotSeriesPane(ChartStylePane parent, Plot plot){ return new VanChartMultiPieSeriesPane(parent, plot); } From 936ae150d5567b8ed0c5a42fea51b8b1fe63b104 Mon Sep 17 00:00:00 2001 From: neil <459208047@qq.com> Date: Wed, 6 Nov 2019 08:31:50 +0800 Subject: [PATCH 88/95] release/10.0 --- .../com/fr/van/chart/multilayer/VanChartMultiPiePlotPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/multilayer/VanChartMultiPiePlotPane.java b/designer-chart/src/main/java/com/fr/van/chart/multilayer/VanChartMultiPiePlotPane.java index 397a118926..3ccbcf6538 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/multilayer/VanChartMultiPiePlotPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/multilayer/VanChartMultiPiePlotPane.java @@ -10,7 +10,7 @@ import com.fr.plugin.chart.vanchart.VanChart; import com.fr.van.chart.designer.type.AbstractVanChartTypePane; /** - * Created by Fangjie on 2016/6/15. + * Created by Fangjie on 2016/6/15. */ public class VanChartMultiPiePlotPane extends AbstractVanChartTypePane { @Override From 5709374b34a6890a56bbb9dabf30672533bfe356 Mon Sep 17 00:00:00 2001 From: neil <459208047@qq.com> Date: Wed, 6 Nov 2019 08:32:24 +0800 Subject: [PATCH 89/95] . --- .../com/fr/van/chart/multilayer/VanChartMultiPiePlotPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/multilayer/VanChartMultiPiePlotPane.java b/designer-chart/src/main/java/com/fr/van/chart/multilayer/VanChartMultiPiePlotPane.java index 3ccbcf6538..397a118926 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/multilayer/VanChartMultiPiePlotPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/multilayer/VanChartMultiPiePlotPane.java @@ -10,7 +10,7 @@ import com.fr.plugin.chart.vanchart.VanChart; import com.fr.van.chart.designer.type.AbstractVanChartTypePane; /** - * Created by Fangjie on 2016/6/15. + * Created by Fangjie on 2016/6/15. */ public class VanChartMultiPiePlotPane extends AbstractVanChartTypePane { @Override From 3c0e846d7f64572d13eb1939baabef32ccc06f6d Mon Sep 17 00:00:00 2001 From: neil <459208047@qq.com> Date: Wed, 6 Nov 2019 08:33:21 +0800 Subject: [PATCH 90/95] ct --- .../java/com/fr/design/RestartHelper.java | 32 +++++++------------ 1 file changed, 11 insertions(+), 21 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/RestartHelper.java b/designer-base/src/main/java/com/fr/design/RestartHelper.java index cdb4fc532e..5720629e79 100644 --- a/designer-base/src/main/java/com/fr/design/RestartHelper.java +++ b/designer-base/src/main/java/com/fr/design/RestartHelper.java @@ -1,7 +1,7 @@ package com.fr.design; -import com.fr.design.mainframe.DesignerContext; import com.fr.design.os.impl.RestartAction; +import com.fr.design.mainframe.DesignerContext; import com.fr.general.ComparatorUtils; import com.fr.general.GeneralUtils; import com.fr.log.FineLoggerFactory; @@ -9,9 +9,7 @@ import com.fr.stable.ArrayUtils; import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; import com.fr.stable.os.support.OSBasedAction; -import com.fr.workspace.WorkContext; - -import javax.swing.*; +import com.fr.stable.os.support.OSSupportCenter; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; @@ -31,8 +29,7 @@ public class RestartHelper { public static final String RECORD_FILE = StableUtils.pathJoin(StableUtils.getInstallHome(), "delete.properties"); public static final String MOVE_FILE = StableUtils.pathJoin(StableUtils.getInstallHome(), "move.properties"); - private static final OSBasedAction restartAction = new RestartAction(); - + private static OSBasedAction restartAction; /** * 把要删除的文件都记录到delete.properties中 * @@ -144,20 +141,6 @@ public class RestartHelper { restart(ArrayUtils.EMPTY_STRING_ARRAY); } - public static void restartForUpdate(JFrame frame) { - try { - restartAction.execute(ArrayUtils.EMPTY_STRING_ARRAY); - } catch (Exception e) { - FineLoggerFactory.getLogger().error(e.getMessage()); - } finally { - WorkContext.getCurrent().close(); - frame.dispose(); - System.exit(0); - } - } - - - /** * 重启设计器并删除某些特定的文件 * @@ -186,7 +169,7 @@ public class RestartHelper { restartAction.execute(filesToBeDelete); } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); - } finally { + }finally { try { if (null != randomAccessFile) { randomAccessFile.close(); @@ -196,5 +179,12 @@ public class RestartHelper { } DesignerContext.getDesignerFrame().exit(); } + + } + /** + * 提前初始化重启动作 + */ + public static void initRestartAction(){ + restartAction = OSSupportCenter.getAction(RestartAction.class); } } \ No newline at end of file From b3e41463d674898b72bb89b7a6ec2990ba609547 Mon Sep 17 00:00:00 2001 From: neil <459208047@qq.com> Date: Wed, 6 Nov 2019 08:34:16 +0800 Subject: [PATCH 91/95] ct --- .../update/actions/RecoverForDesigner.java | 65 ++++++------------- 1 file changed, 21 insertions(+), 44 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/update/actions/RecoverForDesigner.java b/designer-base/src/main/java/com/fr/design/update/actions/RecoverForDesigner.java index eb25ccea30..d4f878f5f9 100644 --- a/designer-base/src/main/java/com/fr/design/update/actions/RecoverForDesigner.java +++ b/designer-base/src/main/java/com/fr/design/update/actions/RecoverForDesigner.java @@ -3,14 +3,14 @@ package com.fr.design.update.actions; import com.fr.decision.update.backup.Recover; import com.fr.decision.update.data.UpdateConstants; import com.fr.decision.update.exception.UpdateException; -import com.fr.design.mainframe.DesignerContext; import com.fr.general.CommonIOUtils; import com.fr.general.GeneralUtils; +import com.fr.general.IOUtils; import com.fr.log.FineLoggerFactory; import com.fr.stable.CommonUtils; -import com.fr.stable.ProjectLibrary; import com.fr.stable.StableUtils; import com.fr.stable.project.ProjectConstants; +import com.fr.workspace.WorkContext; import java.io.File; import java.io.IOException; @@ -22,82 +22,59 @@ import java.io.IOException; */ public class RecoverForDesigner implements Recover { - private final String installHome = StableUtils.getInstallHome(); - @Override public boolean recover() { try{ - CommonIOUtils.copyFilesInDirByPath(StableUtils.pathJoin(installHome, ProjectConstants.LOGS_NAME, - UpdateConstants.INSTALL_LIB, UpdateConstants.DESIGNERBACKUPPATH), + CommonIOUtils.copyFilesInDirByPath(StableUtils.pathJoin(StableUtils.getInstallHome(), UpdateConstants.DESIGNERBACKUPPATH), StableUtils.pathJoin(StableUtils.getInstallHome(), ProjectConstants.LIB_NAME)); return true; } catch (IOException e) { - FineLoggerFactory.getLogger().error("Recover error for designer", e); + FineLoggerFactory.getLogger().error(e.getMessage() + "Recover error for designer"); return false; } } @Override public boolean backup() { + String installHome = StableUtils.getInstallHome(); //jar包备份文件的目录为"backup/"+jar包当前版本号 String todayBackupDir = StableUtils.pathJoin(installHome, UpdateConstants.DESIGNER_BACKUP_DIR, (GeneralUtils.readBuildNO())); - String envHome = ProjectLibrary.getInstance().getLibHome(); - backupFilesFromInstallEnv(envHome, todayBackupDir); + backupFilesFromInstallEnv(todayBackupDir); backupFilesFromInstallLib(installHome, todayBackupDir); try { - String installBackup = StableUtils.pathJoin(installHome, ProjectConstants.LOGS_NAME, - UpdateConstants.INSTALL_LIB); - File installLib = new File(installBackup); - CommonUtils.mkdirs(installLib); - File download = new File(StableUtils.pathJoin(installBackup,UpdateConstants.DOWNLOADPATH)); - CommonUtils.mkdirs(download); - CommonIOUtils.copyFilesInDirByPath(StableUtils.pathJoin(installHome,ProjectConstants.LIB_NAME), - StableUtils.pathJoin(installBackup,UpdateConstants.DESIGNERBACKUPPATH)); - DesignerContext.getDesignerFrame().prepareForExit(); + File file = new File(StableUtils.pathJoin(installHome, UpdateConstants.DOWNLOADPATH)); + CommonUtils.mkdirs(file); + IOUtils.copyFilesInDirByPath(StableUtils.pathJoin(installHome,ProjectConstants.LIB_NAME), + StableUtils.pathJoin(installHome, UpdateConstants.DESIGNERBACKUPPATH)); return true; - } catch (IOException e) { + }catch (IOException e) { UpdateException exception = new UpdateException("Backup Exception for designer" + e.getMessage()); FineLoggerFactory.getLogger().error(exception.getMessage(),exception); return false; } } - private void backupFilesFromInstallEnv(String envHome, String todayBackupDir) { + private void backupFilesFromInstallEnv(String todayBackupDir) { try { - File file = new File(StableUtils.pathJoin(todayBackupDir,UpdateConstants.BACKUPPATH)); - CommonUtils.mkdirs(file); - file = new File(StableUtils.pathJoin(envHome,ProjectConstants.LIB_NAME)); - File[] files = file.listFiles(); - File dir = new File(StableUtils.pathJoin(todayBackupDir,UpdateConstants.BACKUPPATH)); - if (files != null) { - for (File file1 : files) { - if (file1.getName().startsWith(UpdateConstants.FINE) && file1.getName().endsWith(UpdateConstants.JAR_FILE_SUFFIX)) { - CommonIOUtils.copy(file1, dir); - } - } - } + CommonUtils.mkdirs(new File(StableUtils.pathJoin(todayBackupDir,UpdateConstants.BACKUPPATH))); + IOUtils.copyFilesInDirByPath( + StableUtils.pathJoin(WorkContext.getCurrent().getPath(),ProjectConstants.LIB_NAME), + StableUtils.pathJoin(todayBackupDir,UpdateConstants.BACKUPPATH)); } catch (IOException e) { UpdateException exception = new UpdateException(e.getMessage()); - FineLoggerFactory.getLogger().error(exception.getMessage() , "backup for Designer recover in env failed"); + FineLoggerFactory.getLogger().error(exception.getMessage() + "backup for Designer recover in env failed"); } } private void backupFilesFromInstallLib(String installHome, String todayBackupDir) { try { CommonUtils.mkdirs(new File(StableUtils.pathJoin(todayBackupDir,UpdateConstants.DESIGNERBACKUPPATH))); - File lib = new File(StableUtils.pathJoin(installHome,ProjectConstants.LIB_NAME)); - File[] files = lib.listFiles(); - File dir = new File(StableUtils.pathJoin(todayBackupDir,UpdateConstants.DESIGNERBACKUPPATH)); - if (files != null) { - for (File file : files) { - if (file.getName().startsWith(UpdateConstants.FINE) || file.getName().contains(UpdateConstants.ASPECTJRT)) { - CommonIOUtils.copy(file, dir); - } - } - } + IOUtils.copyFilesInDirByPath( + StableUtils.pathJoin(installHome,ProjectConstants.LIB_NAME), + StableUtils.pathJoin(todayBackupDir,UpdateConstants.DESIGNERBACKUPPATH)); } catch (IOException e) { UpdateException exception = new UpdateException(e.getMessage()); - FineLoggerFactory.getLogger().error(exception.getMessage() , "backup for Designer recover in install failed"); + FineLoggerFactory.getLogger().error(exception.getMessage() + "backup for Designer recover in install failed"); } } } From ec7b6606ddf97181fb85d0192cfe802d956369c1 Mon Sep 17 00:00:00 2001 From: neil <459208047@qq.com> Date: Wed, 6 Nov 2019 08:34:49 +0800 Subject: [PATCH 92/95] ct --- .../design/actions/file/PreferencePane.java | 138 +++++++++++------- 1 file changed, 82 insertions(+), 56 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java index 4a1c208c91..4c2bd04404 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java @@ -1,7 +1,6 @@ package com.fr.design.actions.file; import com.fr.cluster.ClusterBridge; -import com.fr.cluster.engine.base.FineClusterConfig; import com.fr.config.Configuration; import com.fr.config.ServerPreferenceConfig; import com.fr.design.DesignerEnvManager; @@ -47,10 +46,36 @@ import com.fr.workspace.WorkContext; import com.fr.workspace.server.vcs.VcsOperator; import com.fr.workspace.server.vcs.git.config.GcConfig; -import javax.swing.*; -import javax.swing.event.*; -import java.awt.*; -import java.awt.event.*; +import javax.swing.BorderFactory; +import javax.swing.BoxLayout; +import javax.swing.JDialog; +import javax.swing.JFileChooser; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JProgressBar; +import javax.swing.KeyStroke; +import javax.swing.SwingUtilities; +import javax.swing.SwingWorker; +import javax.swing.Timer; +import javax.swing.UIManager; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Component; +import java.awt.Dialog; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.Window; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; import java.io.File; import java.text.DecimalFormat; import java.util.Locale; @@ -62,7 +87,7 @@ import static com.fr.design.i18n.Toolkit.i18nText; /** * 选项对话框 * - * @editor zhou + * @author zhou * @since 2012-3-28下午3:39:48 */ public class PreferencePane extends BasicPane { @@ -134,6 +159,7 @@ public class PreferencePane extends BasicPane { private IntegerEditor portEditor; private UICheckBox oracleSpace; private UISpinner cachingTemplateSpinner; + private UICheckBox openDebugComboBox; private UICheckBox useOptimizedUPMCheckbox; private UICheckBox useUniverseDBMCheckbox; private UICheckBox joinProductImproveCheckBox; @@ -144,10 +170,12 @@ public class PreferencePane extends BasicPane { private UICheckBox saveCommitCheckBox; private UICheckBox useIntervalCheckBox; private IntegerEditor saveIntervalEditor; + private UICheckBox gcEnableCheckBox; private UIButton gcButton; private UILabel remindVcsLabel; + private JDialog gcDialog; private UILabel gcMessage = new UILabel(); private JPanel gcDialogDownPane = new JPanel(); @@ -194,6 +222,12 @@ public class PreferencePane extends BasicPane { oracleSpace = new UICheckBox(i18nText("Fine-Design_Basic_Show_All_Oracle_Tables")); oraclePane.add(oracleSpace); + + JPanel debuggerPane = FRGUIPaneFactory.createTitledBorderPane(i18nText("Fine-Design_Basic_Develop_Tools")); + openDebugComboBox = new UICheckBox(i18nText("Fine-Design_Basic_Open_Debug_Window")); + debuggerPane.add(openDebugComboBox, BorderLayout.CENTER); + advancePane.add(debuggerPane); + JPanel upmSelectorPane = FRGUIPaneFactory.createTitledBorderPane(i18nText("Fine-Design_Basic_Update_Plugin_Manager")); useOptimizedUPMCheckbox = new UICheckBox(i18nText("Fine-Design_Basic_Use_New_Update_Plugin_Manager")); upmSelectorPane.add(useOptimizedUPMCheckbox); @@ -208,16 +242,12 @@ public class PreferencePane extends BasicPane { joinProductImproveCheckBox = new UICheckBox(i18nText("Fine-Design_Basic_Join_Product_Improve")); improvePane.add(joinProductImproveCheckBox); - if(SupportOSImpl.AUTOPUSHUPDATE.support()){ + if (SupportOSImpl.AUTOPUSHUPDATE.support()) { autoPushUpdateCheckBox = new UICheckBox(i18nText("Fine-Design_Automatic_Push_Update")); + + improvePane.add(autoPushUpdateCheckBox); } - /* - if (DesignerPushUpdateManager.getInstance().isAutoPushUpdateSupported()) { - autoPushUpdateCheckBox = new UICheckBox(i18nText("Fine-Design_Automatic_Push_Update")); - improvePane.add(autoPushUpdateCheckBox); - }*/ - JPanel spaceUpPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); spaceUpPane.add(oraclePane, BorderLayout.NORTH); spaceUpPane.add(createMemoryPane(), BorderLayout.CENTER); @@ -234,7 +264,9 @@ public class PreferencePane extends BasicPane { private void createVcsSettingPane(JPanel generalPane) { JPanel vcsPane = FRGUIPaneFactory.createVerticalTitledBorderPane(i18nText("Fine-Design_Vcs_Title")); generalPane.add(vcsPane); + remindVcsLabel = new UILabel(i18nText("Fine-Design_Vcs_Remind")); + remindVcsLabel.setVisible(!VcsHelper.getInstance().needInit()); vcsEnableCheckBox = new UICheckBox(i18nText("Fine-Design_Vcs_SaveAuto")); saveCommitCheckBox = new UICheckBox(i18nText("Fine-Design_Vcs_No_Delete")); @@ -258,7 +290,7 @@ public class PreferencePane extends BasicPane { @Override public void stateChanged(ChangeEvent e) { boolean selected = vcsEnableCheckBox.isSelected(); - if (selected && vcsEnableCheckBox.isEnabled()) { + if (selected) { saveCommitCheckBox.setEnabled(true); saveIntervalEditor.setEnabled(true); useIntervalCheckBox.setEnabled(true); @@ -302,9 +334,14 @@ public class PreferencePane extends BasicPane { gcEnableCheckBox.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { - gcButton.setEnabled(gcEnableCheckBox.isSelected() && gcEnableCheckBox.isEnabled()); + gcButton.setEnabled(gcEnableCheckBox.isSelected()); } }); + //集群下禁用 + if (ClusterBridge.isClusterMode()) { + gcEnableCheckBox.setEnabled(false); + gcButton.setEnabled(false); + } return gcControlPane; } @@ -486,23 +523,8 @@ public class PreferencePane extends BasicPane { JPanel logLevelPane = FRGUIPaneFactory.createTitledBorderPane("log" + i18nText("Fine-Design_Basic_Level_Setting")); logPane.add(logLevelPane); logLevelComboBox = new UIComboBox(LOG); + logLevelComboBox.setEnabled(WorkContext.getCurrent().isLocal()); logLevelPane.add(logLevelComboBox); - logLevelComboBox.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - Configurations.update(new Worker() { - @Override - public void run() { - Log4jConfig.getInstance().setRootLevel((Level) logLevelComboBox.getSelectedItem()); - } - - @Override - public Class[] targets() { - return new Class[]{Log4jConfig.class}; - } - }); - } - }); } private void createLanPane(JPanel generalPane) { @@ -530,8 +552,8 @@ public class PreferencePane extends BasicPane { }); UILabel noticeLabel = new UILabel(i18nText("Fine-Design_Basic_Work_After_Restart_Designer"));//sail:提示重启后生效 double p = TableLayout.PREFERRED; - double rowSize[] = {p}; - double columnSize[] = {p, p, p}; + double[] rowSize = {p}; + double[] columnSize = {p, p, p}; Component[][] components = { {languageLabel, languageComboBox, noticeLabel}, }; @@ -571,7 +593,7 @@ public class PreferencePane extends BasicPane { private void createLengthPane(JPanel advancePane) { double p = TableLayout.PREFERRED; - double rowSize[] = {p}; + double[] rowSize = {p}; // 长度单位选择 JPanel lengthPane = FRGUIPaneFactory.createTitledBorderPane(i18nText("Fine-Design_Basic_Setting_Ruler_Units")); @@ -593,8 +615,8 @@ public class PreferencePane extends BasicPane { private void createServerPane(JPanel advancePane) { double p = TableLayout.PREFERRED; - double rowSize[] = {p}; - double columnSize[] = {p, p, p}; + double[] rowSize = {p}; + double[] columnSize = {p, p, p}; JPanel serverPortPane = FRGUIPaneFactory.createTitledBorderPane(i18nText("Fine-Design_Basic_Web_Preview_Port_Setting")); advancePane.add(serverPortPane); @@ -633,7 +655,7 @@ public class PreferencePane extends BasicPane { /** * The method of populate. * - * @param designerEnvManager + * @param designerEnvManager 设计器环境管理器 */ public void populate(DesignerEnvManager designerEnvManager) { if (designerEnvManager == null) { @@ -662,11 +684,6 @@ public class PreferencePane extends BasicPane { defaultStringToFormulaBox.setSelected(false); } VcsConfigManager vcsConfigManager = designerEnvManager.getVcsConfigManager(); - if (FineClusterConfig.getInstance().isCluster()) { - vcsEnableCheckBox.setEnabled(false); - gcEnableCheckBox.setEnabled(false); - } - if (VcsHelper.getInstance().needInit()) { vcsEnableCheckBox.setSelected(vcsConfigManager.isVcsEnable()); } else { @@ -700,8 +717,9 @@ public class PreferencePane extends BasicPane { this.pageLengthComboBox.setSelectedIndex(designerEnvManager.getPageLengthUnit()); this.reportLengthComboBox.setSelectedIndex(designerEnvManager.getReportLengthUnit()); - this.portEditor.setValue(new Integer(designerEnvManager.getEmbedServerPort())); + this.portEditor.setValue(designerEnvManager.getEmbedServerPort()); + openDebugComboBox.setSelected(designerEnvManager.isOpenDebug()); useOptimizedUPMCheckbox.setSelected(ServerPreferenceConfig.getInstance().isUseOptimizedUPM()); useUniverseDBMCheckbox.setSelected(ServerPreferenceConfig.getInstance().isUseUniverseDBM()); @@ -769,7 +787,9 @@ public class PreferencePane extends BasicPane { designerEnvManager.setPageLengthUnit((short) pageLengthComboBox.getSelectedIndex()); designerEnvManager.setReportLengthUnit((short) reportLengthComboBox.getSelectedIndex()); - designerEnvManager.setJettyServerPort(portEditor.getValue().intValue()); + designerEnvManager.setJettyServerPort(portEditor.getValue()); + + designerEnvManager.setOpenDebug(openDebugComboBox.isSelected()); designerEnvManager.setOracleSystemSpace(this.oracleSpace.isSelected()); designerEnvManager.setCachingTemplateLimit((int) this.cachingTemplateSpinner.getValue()); @@ -801,17 +821,24 @@ public class PreferencePane extends BasicPane { designerEnvManager.setUndoLimit(MAX_UNDO_LIMIT_50); } - Configurations.update(new Worker() { - @Override - public void run() { - Log4jConfig.getInstance().setRootLevel(((Level) logLevelComboBox.getSelectedItem())); - } + if (WorkContext.getCurrent().isLocal()) { + Configurations.update(new Worker() { + @Override + public void run() { + Level level = (Level) logLevelComboBox.getSelectedItem(); + if (level != null) { + Log4jConfig.getInstance().setRootLevel(level); + } + } - @Override - public Class[] targets() { - return new Class[]{Log4jConfig.class}; - } - }); + @Override + public Class[] targets() { + @SuppressWarnings("unchecked") + Class[] classes = new Class[]{Log4jConfig.class}; + return classes; + } + }); + } Configurations.update(new Worker() { @Override @@ -883,7 +910,7 @@ public class PreferencePane extends BasicPane { } catch (InterruptedException e) { FineLoggerFactory.getLogger().error(e, e.getMessage()); } - updateGcDialogPanelInfo(size <= 0 ? i18nText("Fine-Design_Vcs_No_Optimizable_File") : i18nText("Fine-Design_Vcs_Reduce_File_Size") + fileSizeConvert(size)); + updateGcDialogPanelInfo(i18nText("Fine-Design_Vcs_Reduce_File_Size") + fileSizeConvert(size)); gcDialogDownPane.revalidate(); gcDialogDownPane.repaint(); gcDialogDownPane.add(gcOkButton); @@ -1062,4 +1089,3 @@ public class PreferencePane extends BasicPane { } } - From 911d8be9df939cff0eba74b7c4fc5aa684d273c8 Mon Sep 17 00:00:00 2001 From: neil <459208047@qq.com> Date: Wed, 6 Nov 2019 08:35:50 +0800 Subject: [PATCH 93/95] . --- .../design/actions/file/PreferencePane.java | 138 +++++++----------- 1 file changed, 56 insertions(+), 82 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java index 4c2bd04404..4a1c208c91 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java @@ -1,6 +1,7 @@ package com.fr.design.actions.file; import com.fr.cluster.ClusterBridge; +import com.fr.cluster.engine.base.FineClusterConfig; import com.fr.config.Configuration; import com.fr.config.ServerPreferenceConfig; import com.fr.design.DesignerEnvManager; @@ -46,36 +47,10 @@ import com.fr.workspace.WorkContext; import com.fr.workspace.server.vcs.VcsOperator; import com.fr.workspace.server.vcs.git.config.GcConfig; -import javax.swing.BorderFactory; -import javax.swing.BoxLayout; -import javax.swing.JDialog; -import javax.swing.JFileChooser; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.JProgressBar; -import javax.swing.KeyStroke; -import javax.swing.SwingUtilities; -import javax.swing.SwingWorker; -import javax.swing.Timer; -import javax.swing.UIManager; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Component; -import java.awt.Dialog; -import java.awt.Dimension; -import java.awt.FlowLayout; -import java.awt.Font; -import java.awt.Window; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.KeyAdapter; -import java.awt.event.KeyEvent; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; +import javax.swing.*; +import javax.swing.event.*; +import java.awt.*; +import java.awt.event.*; import java.io.File; import java.text.DecimalFormat; import java.util.Locale; @@ -87,7 +62,7 @@ import static com.fr.design.i18n.Toolkit.i18nText; /** * 选项对话框 * - * @author zhou + * @editor zhou * @since 2012-3-28下午3:39:48 */ public class PreferencePane extends BasicPane { @@ -159,7 +134,6 @@ public class PreferencePane extends BasicPane { private IntegerEditor portEditor; private UICheckBox oracleSpace; private UISpinner cachingTemplateSpinner; - private UICheckBox openDebugComboBox; private UICheckBox useOptimizedUPMCheckbox; private UICheckBox useUniverseDBMCheckbox; private UICheckBox joinProductImproveCheckBox; @@ -170,12 +144,10 @@ public class PreferencePane extends BasicPane { private UICheckBox saveCommitCheckBox; private UICheckBox useIntervalCheckBox; private IntegerEditor saveIntervalEditor; - private UICheckBox gcEnableCheckBox; private UIButton gcButton; private UILabel remindVcsLabel; - private JDialog gcDialog; private UILabel gcMessage = new UILabel(); private JPanel gcDialogDownPane = new JPanel(); @@ -222,12 +194,6 @@ public class PreferencePane extends BasicPane { oracleSpace = new UICheckBox(i18nText("Fine-Design_Basic_Show_All_Oracle_Tables")); oraclePane.add(oracleSpace); - - JPanel debuggerPane = FRGUIPaneFactory.createTitledBorderPane(i18nText("Fine-Design_Basic_Develop_Tools")); - openDebugComboBox = new UICheckBox(i18nText("Fine-Design_Basic_Open_Debug_Window")); - debuggerPane.add(openDebugComboBox, BorderLayout.CENTER); - advancePane.add(debuggerPane); - JPanel upmSelectorPane = FRGUIPaneFactory.createTitledBorderPane(i18nText("Fine-Design_Basic_Update_Plugin_Manager")); useOptimizedUPMCheckbox = new UICheckBox(i18nText("Fine-Design_Basic_Use_New_Update_Plugin_Manager")); upmSelectorPane.add(useOptimizedUPMCheckbox); @@ -242,12 +208,16 @@ public class PreferencePane extends BasicPane { joinProductImproveCheckBox = new UICheckBox(i18nText("Fine-Design_Basic_Join_Product_Improve")); improvePane.add(joinProductImproveCheckBox); - if (SupportOSImpl.AUTOPUSHUPDATE.support()) { + if(SupportOSImpl.AUTOPUSHUPDATE.support()){ autoPushUpdateCheckBox = new UICheckBox(i18nText("Fine-Design_Automatic_Push_Update")); - - improvePane.add(autoPushUpdateCheckBox); } + /* + if (DesignerPushUpdateManager.getInstance().isAutoPushUpdateSupported()) { + autoPushUpdateCheckBox = new UICheckBox(i18nText("Fine-Design_Automatic_Push_Update")); + improvePane.add(autoPushUpdateCheckBox); + }*/ + JPanel spaceUpPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); spaceUpPane.add(oraclePane, BorderLayout.NORTH); spaceUpPane.add(createMemoryPane(), BorderLayout.CENTER); @@ -264,9 +234,7 @@ public class PreferencePane extends BasicPane { private void createVcsSettingPane(JPanel generalPane) { JPanel vcsPane = FRGUIPaneFactory.createVerticalTitledBorderPane(i18nText("Fine-Design_Vcs_Title")); generalPane.add(vcsPane); - remindVcsLabel = new UILabel(i18nText("Fine-Design_Vcs_Remind")); - remindVcsLabel.setVisible(!VcsHelper.getInstance().needInit()); vcsEnableCheckBox = new UICheckBox(i18nText("Fine-Design_Vcs_SaveAuto")); saveCommitCheckBox = new UICheckBox(i18nText("Fine-Design_Vcs_No_Delete")); @@ -290,7 +258,7 @@ public class PreferencePane extends BasicPane { @Override public void stateChanged(ChangeEvent e) { boolean selected = vcsEnableCheckBox.isSelected(); - if (selected) { + if (selected && vcsEnableCheckBox.isEnabled()) { saveCommitCheckBox.setEnabled(true); saveIntervalEditor.setEnabled(true); useIntervalCheckBox.setEnabled(true); @@ -334,14 +302,9 @@ public class PreferencePane extends BasicPane { gcEnableCheckBox.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { - gcButton.setEnabled(gcEnableCheckBox.isSelected()); + gcButton.setEnabled(gcEnableCheckBox.isSelected() && gcEnableCheckBox.isEnabled()); } }); - //集群下禁用 - if (ClusterBridge.isClusterMode()) { - gcEnableCheckBox.setEnabled(false); - gcButton.setEnabled(false); - } return gcControlPane; } @@ -523,8 +486,23 @@ public class PreferencePane extends BasicPane { JPanel logLevelPane = FRGUIPaneFactory.createTitledBorderPane("log" + i18nText("Fine-Design_Basic_Level_Setting")); logPane.add(logLevelPane); logLevelComboBox = new UIComboBox(LOG); - logLevelComboBox.setEnabled(WorkContext.getCurrent().isLocal()); logLevelPane.add(logLevelComboBox); + logLevelComboBox.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + Configurations.update(new Worker() { + @Override + public void run() { + Log4jConfig.getInstance().setRootLevel((Level) logLevelComboBox.getSelectedItem()); + } + + @Override + public Class[] targets() { + return new Class[]{Log4jConfig.class}; + } + }); + } + }); } private void createLanPane(JPanel generalPane) { @@ -552,8 +530,8 @@ public class PreferencePane extends BasicPane { }); UILabel noticeLabel = new UILabel(i18nText("Fine-Design_Basic_Work_After_Restart_Designer"));//sail:提示重启后生效 double p = TableLayout.PREFERRED; - double[] rowSize = {p}; - double[] columnSize = {p, p, p}; + double rowSize[] = {p}; + double columnSize[] = {p, p, p}; Component[][] components = { {languageLabel, languageComboBox, noticeLabel}, }; @@ -593,7 +571,7 @@ public class PreferencePane extends BasicPane { private void createLengthPane(JPanel advancePane) { double p = TableLayout.PREFERRED; - double[] rowSize = {p}; + double rowSize[] = {p}; // 长度单位选择 JPanel lengthPane = FRGUIPaneFactory.createTitledBorderPane(i18nText("Fine-Design_Basic_Setting_Ruler_Units")); @@ -615,8 +593,8 @@ public class PreferencePane extends BasicPane { private void createServerPane(JPanel advancePane) { double p = TableLayout.PREFERRED; - double[] rowSize = {p}; - double[] columnSize = {p, p, p}; + double rowSize[] = {p}; + double columnSize[] = {p, p, p}; JPanel serverPortPane = FRGUIPaneFactory.createTitledBorderPane(i18nText("Fine-Design_Basic_Web_Preview_Port_Setting")); advancePane.add(serverPortPane); @@ -655,7 +633,7 @@ public class PreferencePane extends BasicPane { /** * The method of populate. * - * @param designerEnvManager 设计器环境管理器 + * @param designerEnvManager */ public void populate(DesignerEnvManager designerEnvManager) { if (designerEnvManager == null) { @@ -684,6 +662,11 @@ public class PreferencePane extends BasicPane { defaultStringToFormulaBox.setSelected(false); } VcsConfigManager vcsConfigManager = designerEnvManager.getVcsConfigManager(); + if (FineClusterConfig.getInstance().isCluster()) { + vcsEnableCheckBox.setEnabled(false); + gcEnableCheckBox.setEnabled(false); + } + if (VcsHelper.getInstance().needInit()) { vcsEnableCheckBox.setSelected(vcsConfigManager.isVcsEnable()); } else { @@ -717,9 +700,8 @@ public class PreferencePane extends BasicPane { this.pageLengthComboBox.setSelectedIndex(designerEnvManager.getPageLengthUnit()); this.reportLengthComboBox.setSelectedIndex(designerEnvManager.getReportLengthUnit()); - this.portEditor.setValue(designerEnvManager.getEmbedServerPort()); + this.portEditor.setValue(new Integer(designerEnvManager.getEmbedServerPort())); - openDebugComboBox.setSelected(designerEnvManager.isOpenDebug()); useOptimizedUPMCheckbox.setSelected(ServerPreferenceConfig.getInstance().isUseOptimizedUPM()); useUniverseDBMCheckbox.setSelected(ServerPreferenceConfig.getInstance().isUseUniverseDBM()); @@ -787,9 +769,7 @@ public class PreferencePane extends BasicPane { designerEnvManager.setPageLengthUnit((short) pageLengthComboBox.getSelectedIndex()); designerEnvManager.setReportLengthUnit((short) reportLengthComboBox.getSelectedIndex()); - designerEnvManager.setJettyServerPort(portEditor.getValue()); - - designerEnvManager.setOpenDebug(openDebugComboBox.isSelected()); + designerEnvManager.setJettyServerPort(portEditor.getValue().intValue()); designerEnvManager.setOracleSystemSpace(this.oracleSpace.isSelected()); designerEnvManager.setCachingTemplateLimit((int) this.cachingTemplateSpinner.getValue()); @@ -821,24 +801,17 @@ public class PreferencePane extends BasicPane { designerEnvManager.setUndoLimit(MAX_UNDO_LIMIT_50); } - if (WorkContext.getCurrent().isLocal()) { - Configurations.update(new Worker() { - @Override - public void run() { - Level level = (Level) logLevelComboBox.getSelectedItem(); - if (level != null) { - Log4jConfig.getInstance().setRootLevel(level); - } - } + Configurations.update(new Worker() { + @Override + public void run() { + Log4jConfig.getInstance().setRootLevel(((Level) logLevelComboBox.getSelectedItem())); + } - @Override - public Class[] targets() { - @SuppressWarnings("unchecked") - Class[] classes = new Class[]{Log4jConfig.class}; - return classes; - } - }); - } + @Override + public Class[] targets() { + return new Class[]{Log4jConfig.class}; + } + }); Configurations.update(new Worker() { @Override @@ -910,7 +883,7 @@ public class PreferencePane extends BasicPane { } catch (InterruptedException e) { FineLoggerFactory.getLogger().error(e, e.getMessage()); } - updateGcDialogPanelInfo(i18nText("Fine-Design_Vcs_Reduce_File_Size") + fileSizeConvert(size)); + updateGcDialogPanelInfo(size <= 0 ? i18nText("Fine-Design_Vcs_No_Optimizable_File") : i18nText("Fine-Design_Vcs_Reduce_File_Size") + fileSizeConvert(size)); gcDialogDownPane.revalidate(); gcDialogDownPane.repaint(); gcDialogDownPane.add(gcOkButton); @@ -1089,3 +1062,4 @@ public class PreferencePane extends BasicPane { } } + From 5cdc8747898fcf90e1a36b6af4b99bbd655b5a76 Mon Sep 17 00:00:00 2001 From: neil <459208047@qq.com> Date: Wed, 6 Nov 2019 08:36:24 +0800 Subject: [PATCH 94/95] . --- .../update/actions/RecoverForDesigner.java | 65 +++++++++++++------ 1 file changed, 44 insertions(+), 21 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/update/actions/RecoverForDesigner.java b/designer-base/src/main/java/com/fr/design/update/actions/RecoverForDesigner.java index d4f878f5f9..eb25ccea30 100644 --- a/designer-base/src/main/java/com/fr/design/update/actions/RecoverForDesigner.java +++ b/designer-base/src/main/java/com/fr/design/update/actions/RecoverForDesigner.java @@ -3,14 +3,14 @@ package com.fr.design.update.actions; import com.fr.decision.update.backup.Recover; import com.fr.decision.update.data.UpdateConstants; import com.fr.decision.update.exception.UpdateException; +import com.fr.design.mainframe.DesignerContext; import com.fr.general.CommonIOUtils; import com.fr.general.GeneralUtils; -import com.fr.general.IOUtils; import com.fr.log.FineLoggerFactory; import com.fr.stable.CommonUtils; +import com.fr.stable.ProjectLibrary; import com.fr.stable.StableUtils; import com.fr.stable.project.ProjectConstants; -import com.fr.workspace.WorkContext; import java.io.File; import java.io.IOException; @@ -22,59 +22,82 @@ import java.io.IOException; */ public class RecoverForDesigner implements Recover { + private final String installHome = StableUtils.getInstallHome(); + @Override public boolean recover() { try{ - CommonIOUtils.copyFilesInDirByPath(StableUtils.pathJoin(StableUtils.getInstallHome(), UpdateConstants.DESIGNERBACKUPPATH), + CommonIOUtils.copyFilesInDirByPath(StableUtils.pathJoin(installHome, ProjectConstants.LOGS_NAME, + UpdateConstants.INSTALL_LIB, UpdateConstants.DESIGNERBACKUPPATH), StableUtils.pathJoin(StableUtils.getInstallHome(), ProjectConstants.LIB_NAME)); return true; } catch (IOException e) { - FineLoggerFactory.getLogger().error(e.getMessage() + "Recover error for designer"); + FineLoggerFactory.getLogger().error("Recover error for designer", e); return false; } } @Override public boolean backup() { - String installHome = StableUtils.getInstallHome(); //jar包备份文件的目录为"backup/"+jar包当前版本号 String todayBackupDir = StableUtils.pathJoin(installHome, UpdateConstants.DESIGNER_BACKUP_DIR, (GeneralUtils.readBuildNO())); - backupFilesFromInstallEnv(todayBackupDir); + String envHome = ProjectLibrary.getInstance().getLibHome(); + backupFilesFromInstallEnv(envHome, todayBackupDir); backupFilesFromInstallLib(installHome, todayBackupDir); try { - File file = new File(StableUtils.pathJoin(installHome, UpdateConstants.DOWNLOADPATH)); - CommonUtils.mkdirs(file); - IOUtils.copyFilesInDirByPath(StableUtils.pathJoin(installHome,ProjectConstants.LIB_NAME), - StableUtils.pathJoin(installHome, UpdateConstants.DESIGNERBACKUPPATH)); + String installBackup = StableUtils.pathJoin(installHome, ProjectConstants.LOGS_NAME, + UpdateConstants.INSTALL_LIB); + File installLib = new File(installBackup); + CommonUtils.mkdirs(installLib); + File download = new File(StableUtils.pathJoin(installBackup,UpdateConstants.DOWNLOADPATH)); + CommonUtils.mkdirs(download); + CommonIOUtils.copyFilesInDirByPath(StableUtils.pathJoin(installHome,ProjectConstants.LIB_NAME), + StableUtils.pathJoin(installBackup,UpdateConstants.DESIGNERBACKUPPATH)); + DesignerContext.getDesignerFrame().prepareForExit(); return true; - }catch (IOException e) { + } catch (IOException e) { UpdateException exception = new UpdateException("Backup Exception for designer" + e.getMessage()); FineLoggerFactory.getLogger().error(exception.getMessage(),exception); return false; } } - private void backupFilesFromInstallEnv(String todayBackupDir) { + private void backupFilesFromInstallEnv(String envHome, String todayBackupDir) { try { - CommonUtils.mkdirs(new File(StableUtils.pathJoin(todayBackupDir,UpdateConstants.BACKUPPATH))); - IOUtils.copyFilesInDirByPath( - StableUtils.pathJoin(WorkContext.getCurrent().getPath(),ProjectConstants.LIB_NAME), - StableUtils.pathJoin(todayBackupDir,UpdateConstants.BACKUPPATH)); + File file = new File(StableUtils.pathJoin(todayBackupDir,UpdateConstants.BACKUPPATH)); + CommonUtils.mkdirs(file); + file = new File(StableUtils.pathJoin(envHome,ProjectConstants.LIB_NAME)); + File[] files = file.listFiles(); + File dir = new File(StableUtils.pathJoin(todayBackupDir,UpdateConstants.BACKUPPATH)); + if (files != null) { + for (File file1 : files) { + if (file1.getName().startsWith(UpdateConstants.FINE) && file1.getName().endsWith(UpdateConstants.JAR_FILE_SUFFIX)) { + CommonIOUtils.copy(file1, dir); + } + } + } } catch (IOException e) { UpdateException exception = new UpdateException(e.getMessage()); - FineLoggerFactory.getLogger().error(exception.getMessage() + "backup for Designer recover in env failed"); + FineLoggerFactory.getLogger().error(exception.getMessage() , "backup for Designer recover in env failed"); } } private void backupFilesFromInstallLib(String installHome, String todayBackupDir) { try { CommonUtils.mkdirs(new File(StableUtils.pathJoin(todayBackupDir,UpdateConstants.DESIGNERBACKUPPATH))); - IOUtils.copyFilesInDirByPath( - StableUtils.pathJoin(installHome,ProjectConstants.LIB_NAME), - StableUtils.pathJoin(todayBackupDir,UpdateConstants.DESIGNERBACKUPPATH)); + File lib = new File(StableUtils.pathJoin(installHome,ProjectConstants.LIB_NAME)); + File[] files = lib.listFiles(); + File dir = new File(StableUtils.pathJoin(todayBackupDir,UpdateConstants.DESIGNERBACKUPPATH)); + if (files != null) { + for (File file : files) { + if (file.getName().startsWith(UpdateConstants.FINE) || file.getName().contains(UpdateConstants.ASPECTJRT)) { + CommonIOUtils.copy(file, dir); + } + } + } } catch (IOException e) { UpdateException exception = new UpdateException(e.getMessage()); - FineLoggerFactory.getLogger().error(exception.getMessage() + "backup for Designer recover in install failed"); + FineLoggerFactory.getLogger().error(exception.getMessage() , "backup for Designer recover in install failed"); } } } From 11b33b9e10a6816cff0d9c43ed24ee2a009d964e Mon Sep 17 00:00:00 2001 From: neil <459208047@qq.com> Date: Wed, 6 Nov 2019 08:36:55 +0800 Subject: [PATCH 95/95] . --- .../java/com/fr/design/RestartHelper.java | 32 ++++++++++++------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/RestartHelper.java b/designer-base/src/main/java/com/fr/design/RestartHelper.java index 5720629e79..cdb4fc532e 100644 --- a/designer-base/src/main/java/com/fr/design/RestartHelper.java +++ b/designer-base/src/main/java/com/fr/design/RestartHelper.java @@ -1,7 +1,7 @@ package com.fr.design; -import com.fr.design.os.impl.RestartAction; import com.fr.design.mainframe.DesignerContext; +import com.fr.design.os.impl.RestartAction; import com.fr.general.ComparatorUtils; import com.fr.general.GeneralUtils; import com.fr.log.FineLoggerFactory; @@ -9,7 +9,9 @@ import com.fr.stable.ArrayUtils; import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; import com.fr.stable.os.support.OSBasedAction; -import com.fr.stable.os.support.OSSupportCenter; +import com.fr.workspace.WorkContext; + +import javax.swing.*; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; @@ -29,7 +31,8 @@ public class RestartHelper { public static final String RECORD_FILE = StableUtils.pathJoin(StableUtils.getInstallHome(), "delete.properties"); public static final String MOVE_FILE = StableUtils.pathJoin(StableUtils.getInstallHome(), "move.properties"); - private static OSBasedAction restartAction; + private static final OSBasedAction restartAction = new RestartAction(); + /** * 把要删除的文件都记录到delete.properties中 * @@ -141,6 +144,20 @@ public class RestartHelper { restart(ArrayUtils.EMPTY_STRING_ARRAY); } + public static void restartForUpdate(JFrame frame) { + try { + restartAction.execute(ArrayUtils.EMPTY_STRING_ARRAY); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage()); + } finally { + WorkContext.getCurrent().close(); + frame.dispose(); + System.exit(0); + } + } + + + /** * 重启设计器并删除某些特定的文件 * @@ -169,7 +186,7 @@ public class RestartHelper { restartAction.execute(filesToBeDelete); } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); - }finally { + } finally { try { if (null != randomAccessFile) { randomAccessFile.close(); @@ -179,12 +196,5 @@ public class RestartHelper { } DesignerContext.getDesignerFrame().exit(); } - - } - /** - * 提前初始化重启动作 - */ - public static void initRestartAction(){ - restartAction = OSSupportCenter.getAction(RestartAction.class); } } \ No newline at end of file