From 484efd163fdf2bdaf806104ffb378ffe9ce7f8c4 Mon Sep 17 00:00:00 2001 From: Yvan Date: Fri, 8 Jan 2021 13:56:42 +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=91r?= =?UTF-8?q?elease=E5=B7=B2=E7=BB=8F=E9=AA=8C=E6=94=B6=EF=BC=8C=E6=8F=90?= =?UTF-8?q?=E4=B8=80=E4=BB=BD=E5=88=B0final=EF=BC=8C10.0.12.1=E4=B8=AD?= =?UTF-8?q?=E9=97=B4=E7=89=88=E6=9C=AC=E5=8F=91=E5=B8=83=20=E3=80=90?= =?UTF-8?q?=E6=94=B9=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=91release=E5=B7=B2?= =?UTF-8?q?=E7=BB=8F=E9=AA=8C=E6=94=B6=EF=BC=8C=E6=8F=90=E4=B8=80=E4=BB=BD?= =?UTF-8?q?=E5=88=B0final=EF=BC=8C10.0.12.1=E4=B8=AD=E9=97=B4=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E5=8F=91=E5=B8=83?= 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 | 91 ++++++------------- .../ui/designer/CheckBoxGroupDefinePane.java | 3 +- 3 files changed, 30 insertions(+), 68 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..5ebd426593 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 @@ -404,8 +375,4 @@ public class TableDataDictPane extends FurtherBasicBeanPane public void registerDSChangeListener() { tableDataNameComboBox.registerGlobalDSChangeListener(); } - - 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