From 9b71b1241e286783ef08517f345a01bcfeda9392 Mon Sep 17 00:00:00 2001 From: Yvan Date: Thu, 10 Dec 2020 13:08:15 +0800 Subject: [PATCH 1/6] =?UTF-8?q?REPORT-44961=20=E3=80=9010.0.12=E5=86=92?= =?UTF-8?q?=E7=83=9F=E3=80=91=E9=99=84=E4=BB=B6=E6=A8=A1=E6=9D=BF=E6=89=93?= =?UTF-8?q?=E5=BC=80=E8=AE=BE=E8=AE=A1=E5=99=A8=E5=8D=A1=E6=AD=BB=EF=BC=8C?= =?UTF-8?q?=E4=B8=94=E5=B8=83=E5=B1=80=E5=8F=91=E7=94=9F=E5=8F=98=E5=8C=96?= =?UTF-8?q?=20=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91?= =?UTF-8?q?=E5=B8=A6=E6=9C=89=E6=95=B0=E6=8D=AE=E5=AD=97=E5=85=B8=E7=9A=84?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8=E6=8E=A7=E4=BB=B6=EF=BC=8C=E5=9C=A8?= =?UTF-8?q?=E9=80=89=E4=B8=AD=E7=9A=84=E6=97=B6=E5=80=99=E4=BC=9A=E5=8E=BB?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E8=8E=B7=E5=8F=96=E5=AD=97=E6=AE=B5=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=EF=BC=8C=E5=BD=93=E7=B3=BB=E7=BB=9F=E4=B8=AD=E6=9C=89?= =?UTF-8?q?=E5=90=8C=E5=90=8D=E6=95=B0=E6=8D=AE=E8=BF=9E=E6=8E=A5=E4=BD=86?= =?UTF-8?q?=E6=98=AF=E6=97=A0=E6=B3=95=E8=BF=9E=E6=8E=A5=E5=88=B0=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=BA=93=E7=9A=84=E6=97=B6=E5=80=99=EF=BC=8C=E4=BC=9A?= =?UTF-8?q?=E5=8F=91=E7=94=9F=E5=81=87=E6=AD=BB=E3=80=82=E5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=BC=9A=E5=8E=BB=E8=AF=B7=E6=B1=82=E8=BF=9E=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wrapper/AbstractTableDataWrapper.java | 40 ++++----- .../AccessibleDictionaryEditor.java | 3 +- .../design/present/dict/DictionaryPane.java | 4 + .../present/dict/TableDataDictPane.java | 85 ++++++++++++------- 4 files changed, 83 insertions(+), 49 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/AbstractTableDataWrapper.java b/designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/AbstractTableDataWrapper.java index 82022bea6..ceb0bd8b6 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/AbstractTableDataWrapper.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/AbstractTableDataWrapper.java @@ -7,6 +7,7 @@ import com.fr.design.DesignModelAdapter; import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.datapane.preview.PreviewTablePane; import com.fr.design.data.tabledata.tabledatapane.AbstractTableDataPane; +import com.fr.design.dialog.FineJOptionPane; import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode; import com.fr.design.utils.DesignUtils; import com.fr.general.ComparatorUtils; @@ -35,18 +36,18 @@ public abstract class AbstractTableDataWrapper implements TableDataWrapper { /** * 获取数据集的所有列名list - * + * * @return 数据集的所有列名list - * + * * * @date 2014-11-24-下午3:51:41 - * + * */ public List calculateColumnNameList() { if(columnNameList != null){ return columnNameList; } - + DesignModelAdapter adapter = DesignModelAdapter.getCurrentModelAdapter(); TableDataSource tds = adapter == null ? null : adapter.getBook(); String[] colNames = tabledata.getColumnNames(tds); @@ -56,13 +57,14 @@ public abstract class AbstractTableDataWrapper implements TableDataWrapper { } else if (ArrayUtils.isNotEmpty(colNamesInCache)) { return toColumnNameList(colNamesInCache); } - + EmbeddedTableData embeddedTableData = null; try { embeddedTableData = DesignTableDataManager.previewTableDataNotNeedInputParameters(tds, tabledata, TableData.RESULT_NOT_NEED, false); } catch (Exception e) { if (e.getMessage()!=null) { - DesignUtils.errorMessage(e.getMessage()); + // 这个弹窗可能会成为数据字典页面的二级弹窗,所以修改下父窗口避免出现mac下的二级弹窗问题 + FineJOptionPane.showMessageDialog(null, e.getMessage()); } } columnNameList = DesignTableDataManager.getColumnNamesByTableData(embeddedTableData); @@ -78,12 +80,12 @@ public abstract class AbstractTableDataWrapper implements TableDataWrapper { /** * 生成子节点 - * + * * @return 生成子节点 - * + * * * @date 2014-11-24-下午3:51:17 - * + * */ public ExpandMutableTreeNode[] load() { List namelist = calculateColumnNameList(); @@ -97,10 +99,10 @@ public abstract class AbstractTableDataWrapper implements TableDataWrapper { /** * 预览数据集 - * + * * * @date 2014-11-24-下午3:50:20 - * + * */ public void previewData() { PreviewTablePane.previewTableData(tabledata); @@ -108,30 +110,30 @@ public abstract class AbstractTableDataWrapper implements TableDataWrapper { /** * 预览数据集,带有显示值和实际值的标记结果 - * + * * @param keyIndex 实际值 * @param valueIndex 显示值 - * + * * * @date 2014-11-24-下午3:50:20 - * + * */ public void previewData(final int keyIndex,final int valueIndex){ PreviewTablePane.previewTableData(tabledata, keyIndex, valueIndex); } @Override public String getTableDataName(){ - return name; + return name; } /** * 获取数据集的面板 - * + * * @return 数据集面板 - * + * * * @date 2014-11-24-下午3:50:00 - * + * */ public AbstractTableDataPane creatTableDataPane() { return TableDataFactory.creatTableDataPane(tabledata, name); @@ -143,4 +145,4 @@ public abstract class AbstractTableDataWrapper implements TableDataWrapper { && ComparatorUtils.equals(this.tabledata, ((AbstractTableDataWrapper) obj).getTableData()); } -} \ No newline at end of file +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleDictionaryEditor.java b/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleDictionaryEditor.java index c2195512a..f194e6d91 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleDictionaryEditor.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleDictionaryEditor.java @@ -21,6 +21,7 @@ public class AccessibleDictionaryEditor extends UneditableAccessibleEditor { protected void showEditorPane() { if (dictPane == null) { dictPane = new DictionaryPane(); + dictPane.getTableDataDictPane().setNeedTableDataChange(true); } BasicDialog dlg = dictPane.showWindow(SwingUtilities.getWindowAncestor(this)); @@ -58,4 +59,4 @@ public class AccessibleDictionaryEditor extends UneditableAccessibleEditor { public Dictionary updateBean() { return (Dictionary) this.getValue(); } -} \ No newline at end of file +} 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 e50ed86b9..3966510fe 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 @@ -83,4 +83,8 @@ public class DictionaryPane extends UIComboBoxPane implements DataCr public void registerDSChangeListener() { tableDataDictPane.registerDSChangeListener(); } + + public TableDataDictPane getTableDataDictPane() { + return tableDataDictPane; + } } 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 3c08c1c9d..055b93fae 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 @@ -32,6 +32,7 @@ import com.fr.design.layout.TableLayoutHelper; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.ComparatorUtils; +import com.fr.log.FineLoggerFactory; import com.fr.stable.ArrayUtils; import com.fr.stable.StringUtils; @@ -41,7 +42,9 @@ import javax.swing.event.ChangeListener; import java.awt.*; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; +import java.util.ArrayList; import java.util.List; +import java.util.concurrent.ExecutionException; /** * 数据字典的数据查询面板 @@ -60,6 +63,8 @@ public class TableDataDictPane extends FurtherBasicBeanPane private DoubleDeckValueEditorPane valueDictPane; private ItemListener itemListener; private UIObserverListener uiObserverListener; + private FormulaEditor formulaEditor1 = new FormulaEditor(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter_Formula")); + private boolean needTableDataChange = false; public TableDataDictPane() { initBasicComponets(); @@ -67,6 +72,10 @@ public class TableDataDictPane extends FurtherBasicBeanPane iniListener(); } + 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); @@ -83,7 +92,7 @@ public class TableDataDictPane extends FurtherBasicBeanPane tableDataNameComboBox.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent e) { if (e.getStateChange() == ItemEvent.SELECTED) { - tdChange(e); + tdChange(e, needTableDataChange); } } }); @@ -153,44 +162,62 @@ public class TableDataDictPane extends FurtherBasicBeanPane return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Dic_Data_Query"); } - private void tdChange(final ItemEvent e) { + private void tdChange(final ItemEvent e, boolean needTableDataChange) { TableDataWrapper tableDataWrappe = this.tableDataNameComboBox.getSelectedItem(); if (tableDataWrappe == null) { return; } - - List namelist = tableDataWrappe.calculateColumnNameList(); - String[] columnNames = null; - if (!namelist.isEmpty()) { - columnNames = namelist.toArray(ArrayUtils.EMPTY_STRING_ARRAY); - } else { - columnNames = new String[]{""}; + if (itemListener != null) { + itemListener.itemStateChanged(e); + formulaEditor1.addChangeListener(event -> { + itemListener.itemStateChanged(e); + }); + } + if (needTableDataChange) { + changeColumnsName(); } - ColumnNameEditor columnNameEditor1 = new ColumnNameEditor(columnNames); - columnNameEditor1.addItemListener(itemListener); - ColumnIndexEditor columnIndexEditor1 = new ColumnIndexEditor(columnNames.length); - columnIndexEditor1.addItemListener(itemListener); - keyColumnPane.setEditors(new Editor[]{columnNameEditor1, columnIndexEditor1}, columnNames[0]); + } - FormulaEditor formulaEditor = new FormulaEditor(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter_Formula")); - formulaEditor.setEnabled(true); - formulaEditor.addChangeListener(new ChangeListener() { + private void changeColumnsName() { + TableDataWrapper tableDataWrappe = this.tableDataNameComboBox.getSelectedItem(); + SwingWorker, Object> worker = new SwingWorker, Object>() { + @Override + protected List doInBackground() throws Exception { + if (tableDataWrappe == null) { + return new ArrayList<>(); + } + return tableDataWrappe.calculateColumnNameList(); + } @Override - public void stateChanged(ChangeEvent ee) { - if (itemListener != null) { - itemListener.itemStateChanged(e); + protected void done() { + try { + List namelist = get(); + String[] columnNames = null; + if (!namelist.isEmpty()) { + columnNames = namelist.toArray(ArrayUtils.EMPTY_STRING_ARRAY); + } else { + columnNames = new String[]{""}; + } + ColumnNameEditor columnNameEditor1 = new ColumnNameEditor(columnNames); + columnNameEditor1.addItemListener(itemListener); + ColumnIndexEditor columnIndexEditor1 = new ColumnIndexEditor(columnNames.length); + columnIndexEditor1.addItemListener(itemListener); + keyColumnPane.setEditors(new Editor[]{columnNameEditor1, columnIndexEditor1}, columnNames[0]); + + formulaEditor1.setEnabled(true); + + ColumnNameEditor columnNameEditor2 = new ColumnNameEditor(columnNames); + columnNameEditor2.addItemListener(itemListener); + ColumnIndexEditor columnIndexEditor2 = new ColumnIndexEditor(columnNames.length); + columnIndexEditor2.addItemListener(itemListener); + valueDictPane.setEditors(new Editor[]{columnNameEditor2, columnIndexEditor2, formulaEditor1}, columnNames[0]); + } catch (InterruptedException | ExecutionException e) { + FineLoggerFactory.getLogger().error(e.getMessage()); } } - }); - ColumnNameEditor columnNameEditor2 = new ColumnNameEditor(columnNames); - columnNameEditor2.addItemListener(itemListener); - ColumnIndexEditor columnIndexEditor2 = new ColumnIndexEditor(columnNames.length); - columnIndexEditor2.addItemListener(itemListener); - valueDictPane.setEditors(new Editor[]{columnNameEditor2, columnIndexEditor2, formulaEditor}, columnNames[0]); - if (itemListener != null) { - itemListener.itemStateChanged(e); - } + }; + worker.execute(); } @Override From 21c4355bcbbce04172e455397e2d7914d0784efb Mon Sep 17 00:00:00 2001 From: Yvan Date: Fri, 11 Dec 2020 17:27:36 +0800 Subject: [PATCH 2/6] =?UTF-8?q?REPORT-44961=20=E3=80=9010.0.12=E5=86=92?= =?UTF-8?q?=E7=83=9F=E3=80=91=E9=99=84=E4=BB=B6=E6=A8=A1=E6=9D=BF=E6=89=93?= =?UTF-8?q?=E5=BC=80=E8=AE=BE=E8=AE=A1=E5=99=A8=E5=8D=A1=E6=AD=BB=EF=BC=8C?= =?UTF-8?q?=E4=B8=94=E5=B8=83=E5=B1=80=E5=8F=91=E7=94=9F=E5=8F=98=E5=8C=96?= =?UTF-8?q?=20=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F=E5=9B=A0=E3=80=91?= =?UTF-8?q?=E5=B8=A6=E6=9C=89=E6=95=B0=E6=8D=AE=E5=AD=97=E5=85=B8=E7=9A=84?= =?UTF-8?q?=E8=A1=A8=E5=8D=95=E6=8E=A7=E4=BB=B6=EF=BC=8C=E5=9C=A8=E9=80=89?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E6=97=B6=E5=80=99=E4=BC=9A=E5=8E=BB=E8=BF=9E?= =?UTF-8?q?=E6=8E=A5=E8=8E=B7=E5=8F=96=E5=AD=97=E6=AE=B5=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=EF=BC=8C=E5=BD=93=E7=B3=BB=E7=BB=9F=E4=B8=AD=E6=9C=89=E5=90=8C?= =?UTF-8?q?=E5=90=8D=E6=95=B0=E6=8D=AE=E8=BF=9E=E6=8E=A5=E4=BD=86=E6=98=AF?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E8=BF=9E=E6=8E=A5=E5=88=B0=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=E7=9A=84=E6=97=B6=E5=80=99=EF=BC=8C=E4=BC=9A=E5=8F=91?= =?UTF-8?q?=E7=94=9F=E5=81=87=E6=AD=BB=E3=80=82=E5=A6=82=E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B7=E6=B1=82=E8=BF=9E=E6=8E=A5=EF=BC=8C=E5=B9=B6=E6=9B=B4?= =?UTF-8?q?=E6=8D=A2=E5=BD=93=E5=89=8D=E6=95=B0=E6=8D=AE=E5=AD=97=E5=85=B8?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E5=88=97=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AccessibleDictionaryEditor.java | 3 +- .../design/present/dict/DictionaryPane.java | 4 + .../present/dict/TableDataDictPane.java | 103 +++++++++++------- 3 files changed, 71 insertions(+), 39 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleDictionaryEditor.java b/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleDictionaryEditor.java index c2195512a..6be31c526 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleDictionaryEditor.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleDictionaryEditor.java @@ -21,6 +21,7 @@ public class AccessibleDictionaryEditor extends UneditableAccessibleEditor { protected void showEditorPane() { if (dictPane == null) { dictPane = new DictionaryPane(); + dictPane.setNeedTableDataChange(true); } BasicDialog dlg = dictPane.showWindow(SwingUtilities.getWindowAncestor(this)); @@ -58,4 +59,4 @@ public class AccessibleDictionaryEditor extends UneditableAccessibleEditor { public Dictionary updateBean() { return (Dictionary) this.getValue(); } -} \ No newline at end of file +} 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 e50ed86b9..f74138be5 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 @@ -83,4 +83,8 @@ public class DictionaryPane extends UIComboBoxPane implements DataCr public void registerDSChangeListener() { tableDataDictPane.registerDSChangeListener(); } + + public void setNeedTableDataChange(boolean needTableDataChange) { + tableDataDictPane.setNeedTableDataChange(needTableDataChange); + } } 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 3c08c1c9d..53801293a 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 @@ -31,17 +31,20 @@ import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.ComparatorUtils; - +import com.fr.log.FineLoggerFactory; import com.fr.stable.ArrayUtils; import com.fr.stable.StringUtils; -import javax.swing.*; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; -import java.awt.*; +import javax.swing.JFrame; +import javax.swing.JPanel; +import javax.swing.SwingWorker; +import java.awt.BorderLayout; +import java.awt.Component; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; +import java.util.ArrayList; import java.util.List; +import java.util.concurrent.ExecutionException; /** * 数据字典的数据查询面板 @@ -60,6 +63,8 @@ public class TableDataDictPane extends FurtherBasicBeanPane private DoubleDeckValueEditorPane valueDictPane; 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 = false; public TableDataDictPane() { initBasicComponets(); @@ -67,6 +72,14 @@ 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); @@ -80,11 +93,9 @@ public class TableDataDictPane extends FurtherBasicBeanPane private void initBasicComponets() { tableDataNameComboBox = new TableDataComboBox(DesignTableDataManager.getEditingTableDataSource()); - tableDataNameComboBox.addItemListener(new ItemListener() { - public void itemStateChanged(ItemEvent e) { - if (e.getStateChange() == ItemEvent.SELECTED) { - tdChange(e); - } + tableDataNameComboBox.addItemListener(e -> { + if (e.getStateChange() == ItemEvent.SELECTED) { + tdChange(e, needTableDataChange); } }); // keyColumnPane = ValueEditorPaneFactory.createValueEditorPane(new Editor[]{new ColumnNameEditor(), new ColumnIndexEditor()}); @@ -153,44 +164,60 @@ public class TableDataDictPane extends FurtherBasicBeanPane return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Dic_Data_Query"); } - private void tdChange(final ItemEvent e) { + private void tdChange(final ItemEvent e, boolean needTableDataChange) { TableDataWrapper tableDataWrappe = this.tableDataNameComboBox.getSelectedItem(); if (tableDataWrappe == null) { return; } - - List namelist = tableDataWrappe.calculateColumnNameList(); - String[] columnNames = null; - if (!namelist.isEmpty()) { - columnNames = namelist.toArray(ArrayUtils.EMPTY_STRING_ARRAY); - } else { - columnNames = new String[]{""}; + if (itemListener != null) { + itemListener.itemStateChanged(e); + localFormulaEditor.addChangeListener(event -> itemListener.itemStateChanged(e)); } - ColumnNameEditor columnNameEditor1 = new ColumnNameEditor(columnNames); - columnNameEditor1.addItemListener(itemListener); - ColumnIndexEditor columnIndexEditor1 = new ColumnIndexEditor(columnNames.length); - columnIndexEditor1.addItemListener(itemListener); - keyColumnPane.setEditors(new Editor[]{columnNameEditor1, columnIndexEditor1}, columnNames[0]); + if (needTableDataChange) { + changeColumnsName(); + } + } - FormulaEditor formulaEditor = new FormulaEditor(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter_Formula")); - formulaEditor.setEnabled(true); - formulaEditor.addChangeListener(new ChangeListener() { + 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(); + } @Override - public void stateChanged(ChangeEvent ee) { - if (itemListener != null) { - itemListener.itemStateChanged(e); + protected void done() { + try { + List namelist = get(); + String[] columnNames = null; + if (!namelist.isEmpty()) { + columnNames = namelist.toArray(ArrayUtils.EMPTY_STRING_ARRAY); + } else { + columnNames = new String[]{""}; + } + ColumnNameEditor columnNameEditor1 = new ColumnNameEditor(columnNames); + columnNameEditor1.addItemListener(itemListener); + ColumnIndexEditor columnIndexEditor1 = new ColumnIndexEditor(columnNames.length); + columnIndexEditor1.addItemListener(itemListener); + keyColumnPane.setEditors(new Editor[]{columnNameEditor1, columnIndexEditor1}, columnNames[0]); + + localFormulaEditor.setEnabled(true); + + ColumnNameEditor columnNameEditor2 = new ColumnNameEditor(columnNames); + columnNameEditor2.addItemListener(itemListener); + ColumnIndexEditor columnIndexEditor2 = new ColumnIndexEditor(columnNames.length); + columnIndexEditor2.addItemListener(itemListener); + valueDictPane.setEditors(new Editor[]{columnNameEditor2, columnIndexEditor2, localFormulaEditor}, columnNames[0]); + } catch (InterruptedException | ExecutionException e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); } } - }); - ColumnNameEditor columnNameEditor2 = new ColumnNameEditor(columnNames); - columnNameEditor2.addItemListener(itemListener); - ColumnIndexEditor columnIndexEditor2 = new ColumnIndexEditor(columnNames.length); - columnIndexEditor2.addItemListener(itemListener); - valueDictPane.setEditors(new Editor[]{columnNameEditor2, columnIndexEditor2, formulaEditor}, columnNames[0]); - if (itemListener != null) { - itemListener.itemStateChanged(e); - } + }; + worker.execute(); } @Override From b7987f61f8e4f436620e58f33caf0e427b4dc31f Mon Sep 17 00:00:00 2001 From: Yvan Date: Fri, 11 Dec 2020 17:31:18 +0800 Subject: [PATCH 3/6] =?UTF-8?q?REPORT-44961=20=E8=BF=99=E4=B8=AA=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E9=87=8C=E5=85=88=E4=B8=8D=E5=A4=84=E7=90=86=E4=BA=8C?= =?UTF-8?q?=E7=BA=A7=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/tabledata/wrapper/AbstractTableDataWrapper.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/AbstractTableDataWrapper.java b/designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/AbstractTableDataWrapper.java index ceb0bd8b6..3f1068d01 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/AbstractTableDataWrapper.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/AbstractTableDataWrapper.java @@ -63,8 +63,7 @@ public abstract class AbstractTableDataWrapper implements TableDataWrapper { embeddedTableData = DesignTableDataManager.previewTableDataNotNeedInputParameters(tds, tabledata, TableData.RESULT_NOT_NEED, false); } catch (Exception e) { if (e.getMessage()!=null) { - // 这个弹窗可能会成为数据字典页面的二级弹窗,所以修改下父窗口避免出现mac下的二级弹窗问题 - FineJOptionPane.showMessageDialog(null, e.getMessage()); + DesignUtils.errorMessage(e.getMessage()); } } columnNameList = DesignTableDataManager.getColumnNamesByTableData(embeddedTableData); From fbf2036d5d8a1d1cadcb099f4dc98225ddeee126 Mon Sep 17 00:00:00 2001 From: Yvan Date: Mon, 14 Dec 2020 11:02:24 +0800 Subject: [PATCH 4/6] =?UTF-8?q?REPORT-44961=20=E4=BF=AE=E6=94=B9=E4=B8=80?= =?UTF-8?q?=E4=BA=9B=E5=8F=98=E9=87=8F=E5=90=8D=EF=BC=8C=E5=88=A0=E5=8E=BB?= =?UTF-8?q?=E6=97=A0=E7=94=A8=E5=AF=BC=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wrapper/AbstractTableDataWrapper.java | 1 - .../present/dict/TableDataDictPane.java | 27 ++++++++++--------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/AbstractTableDataWrapper.java b/designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/AbstractTableDataWrapper.java index 3f1068d01..be993fa68 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/AbstractTableDataWrapper.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/AbstractTableDataWrapper.java @@ -7,7 +7,6 @@ import com.fr.design.DesignModelAdapter; import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.datapane.preview.PreviewTablePane; import com.fr.design.data.tabledata.tabledatapane.AbstractTableDataPane; -import com.fr.design.dialog.FineJOptionPane; import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode; import com.fr.design.utils.DesignUtils; import com.fr.general.ComparatorUtils; 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 53801293a..098280bc5 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 @@ -197,21 +197,24 @@ public class TableDataDictPane extends FurtherBasicBeanPane if (!namelist.isEmpty()) { columnNames = namelist.toArray(ArrayUtils.EMPTY_STRING_ARRAY); } else { - columnNames = new String[]{""}; + columnNames = new String[]{StringUtils.EMPTY}; } - ColumnNameEditor columnNameEditor1 = new ColumnNameEditor(columnNames); - columnNameEditor1.addItemListener(itemListener); - ColumnIndexEditor columnIndexEditor1 = new ColumnIndexEditor(columnNames.length); - columnIndexEditor1.addItemListener(itemListener); - keyColumnPane.setEditors(new Editor[]{columnNameEditor1, columnIndexEditor1}, columnNames[0]); + // 实际值列名 + 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 columnNameEditor2 = new ColumnNameEditor(columnNames); - columnNameEditor2.addItemListener(itemListener); - ColumnIndexEditor columnIndexEditor2 = new ColumnIndexEditor(columnNames.length); - columnIndexEditor2.addItemListener(itemListener); - valueDictPane.setEditors(new Editor[]{columnNameEditor2, columnIndexEditor2, localFormulaEditor}, columnNames[0]); + // 显示值列名 + 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); } From f99aac406bc05b05fa2369b111fe969276c44d1b Mon Sep 17 00:00:00 2001 From: Yvan Date: Mon, 14 Dec 2020 11:12:24 +0800 Subject: [PATCH 5/6] =?UTF-8?q?REPORT-44961=20=E4=B8=BA=E5=8D=95=E5=85=83?= =?UTF-8?q?=E6=A0=BC=E5=B1=9E=E6=80=A7-=E5=BD=A2=E6=80=81-=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=AD=97=E5=85=B8=E4=B8=AD=E7=9A=84DictionaryPane?= =?UTF-8?q?=E4=B9=9F=E8=AE=BE=E7=BD=AEneedChangeTableData=E5=8F=98?= =?UTF-8?q?=E9=87=8F=E4=B8=BAtrue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/present/DictPresentPane.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/present/DictPresentPane.java b/designer-base/src/main/java/com/fr/design/present/DictPresentPane.java index cba37ea19..85f027217 100644 --- a/designer-base/src/main/java/com/fr/design/present/DictPresentPane.java +++ b/designer-base/src/main/java/com/fr/design/present/DictPresentPane.java @@ -10,7 +10,7 @@ import com.fr.design.present.dict.DictionaryPane; /** - * + * * @author zhou * @since 2012-5-31上午10:54:20 */ @@ -19,6 +19,7 @@ public class DictPresentPane extends FurtherBasicBeanPane implement public DictPresentPane() { dictionaryPane = new DictionaryPane(); + dictionaryPane.setNeedTableDataChange(true); this.setLayout(new BorderLayout()); this.add(dictionaryPane, BorderLayout.CENTER); } @@ -42,7 +43,7 @@ public class DictPresentPane extends FurtherBasicBeanPane implement public boolean accept(Object ob) { return ob instanceof DictPresent; } - + public void addTabChangeListener(ItemListener l){ dictionaryPane.addTabChangeListener(l); } @@ -55,4 +56,4 @@ public class DictPresentPane extends FurtherBasicBeanPane implement public void registerDSChangeListener() { dictionaryPane.registerDSChangeListener(); } -} \ No newline at end of file +} From bc9a93d903fa1fc49f141dfbdd0ef06c2d25bed8 Mon Sep 17 00:00:00 2001 From: Yvan Date: Mon, 14 Dec 2020 14:41:00 +0800 Subject: [PATCH 6/6] =?UTF-8?q?REPORT-44961=20=E6=8A=8ATableDataDictPane?= =?UTF-8?q?=E4=B8=AD=E7=9A=84needTableDataChange=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E4=B8=BAtrue=EF=BC=8C=E5=9C=A8CheckBoxGroupD?= =?UTF-8?q?efinePane=E4=B8=AD=E5=88=9B=E5=BB=BADictionaryPane=E7=9A=84?= =?UTF-8?q?=E6=97=B6=E5=80=99=E4=BC=A0=E5=85=A5=E4=B8=80=E4=B8=AAfalse?= =?UTF-8?q?=EF=BC=8C=E8=BF=99=E6=A0=B7=E5=B0=B1=E4=B8=8D=E4=BC=9A=E5=BD=B1?= =?UTF-8?q?=E5=93=8D=E5=85=B6=E5=AE=83=E4=BD=BF=E7=94=A8=E4=BA=86Dictionar?= =?UTF-8?q?yPane=E7=9A=84=E5=9C=B0=E6=96=B9=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../accessibles/AccessibleDictionaryEditor.java | 1 - .../java/com/fr/design/present/DictPresentPane.java | 1 - .../com/fr/design/present/dict/DictionaryPane.java | 11 +++++++---- .../fr/design/present/dict/TableDataDictPane.java | 12 ++++++++---- .../widget/ui/designer/CheckBoxGroupDefinePane.java | 4 ++-- 5 files changed, 17 insertions(+), 12 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleDictionaryEditor.java b/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleDictionaryEditor.java index 6be31c526..3edf47b05 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleDictionaryEditor.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleDictionaryEditor.java @@ -21,7 +21,6 @@ public class AccessibleDictionaryEditor extends UneditableAccessibleEditor { protected void showEditorPane() { if (dictPane == null) { dictPane = new DictionaryPane(); - dictPane.setNeedTableDataChange(true); } BasicDialog dlg = dictPane.showWindow(SwingUtilities.getWindowAncestor(this)); diff --git a/designer-base/src/main/java/com/fr/design/present/DictPresentPane.java b/designer-base/src/main/java/com/fr/design/present/DictPresentPane.java index 85f027217..82cf70372 100644 --- a/designer-base/src/main/java/com/fr/design/present/DictPresentPane.java +++ b/designer-base/src/main/java/com/fr/design/present/DictPresentPane.java @@ -19,7 +19,6 @@ public class DictPresentPane extends FurtherBasicBeanPane implement public DictPresentPane() { dictionaryPane = new DictionaryPane(); - dictionaryPane.setNeedTableDataChange(true); this.setLayout(new BorderLayout()); this.add(dictionaryPane, BorderLayout.CENTER); } 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 f74138be5..3f42732f1 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 @@ -24,6 +24,13 @@ import java.util.List; public class DictionaryPane extends UIComboBoxPane implements DataCreatorUI, Prepare4DataSourceChange { private TableDataDictPane tableDataDictPane; + public DictionaryPane() { + } + + public DictionaryPane(boolean needTableDataChange) { + this.tableDataDictPane.setNeedTableDataChange(needTableDataChange); + } + @Override protected void initLayout() { this.setLayout(new BorderLayout(0, 4)); @@ -83,8 +90,4 @@ public class DictionaryPane extends UIComboBoxPane implements DataCr public void registerDSChangeListener() { tableDataDictPane.registerDSChangeListener(); } - - public void setNeedTableDataChange(boolean needTableDataChange) { - tableDataDictPane.setNeedTableDataChange(needTableDataChange); - } } 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 098280bc5..5eb6c2873 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,7 @@ 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 = false; + private boolean needTableDataChange = true; public TableDataDictPane() { initBasicComponets(); @@ -95,7 +95,7 @@ public class TableDataDictPane extends FurtherBasicBeanPane tableDataNameComboBox = new TableDataComboBox(DesignTableDataManager.getEditingTableDataSource()); tableDataNameComboBox.addItemListener(e -> { if (e.getStateChange() == ItemEvent.SELECTED) { - tdChange(e, needTableDataChange); + tdChange(e); } }); // keyColumnPane = ValueEditorPaneFactory.createValueEditorPane(new Editor[]{new ColumnNameEditor(), new ColumnIndexEditor()}); @@ -164,7 +164,7 @@ public class TableDataDictPane extends FurtherBasicBeanPane return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Dic_Data_Query"); } - private void tdChange(final ItemEvent e, boolean needTableDataChange) { + private void tdChange(final ItemEvent e) { TableDataWrapper tableDataWrappe = this.tableDataNameComboBox.getSelectedItem(); if (tableDataWrappe == null) { return; @@ -173,7 +173,7 @@ public class TableDataDictPane extends FurtherBasicBeanPane itemListener.itemStateChanged(e); localFormulaEditor.addChangeListener(event -> itemListener.itemStateChanged(e)); } - if (needTableDataChange) { + if (isNeedTableDataChange()) { changeColumnsName(); } } @@ -404,4 +404,8 @@ 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 19a61a631..022afc610 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 @@ -29,9 +29,9 @@ public class CheckBoxGroupDefinePane extends ButtonGroupDefinePane