From 5a490cf8dd753d983b46edc2d1b8fc8c96e2bd13 Mon Sep 17 00:00:00 2001 From: mengao <283296419@qq.com> Date: Mon, 19 Jun 2017 13:53:39 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug=EF=BC=9A=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6=E6=98=BE=E7=A4=BA=E9=87=8C=E8=AE=BE=E7=BD=AE=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6=E5=86=85=E5=AE=B9=E4=B8=BA=E6=95=B0=E6=8D=AE=E5=88=97?= =?UTF-8?q?=EF=BC=8C=E6=8A=8A=E5=AF=B9=E5=BA=94=E7=9A=84=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9B=86=E5=88=A0=E6=8E=89=E5=90=8E=EF=BC=8C=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E7=9A=84=E6=9D=A1=E4=BB=B6=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=EF=BC=8C=E9=A1=B5=E9=9D=A2=E6=89=93=E4=B8=8D=E5=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../editor/editor/ColumnSelectedEditor.java | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/designer_base/src/com/fr/design/editor/editor/ColumnSelectedEditor.java b/designer_base/src/com/fr/design/editor/editor/ColumnSelectedEditor.java index 0f1c50a5f..29b1a3ea0 100644 --- a/designer_base/src/com/fr/design/editor/editor/ColumnSelectedEditor.java +++ b/designer_base/src/com/fr/design/editor/editor/ColumnSelectedEditor.java @@ -36,15 +36,18 @@ public class ColumnSelectedEditor extends Editor { @Override public void itemStateChanged(ItemEvent e) { - //这边需要重新初始化columnNames, 否则nameList长度和columnNames长度不同导致出錯。 - List nameList = tableDataComboBox.getSelectedItem().calculateColumnNameList(); - columnNames = new String[nameList.size()]; - columnNames = tableDataComboBox.getSelectedItem().calculateColumnNameList().toArray(columnNames); - columnNameComboBox.removeAllItems(); - for (int i = 0; i < columnNames.length; i++) { - columnNameComboBox.addItem(columnNames[i]); + TableDataWrapper tableDataWrapper = tableDataComboBox.getSelectedItem(); + if (tableDataWrapper != null) { + //这边需要重新初始化columnNames, 否则nameList长度和columnNames长度不同导致出錯。 + List nameList = tableDataComboBox.getSelectedItem().calculateColumnNameList(); + columnNames = new String[nameList.size()]; + columnNames = tableDataComboBox.getSelectedItem().calculateColumnNameList().toArray(columnNames); + columnNameComboBox.removeAllItems(); + for (int i = 0; i < columnNames.length; i++) { + columnNameComboBox.addItem(columnNames[i]); + } + columnNameComboBox.validate(); } - columnNameComboBox.validate(); } }); columnNameComboBox = new UIComboBox(); From c5536e6d61d93a766380a4e8221d601276e297ee Mon Sep 17 00:00:00 2001 From: mengao <283296419@qq.com> Date: Tue, 20 Jun 2017 17:20:39 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9pmd=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../editor/editor/ColumnSelectedEditor.java | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/designer_base/src/com/fr/design/editor/editor/ColumnSelectedEditor.java b/designer_base/src/com/fr/design/editor/editor/ColumnSelectedEditor.java index 29b1a3ea0..e21099d71 100644 --- a/designer_base/src/com/fr/design/editor/editor/ColumnSelectedEditor.java +++ b/designer_base/src/com/fr/design/editor/editor/ColumnSelectedEditor.java @@ -37,17 +37,18 @@ public class ColumnSelectedEditor extends Editor { @Override public void itemStateChanged(ItemEvent e) { TableDataWrapper tableDataWrapper = tableDataComboBox.getSelectedItem(); - if (tableDataWrapper != null) { - //这边需要重新初始化columnNames, 否则nameList长度和columnNames长度不同导致出錯。 - List nameList = tableDataComboBox.getSelectedItem().calculateColumnNameList(); - columnNames = new String[nameList.size()]; - columnNames = tableDataComboBox.getSelectedItem().calculateColumnNameList().toArray(columnNames); - columnNameComboBox.removeAllItems(); - for (int i = 0; i < columnNames.length; i++) { - columnNameComboBox.addItem(columnNames[i]); - } - columnNameComboBox.validate(); + if (tableDataWrapper == null) { + return; } + //这边需要重新初始化columnNames, 否则nameList长度和columnNames长度不同导致出錯。 + List nameList = tableDataComboBox.getSelectedItem().calculateColumnNameList(); + columnNames = new String[nameList.size()]; + columnNames = tableDataComboBox.getSelectedItem().calculateColumnNameList().toArray(columnNames); + columnNameComboBox.removeAllItems(); + for (int i = 0; i < columnNames.length; i++) { + columnNameComboBox.addItem(columnNames[i]); + } + columnNameComboBox.validate(); } }); columnNameComboBox = new UIComboBox(); From 382268234df6ed7c8ad3b1172bdf66c8a2ac6b31 Mon Sep 17 00:00:00 2001 From: mengao <283296419@qq.com> Date: Tue, 20 Jun 2017 17:25:45 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dpmd=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/editor/editor/ColumnSelectedEditor.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/designer_base/src/com/fr/design/editor/editor/ColumnSelectedEditor.java b/designer_base/src/com/fr/design/editor/editor/ColumnSelectedEditor.java index e21099d71..22516882b 100644 --- a/designer_base/src/com/fr/design/editor/editor/ColumnSelectedEditor.java +++ b/designer_base/src/com/fr/design/editor/editor/ColumnSelectedEditor.java @@ -36,13 +36,13 @@ public class ColumnSelectedEditor extends Editor { @Override public void itemStateChanged(ItemEvent e) { - TableDataWrapper tableDataWrapper = tableDataComboBox.getSelectedItem(); - if (tableDataWrapper == null) { - return; - } - //这边需要重新初始化columnNames, 否则nameList长度和columnNames长度不同导致出錯。 - List nameList = tableDataComboBox.getSelectedItem().calculateColumnNameList(); - columnNames = new String[nameList.size()]; + TableDataWrapper tableDataWrapper = tableDataComboBox.getSelectedItem(); + if (tableDataWrapper == null) { + return; + } + //这边需要重新初始化columnNames, 否则nameList长度和columnNames长度不同导致出錯。 + List nameList = tableDataWrapper.calculateColumnNameList(); + columnNames = new String[nameList.size()]; columnNames = tableDataComboBox.getSelectedItem().calculateColumnNameList().toArray(columnNames); columnNameComboBox.removeAllItems(); for (int i = 0; i < columnNames.length; i++) { From 58bc5e247e1f26c0288d5e65af6af5cb3e6b4ac0 Mon Sep 17 00:00:00 2001 From: mengao <283296419@qq.com> Date: Tue, 20 Jun 2017 17:57:47 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9pmd=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/editor/editor/ColumnSelectedEditor.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/designer_base/src/com/fr/design/editor/editor/ColumnSelectedEditor.java b/designer_base/src/com/fr/design/editor/editor/ColumnSelectedEditor.java index 22516882b..71014d4c8 100644 --- a/designer_base/src/com/fr/design/editor/editor/ColumnSelectedEditor.java +++ b/designer_base/src/com/fr/design/editor/editor/ColumnSelectedEditor.java @@ -68,7 +68,7 @@ public class ColumnSelectedEditor extends Editor { dsColumn.setDsName(tableDataWrappe.getTableDataName()); TableDataColumn column; String columnExp = (String) this.columnNameComboBox.getSelectedItem(); - if (StringUtils.isNotBlank(columnExp) && (columnExp.length() > 0 && columnExp.charAt(0) == '#') && !columnExp.endsWith("#")) { + if (StringUtils.isNotBlank(columnExp) && checkColumnExp(columnExp)) { String number = columnExp.substring(1); Pattern pattern = Pattern.compile("[^\\d]"); if (pattern.matcher(number).find()) { @@ -84,6 +84,10 @@ public class ColumnSelectedEditor extends Editor { return dsColumn; } + private boolean checkColumnExp (String columnExp) { + return (columnExp.length() > 0 && columnExp.charAt(0) == '#') && !columnExp.endsWith("#"); + } + public String getIconName() { return "ds_column"; }