From 39855d1feab4ba8f4926d5b3852f32eb4bb64369 Mon Sep 17 00:00:00 2001 From: Yvan Date: Thu, 7 Jan 2021 18:52:21 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-46713=20&&=20REPORT-46469=20&&=20REPORT-?= =?UTF-8?q?46735=20=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91?= =?UTF-8?q?=E7=94=B1REPORT-44961=E4=B8=AD=E7=9A=84=E6=94=B9=E5=8A=A8?= =?UTF-8?q?=E5=BC=95=E8=B5=B7=20=E3=80=90=E6=94=B9=E5=8A=A8=E6=80=9D?= =?UTF-8?q?=E8=B7=AF=E3=80=91=E5=BC=95=E8=B5=B7=E4=BA=86=E4=B8=A4=E4=B8=AA?= =?UTF-8?q?=E5=AE=A2=E6=88=B7bug=EF=BC=8C=E9=9C=80=E8=A6=81=E5=9C=A8?= =?UTF-8?q?=E6=98=8E=E5=A4=A9=E7=9A=84=E4=B8=AD=E9=97=B4=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=8F=91=E5=B8=83=EF=BC=8C=E5=9B=A0=E6=AD=A4=E8=BF=98=E6=B2=A1?= =?UTF-8?q?=E4=BB=94=E7=BB=86=E6=8E=92=E6=9F=A5=E5=8E=9F=E5=9B=A0=EF=BC=8C?= =?UTF-8?q?=E6=9A=82=E6=97=B6=E5=85=88=E5=9B=9E=E9=80=80=E6=8E=89REPORT-44?= =?UTF-8?q?961=E4=B8=AD=E7=9A=84=E6=94=B9=E5=8A=A8=EF=BC=8C=E8=B5=B6?= =?UTF-8?q?=E4=B8=80=E4=B8=8B=E6=98=8E=E5=A4=A9=E7=9A=84=E5=8F=91=E5=B8=83?= =?UTF-8?q?=EF=BC=8C=E5=90=8E=E7=BB=AD=E7=BB=A7=E7=BB=AD=E4=BF=AE=E6=94=B9?= =?UTF-8?q?REPORT-44961=E7=9A=84=E6=97=B6=E5=80=99=E5=86=8D=E6=8E=92?= =?UTF-8?q?=E6=9F=A5=E5=8E=9F=E5=9B=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/present/dict/DictionaryPane.java | 4 - .../present/dict/TableDataDictPane.java | 93 +++++++------------ .../ui/designer/CheckBoxGroupDefinePane.java | 3 +- 3 files changed, 33 insertions(+), 67 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/present/dict/DictionaryPane.java b/designer-base/src/main/java/com/fr/design/present/dict/DictionaryPane.java index 3f42732f19..94e4b3f0ff 100644 --- a/designer-base/src/main/java/com/fr/design/present/dict/DictionaryPane.java +++ b/designer-base/src/main/java/com/fr/design/present/dict/DictionaryPane.java @@ -27,10 +27,6 @@ public class DictionaryPane extends UIComboBoxPane implements DataCr public DictionaryPane() { } - public DictionaryPane(boolean needTableDataChange) { - this.tableDataDictPane.setNeedTableDataChange(needTableDataChange); - } - @Override protected void initLayout() { this.setLayout(new BorderLayout(0, 4)); diff --git a/designer-base/src/main/java/com/fr/design/present/dict/TableDataDictPane.java b/designer-base/src/main/java/com/fr/design/present/dict/TableDataDictPane.java index 5eb6c28737..f0c291035d 100644 --- a/designer-base/src/main/java/com/fr/design/present/dict/TableDataDictPane.java +++ b/designer-base/src/main/java/com/fr/design/present/dict/TableDataDictPane.java @@ -64,7 +64,6 @@ public class TableDataDictPane extends FurtherBasicBeanPane private ItemListener itemListener; private UIObserverListener uiObserverListener; private FormulaEditor localFormulaEditor = new FormulaEditor(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter_Formula")); - private boolean needTableDataChange = true; public TableDataDictPane() { initBasicComponets(); @@ -72,14 +71,6 @@ public class TableDataDictPane extends FurtherBasicBeanPane iniListener(); } - /** - * 设置为true后,一旦触发TableDataComboBox的itemChange,就会通过数据连接,更换当前数据字典的列名List - * @param needTableDataChange - */ - public void setNeedTableDataChange(boolean needTableDataChange) { - this.needTableDataChange = needTableDataChange; - } - public static void main(String[] args) { JFrame jf = new JFrame("test"); jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); @@ -169,58 +160,38 @@ public class TableDataDictPane extends FurtherBasicBeanPane if (tableDataWrappe == null) { return; } - if (itemListener != null) { - itemListener.itemStateChanged(e); - localFormulaEditor.addChangeListener(event -> itemListener.itemStateChanged(e)); - } - if (isNeedTableDataChange()) { - changeColumnsName(); + List namelist = tableDataWrappe.calculateColumnNameList(); + String[] columnNames = null; + if (!namelist.isEmpty()) { + columnNames = namelist.toArray(ArrayUtils.EMPTY_STRING_ARRAY); + } else { + columnNames = new String[]{StringUtils.EMPTY}; } - } - - private void changeColumnsName() { - TableDataWrapper tableDataWrappe = this.tableDataNameComboBox.getSelectedItem(); - SwingWorker, Object> worker = new SwingWorker, Object>() { - @Override - protected List doInBackground() { - if (tableDataWrappe == null) { - return new ArrayList<>(); - } - return tableDataWrappe.calculateColumnNameList(); - } + // 实际值列名 + ColumnNameEditor actualColumnNameEditor = new ColumnNameEditor(columnNames); + actualColumnNameEditor.addItemListener(itemListener); + // 实际值列序号 + ColumnIndexEditor actualColumnIndexEditor = new ColumnIndexEditor(columnNames.length); + actualColumnIndexEditor.addItemListener(itemListener); + keyColumnPane.setEditors(new Editor[]{actualColumnNameEditor, actualColumnIndexEditor}, columnNames[0]); - @Override - protected void done() { - try { - List namelist = get(); - String[] columnNames = null; - if (!namelist.isEmpty()) { - columnNames = namelist.toArray(ArrayUtils.EMPTY_STRING_ARRAY); - } else { - columnNames = new String[]{StringUtils.EMPTY}; - } - // 实际值列名 - ColumnNameEditor actualColumnNameEditor = new ColumnNameEditor(columnNames); - actualColumnNameEditor.addItemListener(itemListener); - // 实际值列序号 - ColumnIndexEditor actualColumnIndexEditor = new ColumnIndexEditor(columnNames.length); - actualColumnIndexEditor.addItemListener(itemListener); - keyColumnPane.setEditors(new Editor[]{actualColumnNameEditor, actualColumnIndexEditor}, columnNames[0]); - - localFormulaEditor.setEnabled(true); - // 显示值列名 - ColumnNameEditor displayColumnNameEditor = new ColumnNameEditor(columnNames); - displayColumnNameEditor.addItemListener(itemListener); - // 显示值列序号 - ColumnIndexEditor displayColumnIndexEditor = new ColumnIndexEditor(columnNames.length); - displayColumnIndexEditor.addItemListener(itemListener); - valueDictPane.setEditors(new Editor[]{displayColumnNameEditor, displayColumnIndexEditor, localFormulaEditor}, columnNames[0]); - } catch (InterruptedException | ExecutionException e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } + FormulaEditor formulaEditor = new FormulaEditor(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter_Formula")); + formulaEditor.setEnabled(true); + formulaEditor.addChangeListener(ee -> { + if (itemListener != null) { + itemListener.itemStateChanged(e); } - }; - worker.execute(); + }); + // 显示值列名 + ColumnNameEditor displayColumnNameEditor = new ColumnNameEditor(columnNames); + displayColumnNameEditor.addItemListener(itemListener); + // 显示值列序号 + ColumnIndexEditor displayColumnIndexEditor = new ColumnIndexEditor(columnNames.length); + displayColumnIndexEditor.addItemListener(itemListener); + valueDictPane.setEditors(new Editor[]{displayColumnNameEditor, displayColumnIndexEditor, formulaEditor}, columnNames[0]); + if (itemListener != null) { + itemListener.itemStateChanged(e); + } } @Override @@ -405,7 +376,7 @@ public class TableDataDictPane extends FurtherBasicBeanPane tableDataNameComboBox.registerGlobalDSChangeListener(); } - public boolean isNeedTableDataChange() { - return needTableDataChange; - } +// public boolean isNeedTableDataChange() { +// return needTableDataChange; +// } } diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/CheckBoxGroupDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/CheckBoxGroupDefinePane.java index 022afc6105..74819ae452 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/CheckBoxGroupDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/CheckBoxGroupDefinePane.java @@ -28,8 +28,7 @@ public class CheckBoxGroupDefinePane extends ButtonGroupDefinePane