From 5e1308a268047bbd1445c9f2e39b8bed57588271 Mon Sep 17 00:00:00 2001 From: Yyming Date: Fri, 16 Oct 2020 17:08:55 +0800 Subject: [PATCH 1/5] =?UTF-8?q?REPORT-41333=20=E3=80=90=E5=86=92=E7=83=9F?= =?UTF-8?q?=E3=80=91=E5=85=A8=E5=B1=80=E5=8F=82=E6=95=B0=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E4=B8=A4=E4=B8=AA=E5=8F=82=E6=95=B0p1p2=EF=BC=8C=E5=B0=86p2?= =?UTF-8?q?=E9=87=8D=E5=91=BD=E5=90=8D=E4=B8=BAp1=EF=BC=8C=E4=B8=8D?= =?UTF-8?q?=E4=BC=9A=E6=9C=89=E5=8F=82=E6=95=B0=E5=90=8D=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E7=9A=84=E6=8F=90=E9=86=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/parameter/ParameterArrayPane.java | 130 +++++++++--------- 1 file changed, 63 insertions(+), 67 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/parameter/ParameterArrayPane.java b/designer-base/src/main/java/com/fr/design/parameter/ParameterArrayPane.java index d3efcae4a..6014db3f3 100644 --- a/designer-base/src/main/java/com/fr/design/parameter/ParameterArrayPane.java +++ b/designer-base/src/main/java/com/fr/design/parameter/ParameterArrayPane.java @@ -7,7 +7,7 @@ import com.fr.design.gui.controlpane.JListControlPane; import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.controlpane.NameableSelfCreator; import com.fr.design.gui.controlpane.UnrepeatedNameHelper; -import com.fr.design.gui.ilist.ModNameActionListener; +import com.fr.design.i18n.Toolkit; import com.fr.general.ComparatorUtils; import com.fr.stable.Nameable; import com.fr.stable.StringUtils; @@ -18,79 +18,75 @@ import java.util.Arrays; import java.util.List; public class ParameterArrayPane extends JListControlPane { - /** - * Constructor. - */ - public ParameterArrayPane() { - super(); - this.addModNameActionListener(new ModNameActionListener() { - public void nameModed(int index, String oldName, String newName) { - populateSelectedValue(); - } + /** + * Constructor. + */ + /**/ + public ParameterArrayPane() { + super(); + this.addModNameActionListener((index, oldName, newName) -> populateSelectedValue()); + this.addEditingListener(new PropertyChangeAdapter() { + public void propertyChange() { + Parameter[] parameters = ParameterConfig.getInstance().getGlobalParameters(); + String[] allListNames = nameableList.getAllNames(); + allListNames[editingIndex] = StringUtils.EMPTY; + String tempName = getEditingName(); + if (StringUtils.isEmpty(tempName)) { + nameableList.stopEditing(); + FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(ParameterArrayPane.this), Toolkit.i18nText("Fine-Design_Basic_Empty_Parameter_Name")); + setIllegalIndex(editingIndex); + return; + } + if (!ComparatorUtils.equals(tempName, selectedName) + && isNameRepeated(new List[]{Arrays.asList(parameters), Arrays.asList(allListNames)}, tempName)) { + nameableList.stopEditing(); + FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(ParameterArrayPane.this), + Toolkit.i18nText("Fine-Design_Basic_Duplicate_Parameter_Name")); + setIllegalIndex(editingIndex); + } + } + }); + } - }); - this.addEditingListener(new PropertyChangeAdapter() { - public void propertyChange() { - Parameter[] parameters = ParameterConfig.getInstance().getGlobalParameters(); - String[] allListNames = nameableList.getAllNames(); - allListNames[nameableList.getSelectedIndex()] = StringUtils.EMPTY; - String tempName = getEditingName(); - if (StringUtils.isEmpty(tempName)) { - nameableList.stopEditing(); - FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(ParameterArrayPane.this), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Empty_Parameter_Name")); - setIllegalIndex(editingIndex); - return; - } - if (!ComparatorUtils.equals(tempName, selectedName) - && isNameRepeated(new List[]{Arrays.asList(parameters), Arrays.asList(allListNames)}, tempName)) { - nameableList.stopEditing(); - FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(ParameterArrayPane.this), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Duplicate_Parameter_Name")); - setIllegalIndex(editingIndex); - } - } - }); - } + @Override + protected String title4PopupWindow() { + return Toolkit.i18nText("Fine-Design_Basic_Engine_Schedule_Template_Parameter"); + } - @Override - protected String title4PopupWindow() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Engine_Schedule_Template_Parameter"); - } - - /** - * 创建模板参数设置组件 - * - * @return 模板参数设置组件 - */ - public NameableCreator[] createNameableCreators() { - return new NameableCreator[]{ - new NameableSelfCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Engine_Parameter_Name"), Parameter.class, ParameterPane.class) { - public Parameter createNameable(UnrepeatedNameHelper helper) { - // 返回参数设置面板. - return new Parameter(helper.createUnrepeatedName("p")); - } + /** + * 创建模板参数设置组件 + * + * @return 模板参数设置组件 + */ + public NameableCreator[] createNameableCreators() { + return new NameableCreator[]{ + new NameableSelfCreator(Toolkit.i18nText("Fine-Design_Basic_Engine_Parameter_Name"), Parameter.class, ParameterPane.class) { + public Parameter createNameable(UnrepeatedNameHelper helper) { + // 返回参数设置面板. + return new Parameter(helper.createUnrepeatedName("p")); + } - @Override - public String createTooltip() { - return null; - } - } - }; - } + @Override + public String createTooltip() { + return null; + } + } + }; + } - /** - * 更新参数 + /** + * 更新参数 * * @return 更新后的参数 - */ - public Parameter[] updateParameters() { - // Nameable[]居然不能强转成Parameter[],一定要这么写... - Nameable[] res = this.update(); - Parameter[] res_array = new Parameter[res.length]; - java.util.Arrays.asList(res).toArray(res_array); + */ + public Parameter[] updateParameters() { + // Nameable[]居然不能强转成Parameter[],一定要这么写... + Nameable[] res = this.update(); + Parameter[] res_array = new Parameter[res.length]; + java.util.Arrays.asList(res).toArray(res_array); - return res_array; - } + return res_array; + } } From e1299d33627f9bc881b2c376e9aebd944d374be6 Mon Sep 17 00:00:00 2001 From: Yyming Date: Fri, 16 Oct 2020 17:16:11 +0800 Subject: [PATCH 2/5] =?UTF-8?q?REPORT-41333=20=E3=80=90=E5=86=92=E7=83=9F?= =?UTF-8?q?=E3=80=91=E5=85=A8=E5=B1=80=E5=8F=82=E6=95=B0=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E4=B8=A4=E4=B8=AA=E5=8F=82=E6=95=B0p1p2=EF=BC=8C=E5=B0=86p2?= =?UTF-8?q?=E9=87=8D=E5=91=BD=E5=90=8D=E4=B8=BAp1=EF=BC=8C=E4=B8=8D?= =?UTF-8?q?=E4=BC=9A=E6=9C=89=E5=8F=82=E6=95=B0=E5=90=8D=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E7=9A=84=E6=8F=90=E9=86=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/parameter/ParameterArrayPane.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/parameter/ParameterArrayPane.java b/designer-base/src/main/java/com/fr/design/parameter/ParameterArrayPane.java index 6014db3f3..adb0e4847 100644 --- a/designer-base/src/main/java/com/fr/design/parameter/ParameterArrayPane.java +++ b/designer-base/src/main/java/com/fr/design/parameter/ParameterArrayPane.java @@ -21,7 +21,6 @@ public class ParameterArrayPane extends JListControlPane { /** * Constructor. */ - /**/ public ParameterArrayPane() { super(); this.addModNameActionListener((index, oldName, newName) -> populateSelectedValue()); @@ -33,7 +32,7 @@ public class ParameterArrayPane extends JListControlPane { String tempName = getEditingName(); if (StringUtils.isEmpty(tempName)) { nameableList.stopEditing(); - FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(ParameterArrayPane.this), Toolkit.i18nText("Fine-Design_Basic_Empty_Parameter_Name")); + FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(ParameterArrayPane.this), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Empty_Parameter_Name")); setIllegalIndex(editingIndex); return; } @@ -85,7 +84,7 @@ public class ParameterArrayPane extends JListControlPane { // Nameable[]居然不能强转成Parameter[],一定要这么写... Nameable[] res = this.update(); Parameter[] res_array = new Parameter[res.length]; - java.util.Arrays.asList(res).toArray(res_array); + Arrays.asList(res).toArray(res_array); return res_array; } From 949a24e96e74d111d9369d59c2918e79c4347638 Mon Sep 17 00:00:00 2001 From: Yvan Date: Mon, 19 Oct 2020 15:40:25 +0800 Subject: [PATCH 3/5] =?UTF-8?q?REPORT-41414=20&&=20REPORT-41495=20?= =?UTF-8?q?=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91REPORT-41?= =?UTF-8?q?414=E4=B8=AD=E4=B9=8B=E5=89=8D=E6=94=B9=E5=8A=A8=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E8=80=83=E8=99=91=E5=88=B0=E8=8F=9C=E5=8D=95=E6=A0=8F?= =?UTF-8?q?-=E6=A8=A1=E6=9D=BF-=E6=A8=A1=E6=9D=BF=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9B=86=E7=95=8C=E9=9D=A2=E4=B8=AD=E4=B9=9F=E4=BC=9A=E5=8C=85?= =?UTF-8?q?=E6=8B=ACMaxMemRowCountPanel=EF=BC=8C=E7=84=B6=E8=80=8C?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E6=95=B0=E6=8D=AE=E9=9B=86=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E4=B8=AD=E7=BB=99MaxMemRowCountPanel=E7=9A=84=E7=A9=BA?= =?UTF-8?q?=E9=97=B4=E6=AF=94=E8=BE=83=E5=B0=8F=EF=BC=8C=E4=BC=9A=E9=80=A0?= =?UTF-8?q?=E6=88=90MaxMemRowCountPanel=E6=98=BE=E7=A4=BA=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=EF=BC=9BREPORT-41495=E4=BA=A7=E7=94=9F=E5=8E=9F?= =?UTF-8?q?=E5=9B=A0=E6=98=AFWindows=E4=B8=8B=E7=9A=84JDK11=E7=BB=98?= =?UTF-8?q?=E5=88=B6=E6=97=B6=E4=BC=9A=E6=9C=89=E7=BC=A9=E6=94=BE=E6=95=88?= =?UTF-8?q?=E6=9E=9C=EF=BC=8C=E8=BF=99=E9=87=8C=E6=98=AF=E5=AD=97=E8=A2=AB?= =?UTF-8?q?=E6=94=BE=E5=A4=A7=E4=BA=86=E4=B8=80=E7=82=B9=EF=BC=8C=E6=8A=8A?= =?UTF-8?q?=E5=90=8E=E9=9D=A2=E7=9A=84=E6=A1=86=E6=8C=A4=E4=B8=8B=E5=8E=BB?= =?UTF-8?q?=E4=BA=86=EF=BC=8C=E8=80=8C=E4=B9=8B=E5=89=8D=E5=9B=9E=E5=BD=92?= =?UTF-8?q?=E6=94=B9=E5=8A=A8=E5=8F=AA=E4=BF=AE=E6=94=B9=E4=BA=86"?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E9=87=8D=E5=91=BD=E5=90=8D"=E7=9A=84?= =?UTF-8?q?=E6=83=85=E5=86=B5=EF=BC=8C=E6=B2=A1=E6=9C=89=E8=80=83=E8=99=91?= =?UTF-8?q?"=E6=96=87=E4=BB=B6=E5=A4=B9=E9=87=8D=E5=91=BD=E5=90=8D"=20?= =?UTF-8?q?=E3=80=90=E6=94=B9=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=91REPORT-41?= =?UTF-8?q?414=20=E5=9C=A8DBTableDataPane=E4=B8=AD=E6=8A=8A=E4=B8=AD?= =?UTF-8?q?=E9=97=B4=E4=B8=80=E9=83=A8=E5=88=86=E7=9A=84=E5=AE=BD=E5=BA=A6?= =?UTF-8?q?=E7=BC=A9=E7=9F=AD=E4=B8=80=E7=82=B9=EF=BC=8C=E7=9B=B8=E5=BD=93?= =?UTF-8?q?=E4=BA=8E=E6=8B=89=E9=95=BF=E4=BA=86=E5=8F=B3=E4=BE=A7=E7=9A=84?= =?UTF-8?q?MaxMemRowCountPanel=EF=BC=9BREPORT-41495=E4=B8=AD=E5=B0=86?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E6=A1=86=E7=BC=A9=E5=B0=8F=E4=B8=80=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/data/tabledata/tabledatapane/DBTableDataPane.java | 3 ++- .../com/fr/design/mainframe/DesignerFrameFileDealerPane.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java index d1beacb1d..6065d0485 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java @@ -185,7 +185,8 @@ public class DBTableDataPane extends AbstractTableDataPane { box.setMinimumSize(new Dimension(300, 400)); // 防止数据连接名过长时影响 split pane 分割效果 - connectionTableProcedurePane.setMinimumSize(new Dimension(250, 400)); + // 本界面中给MaxMemRowCountPanel留的空间太小,造成MaxMemRowCountPanel显示异常,这边减小一点最小宽度,拉长MaxMemRowCountPanel + connectionTableProcedurePane.setMinimumSize(new Dimension(230, 400)); connectionTableProcedurePane.setMaximumSize(new Dimension(500, 400)); // 使用SplitPane JSplitPane mainSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, connectionTableProcedurePane, sqlSplitPane); 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 870853a45..4f59032dc 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 @@ -578,7 +578,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt } }); nameField.selectAll(); - nameField.setPreferredSize(new Dimension(180, 20)); + nameField.setPreferredSize(new Dimension(170, 20)); JPanel topPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 5)); topPanel.setBorder(BorderFactory.createEmptyBorder(15, 15, 0, 15)); From c0ab66fb038b9ed1cb677c401abdbeb994967eb4 Mon Sep 17 00:00:00 2001 From: Yyming Date: Mon, 19 Oct 2020 17:12:13 +0800 Subject: [PATCH 4/5] =?UTF-8?q?REPORT-41491=E3=80=90=E5=86=92=E7=83=9F?= =?UTF-8?q?=E3=80=91af=E6=90=9C=E7=B4=A2=E7=BB=93=E6=9E=9C=E9=94=99?= =?UTF-8?q?=E4=B9=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../alphafine/cell/render/ContentCellRender.java | 6 +++++- .../search/manager/impl/FileSearchManager.java | 2 +- .../alphafine/cell/render/ContentCellRenderTest.java | 11 +++++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/render/ContentCellRender.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/render/ContentCellRender.java index da44fa510..d2befc90c 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/render/ContentCellRender.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/render/ContentCellRender.java @@ -124,7 +124,10 @@ public class ContentCellRender implements ListCellRenderer { private String getReplacedString(String modelName, String string) { //需要考虑modelName有空格的情况 //比如现在是work boo k 搜索词是workb,应该要替换的部分是work b - //先去掉空格进行匹配 + //先去掉已经匹配替换过的部分,因为考虑到分词的情况,可能会进行多次替换 + final String regex = "\\|\\|"; + modelName = modelName.replaceAll(regex, StringUtils.EMPTY); + //再去掉空格进行匹配 String noBlackName = modelName.replaceAll(StringUtils.BLANK, StringUtils.EMPTY).toLowerCase(); int index = noBlackName.indexOf(string.toLowerCase()); if (index == -1) { @@ -141,4 +144,5 @@ public class ContentCellRender implements ListCellRenderer { } + } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java index d3bd1f637..0497828c7 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java @@ -112,7 +112,7 @@ public class FileSearchManager implements AlphaFineSearchProvider { name = name.replaceAll(StringUtils.BLANK, StringUtils.EMPTY); if (name.contains(searchText)) { FileModel model = new FileModel(node.getName(), node.getEnvPath()); - if (!AlphaFineHelper.getFilterResult().contains(model)) { + if (!AlphaFineHelper.getFilterResult().contains(model) && !filterModelList.contains(model)) { AlphaFineHelper.checkCancel(); filterModelList.add(model); } diff --git a/designer-realize/src/test/java/com/fr/design/mainframe/alphafine/cell/render/ContentCellRenderTest.java b/designer-realize/src/test/java/com/fr/design/mainframe/alphafine/cell/render/ContentCellRenderTest.java index 9daa70f3a..d5f3a8206 100644 --- a/designer-realize/src/test/java/com/fr/design/mainframe/alphafine/cell/render/ContentCellRenderTest.java +++ b/designer-realize/src/test/java/com/fr/design/mainframe/alphafine/cell/render/ContentCellRenderTest.java @@ -1,7 +1,9 @@ package com.fr.design.mainframe.alphafine.cell.render; +import com.fr.stable.StringUtils; import org.junit.Test; + import static org.junit.Assert.*; /** @@ -13,11 +15,20 @@ public class ContentCellRenderTest { @Test public void highLightModelName() { + final String regex = ""; String searchText = "workb"; ContentCellRender contentCellRender = new ContentCellRender(searchText,new String[]{searchText}); String workbook = contentCellRender.highLightModelName("workbook", new String[]{searchText}); assertTrue(workbook.endsWith("workbook")); workbook = contentCellRender.highLightModelName("work book", new String[]{searchText}); assertTrue(workbook.endsWith("work book")); + + searchText = "我是空格"; + contentCellRender = new ContentCellRender(searchText, new String[]{"我是空格", "我是", "空格"}); + workbook = contentCellRender.highLightModelName("我是 空格", new String[]{searchText}); + assertEquals(workbook.replaceFirst(regex, StringUtils.EMPTY), workbook.replaceAll(regex, StringUtils.EMPTY)); + + workbook = contentCellRender.highLightModelName("我是是 空格", new String[]{"我是空格", "我是", "空格"}); + assertNotEquals(workbook.replaceFirst(regex, StringUtils.EMPTY), workbook.replaceAll(regex, StringUtils.EMPTY)); } } \ No newline at end of file From ce7864b6027b82b386e63cb0cc76c16a587ada4d Mon Sep 17 00:00:00 2001 From: Yyming Date: Mon, 19 Oct 2020 17:24:29 +0800 Subject: [PATCH 5/5] =?UTF-8?q?REPORT-41543=20=E8=A7=A6=E5=8F=91=E4=B8=80?= =?UTF-8?q?=E4=B8=8Bpr?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/alphafine/cell/render/ContentCellRender.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/render/ContentCellRender.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/render/ContentCellRender.java index d2befc90c..4f57b92b2 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/render/ContentCellRender.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/render/ContentCellRender.java @@ -142,7 +142,4 @@ public class ContentCellRender implements ListCellRenderer { } return result.toString(); } - - - }