Browse Source

REPORT-46713 && REPORT-46469 && REPORT-46735

【问题原因】由REPORT-44961中的改动引起
【改动思路】引起了两个客户bug,需要在明天的中间版本发布,因此还没仔细排查原因,暂时先回退掉REPORT-44961中的改动,赶一下明天的发布,后续继续修改REPORT-44961的时候再排查原因
feature/big-screen
Yvan 4 years ago
parent
commit
39855d1fea
  1. 4
      designer-base/src/main/java/com/fr/design/present/dict/DictionaryPane.java
  2. 93
      designer-base/src/main/java/com/fr/design/present/dict/TableDataDictPane.java
  3. 3
      designer-form/src/main/java/com/fr/design/widget/ui/designer/CheckBoxGroupDefinePane.java

4
designer-base/src/main/java/com/fr/design/present/dict/DictionaryPane.java

@ -27,10 +27,6 @@ public class DictionaryPane extends UIComboBoxPane<Dictionary> implements DataCr
public DictionaryPane() { public DictionaryPane() {
} }
public DictionaryPane(boolean needTableDataChange) {
this.tableDataDictPane.setNeedTableDataChange(needTableDataChange);
}
@Override @Override
protected void initLayout() { protected void initLayout() {
this.setLayout(new BorderLayout(0, 4)); this.setLayout(new BorderLayout(0, 4));

93
designer-base/src/main/java/com/fr/design/present/dict/TableDataDictPane.java

@ -64,7 +64,6 @@ public class TableDataDictPane extends FurtherBasicBeanPane<TableDataDictionary>
private ItemListener itemListener; private ItemListener itemListener;
private UIObserverListener uiObserverListener; private UIObserverListener uiObserverListener;
private FormulaEditor localFormulaEditor = new FormulaEditor(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter_Formula")); private FormulaEditor localFormulaEditor = new FormulaEditor(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter_Formula"));
private boolean needTableDataChange = true;
public TableDataDictPane() { public TableDataDictPane() {
initBasicComponets(); initBasicComponets();
@ -72,14 +71,6 @@ public class TableDataDictPane extends FurtherBasicBeanPane<TableDataDictionary>
iniListener(); iniListener();
} }
/**
* 设置为true后一旦触发TableDataComboBox的itemChange就会通过数据连接更换当前数据字典的列名List
* @param needTableDataChange
*/
public void setNeedTableDataChange(boolean needTableDataChange) {
this.needTableDataChange = needTableDataChange;
}
public static void main(String[] args) { public static void main(String[] args) {
JFrame jf = new JFrame("test"); JFrame jf = new JFrame("test");
jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
@ -169,58 +160,38 @@ public class TableDataDictPane extends FurtherBasicBeanPane<TableDataDictionary>
if (tableDataWrappe == null) { if (tableDataWrappe == null) {
return; return;
} }
if (itemListener != null) { List<String> namelist = tableDataWrappe.calculateColumnNameList();
itemListener.itemStateChanged(e); String[] columnNames = null;
localFormulaEditor.addChangeListener(event -> itemListener.itemStateChanged(e)); if (!namelist.isEmpty()) {
} columnNames = namelist.toArray(ArrayUtils.EMPTY_STRING_ARRAY);
if (isNeedTableDataChange()) { } else {
changeColumnsName(); columnNames = new String[]{StringUtils.EMPTY};
} }
} // 实际值列名
ColumnNameEditor actualColumnNameEditor = new ColumnNameEditor(columnNames);
private void changeColumnsName() { actualColumnNameEditor.addItemListener(itemListener);
TableDataWrapper tableDataWrappe = this.tableDataNameComboBox.getSelectedItem(); // 实际值列序号
SwingWorker<List<String>, Object> worker = new SwingWorker<List<String>, Object>() { ColumnIndexEditor actualColumnIndexEditor = new ColumnIndexEditor(columnNames.length);
@Override actualColumnIndexEditor.addItemListener(itemListener);
protected List<String> doInBackground() { keyColumnPane.setEditors(new Editor[]{actualColumnNameEditor, actualColumnIndexEditor}, columnNames[0]);
if (tableDataWrappe == null) {
return new ArrayList<>();
}
return tableDataWrappe.calculateColumnNameList();
}
@Override FormulaEditor formulaEditor = new FormulaEditor(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter_Formula"));
protected void done() { formulaEditor.setEnabled(true);
try { formulaEditor.addChangeListener(ee -> {
List<String> namelist = get(); if (itemListener != null) {
String[] columnNames = null; itemListener.itemStateChanged(e);
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);
}
} }
}; });
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 @Override
@ -405,7 +376,7 @@ public class TableDataDictPane extends FurtherBasicBeanPane<TableDataDictionary>
tableDataNameComboBox.registerGlobalDSChangeListener(); tableDataNameComboBox.registerGlobalDSChangeListener();
} }
public boolean isNeedTableDataChange() { // public boolean isNeedTableDataChange() {
return needTableDataChange; // return needTableDataChange;
} // }
} }

3
designer-form/src/main/java/com/fr/design/widget/ui/designer/CheckBoxGroupDefinePane.java

@ -28,8 +28,7 @@ public class CheckBoxGroupDefinePane extends ButtonGroupDefinePane<CheckBoxGroup
@Override @Override
protected void initComponents() { protected void initComponents() {
super.initComponents(); super.initComponents();
dictPane = new DictionaryPane();
dictPane = new DictionaryPane(false);
} }
@Override @Override

Loading…
Cancel
Save