From 228098fb228624b638626c3d8d1f6f7f2e8c9255 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Tue, 24 Aug 2021 20:04:30 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-56840=20=E6=A0=91=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9B=86=E7=82=B9=E5=87=BB=E9=80=89=E6=8B=A9=E8=B5=96=E6=89=80?= =?UTF-8?q?=E9=80=89=E6=95=B0=E6=8D=AE=E9=9B=86=E7=9A=84=E7=88=B6=E6=A0=87?= =?UTF-8?q?=E8=AE=B0=E5=AD=97=E6=AE=B5=E6=9E=84=E5=BB=BA=E6=A0=91-?= =?UTF-8?q?=E7=88=B6=E8=8A=82=E7=82=B9=E5=AD=97=E6=AE=B5=E5=8F=91=E7=94=9F?= =?UTF-8?q?=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/datapane/TreeTableDataDictPane.java | 27 ++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/TreeTableDataDictPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/TreeTableDataDictPane.java index f1f1c6c75e..161f6febfe 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/TreeTableDataDictPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/TreeTableDataDictPane.java @@ -64,7 +64,7 @@ public class TreeTableDataDictPane extends BasicPane implements Previewable { tableFlowPane.add(tableDataNameComboBox); tableDataNameComboBox.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent e) { - tdChange(); + tdChange(true); } }); tableFlowPane.add(new PreviewLabel(this)); @@ -73,19 +73,21 @@ public class TreeTableDataDictPane extends BasicPane implements Previewable { this.add(centerPane, BorderLayout.CENTER); parentMarkRadio = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Build_Tree_Accord_Parent_Marked_Filed"), true); lengthMarkRadio = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Build_Tree_Accord_Marked_Filed_Length")); - parentMarkRadio.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { + parentMarkRadio.addItemListener(new ItemListener() { + @Override + public void itemStateChanged(ItemEvent e) { if (isBuildByParentFiled()) { makeParentEnable(); - tdChange(); + tdChange(false); } } }); - lengthMarkRadio.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { + lengthMarkRadio.addItemListener(new ItemListener() { + @Override + public void itemStateChanged(ItemEvent e) { if (!isBuildByParentFiled()) { makeLengthEnable(); - tdChange(); + tdChange(false); } } }); @@ -169,7 +171,7 @@ public class TreeTableDataDictPane extends BasicPane implements Previewable { } - private void tdChange() { + private void tdChange(boolean isRefreshComboBoxItems) { TableDataWrapper tableDataWrappe = this.tableDataNameComboBox.getSelectedItem(); if (tableDataWrappe == null) { return; @@ -186,7 +188,9 @@ public class TreeTableDataDictPane extends BasicPane implements Previewable { String[] columnNames = new String[len]; namelist.toArray(columnNames); for (int i = 0; i < valueEditorPanes.length; i++) { - valueEditorPanes[i].setEditors(new Editor[]{new ColumnNameEditor(columnNames), new ColumnIndexEditor(len)}, columnNames[0]); + if (isRefreshComboBoxItems || isNoSelectedColumnName(valueEditorPanes[i])) { + valueEditorPanes[i].setEditors(new Editor[]{new ColumnNameEditor(columnNames), new ColumnIndexEditor(len)}, columnNames[0]); + } } } catch (Exception e) { for (int i = 0; i < valueEditorPanes.length; i++) { @@ -197,6 +201,11 @@ public class TreeTableDataDictPane extends BasicPane implements Previewable { } } + private boolean isNoSelectedColumnName(ValueEditorPane valueEditorPane) { + ColumnNameEditor columnNameEditor = (ColumnNameEditor) valueEditorPane.getCards()[0]; + return StringUtils.isEmpty(columnNameEditor.getColumnName()); + } + @Override protected String title4PopupWindow() { return "TreeTableDataDictionay";