From d00644216f17cc15d1b50eb71bcffe9a28a191a7 Mon Sep 17 00:00:00 2001 From: Hades Date: Mon, 12 Aug 2019 11:42:13 +0800 Subject: [PATCH 1/4] =?UTF-8?q?REPORT-20267=20=E9=9D=9E=E7=AE=80=E7=B9=81?= =?UTF-8?q?=E8=8B=B1=E6=97=A5=E9=9F=A9=20=E6=B5=B7=E5=A4=96=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E8=AE=BE=E8=AE=A1=E5=99=A8=E9=BB=98=E8=AE=A4=E8=AF=AD?= =?UTF-8?q?=E8=A8=80=E9=97=AE=E9=A2=98=20&&=20MOBILE-22490=20=E9=93=BE?= =?UTF-8?q?=E6=8E=A5=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/DesignerEnvManager.java | 13 ++++++++++++- .../ui/designer/mobile/ParaMobileDefinePane.java | 10 ++++------ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java index 7370d4d55..fdb4cb4f5 100644 --- a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java +++ b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java @@ -24,6 +24,7 @@ import com.fr.general.ComparatorUtils; import com.fr.general.FRLogFormatter; import com.fr.general.GeneralContext; import com.fr.general.IOUtils; +import com.fr.general.SupportLocale; import com.fr.general.locale.LocaleCenter; import com.fr.general.locale.LocaleMark; import com.fr.general.xml.GeneralXMLTools; @@ -1316,7 +1317,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { String tmpVal; if ((tmpVal = reader.getElementValue()) != null) { if (!CommonUtils.isNumber(tmpVal)) { - setLanguage(CommonUtils.stringToLocale(tmpVal)); + setLanguage(checkLocale(CommonUtils.stringToLocale(tmpVal))); } else { // 用于兼容10.0之前的版本 int value = Integer.parseInt(tmpVal); @@ -1365,6 +1366,16 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { } } + /** + * 对国际化进行校验 + * 非简繁英日韩的默认环境 设计器全部默认为英文版本 + * @param locale + * @return + */ + private Locale checkLocale(Locale locale) { + return SupportLocale.getInstance().isSupport(locale) ? locale : Locale.US; + } + private void readReportLengthUnit(XMLableReader reader) { String tmpVal; if (StringUtils.isNotBlank(tmpVal = reader.getElementValue())) { diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ParaMobileDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ParaMobileDefinePane.java index b924b5c55..cf909618c 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ParaMobileDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ParaMobileDefinePane.java @@ -19,6 +19,7 @@ import com.fr.design.mainframe.MobileWidgetListPane; import com.fr.design.mainframe.WidgetPropertyPane; import com.fr.form.ui.container.WParameterLayout; import com.fr.form.ui.container.WSortLayout; +import com.fr.general.CloudCenter; import com.fr.general.ComparatorUtils; import com.fr.general.SiteCenter; import com.fr.log.FineLoggerFactory; @@ -87,9 +88,7 @@ public class ParaMobileDefinePane extends MobileWidgetDefinePane { double[] rowSize = {p, p}; double[] columnSize = {p, f}; int[][] rowCount = {{1, 1}, {1, 1}}; - if (ExtraReportClassManager.getInstance().getArray(MobileParamStyleProvider.MARK_STRING).size() != 0) { - tipLabel = null; - } else { + if (ExtraReportClassManager.getInstance().getArray(MobileParamStyleProvider.MARK_STRING).isEmpty()) { ((WParameterLayout) (paraCreator.toData())).setProvider((MobileParamStyleProvider) ((Item) paramLocationComboBox.getItemAt(0)).getValue()); } Component[][] components = new Component[][]{ @@ -127,10 +126,9 @@ public class ParaMobileDefinePane extends MobileWidgetDefinePane { @Override public void mouseClicked(MouseEvent e) { try { - //todo 添加对应插件下载地址 - Desktop.getDesktop().browse(new URI(SiteCenter.getInstance().acquireUrlByKind("plugin.download"))); + Desktop.getDesktop().browse(new URI(CloudCenter.getInstance().acquireUrlByKind("plugin.mobile.style"))); } catch (Exception exp) { - + FineLoggerFactory.getLogger().error(exp.getMessage(), exp); } } @Override From f243ef88c77bab4bd8e586f4a3fc8d55d3d376f2 Mon Sep 17 00:00:00 2001 From: Hades Date: Mon, 12 Aug 2019 13:36:05 +0800 Subject: [PATCH 2/4] update --- .../src/main/java/com/fr/design/DesignerEnvManager.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java index fdb4cb4f5..fa705c2a8 100644 --- a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java +++ b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java @@ -187,7 +187,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { if (designerEnvManager == null) { designerEnvManager = new DesignerEnvManager(); //REPORT-15332有一个国际化调用比较早,需要在这边就设置好locale,由于后台GeneralContext默认是China - GeneralContext.setLocale(designerEnvManager.getLanguage()); + GeneralContext.setLocale(DesignerEnvManager.designerEnvManager.checkLocale(designerEnvManager.getLanguage())); try { XMLTools.readFileXML(designerEnvManager, designerEnvManager.getDesignerEnvFile()); } catch (Exception e) { @@ -1373,7 +1373,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { * @return */ private Locale checkLocale(Locale locale) { - return SupportLocale.getInstance().isSupport(locale) ? locale : Locale.US; + return Locale.US;//SupportLocale.getInstance().isSupport(locale) ? locale : Locale.US; } private void readReportLengthUnit(XMLableReader reader) { From eae894964b3c5cca7a84f9f3b8eff046a43e975a Mon Sep 17 00:00:00 2001 From: Hades Date: Mon, 12 Aug 2019 13:37:32 +0800 Subject: [PATCH 3/4] update --- .../src/main/java/com/fr/design/DesignerEnvManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java index fa705c2a8..008068ab2 100644 --- a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java +++ b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java @@ -1373,7 +1373,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { * @return */ private Locale checkLocale(Locale locale) { - return Locale.US;//SupportLocale.getInstance().isSupport(locale) ? locale : Locale.US; + return SupportLocale.getInstance().isSupport(locale) ? locale : Locale.US; } private void readReportLengthUnit(XMLableReader reader) { From 82598785f8be1a5d6f12451f767725da3d0766a8 Mon Sep 17 00:00:00 2001 From: Hades Date: Tue, 13 Aug 2019 14:53:59 +0800 Subject: [PATCH 4/4] =?UTF-8?q?REPORT-20267=20=E9=9D=9E=20=E7=AE=80?= =?UTF-8?q?=E7=B9=81=E8=8B=B1=E6=97=A5=E9=9F=A9=20=E6=B5=B7=E5=A4=96?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E8=AE=BE=E8=AE=A1=E5=99=A8=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E8=AF=AD=E8=A8=80=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/DesignerEnvManager.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java index 008068ab2..8769454d1 100644 --- a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java +++ b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java @@ -117,7 +117,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { private Color paginationLineColor = Color.black; // line color of paper private boolean supportCellEditorDef = false; private boolean isDragPermited = false; - private Locale language = Locale.getDefault(); + private Locale language = checkLocale(Locale.getDefault()); //2014-8-26默认显示全部, 因为以前的版本, 虽然是false, 实际上是显示所有表, 因此这边要兼容 private boolean useOracleSystemSpace = true; private int cachingTemplateLimit = CACHINGTEMPLATE_LIMIT; @@ -187,7 +187,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { if (designerEnvManager == null) { designerEnvManager = new DesignerEnvManager(); //REPORT-15332有一个国际化调用比较早,需要在这边就设置好locale,由于后台GeneralContext默认是China - GeneralContext.setLocale(DesignerEnvManager.designerEnvManager.checkLocale(designerEnvManager.getLanguage())); + GeneralContext.setLocale(designerEnvManager.getLanguage()); try { XMLTools.readFileXML(designerEnvManager, designerEnvManager.getDesignerEnvFile()); } catch (Exception e) {