Browse Source

REPORT-44961 把TableDataDictPane中的needTableDataChange默认设置为true,在CheckBoxGroupDefinePane中创建DictionaryPane的时候传入一个false,这样就不会影响其它使用了DictionaryPane的地方了

research/11.0
Yvan 4 years ago
parent
commit
bc9a93d903
  1. 1
      designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleDictionaryEditor.java
  2. 1
      designer-base/src/main/java/com/fr/design/present/DictPresentPane.java
  3. 11
      designer-base/src/main/java/com/fr/design/present/dict/DictionaryPane.java
  4. 12
      designer-base/src/main/java/com/fr/design/present/dict/TableDataDictPane.java
  5. 4
      designer-form/src/main/java/com/fr/design/widget/ui/designer/CheckBoxGroupDefinePane.java

1
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() { protected void showEditorPane() {
if (dictPane == null) { if (dictPane == null) {
dictPane = new DictionaryPane(); dictPane = new DictionaryPane();
dictPane.setNeedTableDataChange(true);
} }
BasicDialog dlg = dictPane.showWindow(SwingUtilities.getWindowAncestor(this)); BasicDialog dlg = dictPane.showWindow(SwingUtilities.getWindowAncestor(this));

1
designer-base/src/main/java/com/fr/design/present/DictPresentPane.java

@ -19,7 +19,6 @@ public class DictPresentPane extends FurtherBasicBeanPane<DictPresent> implement
public DictPresentPane() { public DictPresentPane() {
dictionaryPane = new DictionaryPane(); dictionaryPane = new DictionaryPane();
dictionaryPane.setNeedTableDataChange(true);
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(dictionaryPane, BorderLayout.CENTER); this.add(dictionaryPane, BorderLayout.CENTER);
} }

11
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<Dictionary> implements DataCreatorUI, Prepare4DataSourceChange { public class DictionaryPane extends UIComboBoxPane<Dictionary> implements DataCreatorUI, Prepare4DataSourceChange {
private TableDataDictPane tableDataDictPane; private TableDataDictPane tableDataDictPane;
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));
@ -83,8 +90,4 @@ public class DictionaryPane extends UIComboBoxPane<Dictionary> implements DataCr
public void registerDSChangeListener() { public void registerDSChangeListener() {
tableDataDictPane.registerDSChangeListener(); tableDataDictPane.registerDSChangeListener();
} }
public void setNeedTableDataChange(boolean needTableDataChange) {
tableDataDictPane.setNeedTableDataChange(needTableDataChange);
}
} }

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

@ -64,7 +64,7 @@ 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 = false; private boolean needTableDataChange = true;
public TableDataDictPane() { public TableDataDictPane() {
initBasicComponets(); initBasicComponets();
@ -95,7 +95,7 @@ public class TableDataDictPane extends FurtherBasicBeanPane<TableDataDictionary>
tableDataNameComboBox = new TableDataComboBox(DesignTableDataManager.getEditingTableDataSource()); tableDataNameComboBox = new TableDataComboBox(DesignTableDataManager.getEditingTableDataSource());
tableDataNameComboBox.addItemListener(e -> { tableDataNameComboBox.addItemListener(e -> {
if (e.getStateChange() == ItemEvent.SELECTED) { if (e.getStateChange() == ItemEvent.SELECTED) {
tdChange(e, needTableDataChange); tdChange(e);
} }
}); });
// keyColumnPane = ValueEditorPaneFactory.createValueEditorPane(new Editor[]{new ColumnNameEditor(), new ColumnIndexEditor()}); // keyColumnPane = ValueEditorPaneFactory.createValueEditorPane(new Editor[]{new ColumnNameEditor(), new ColumnIndexEditor()});
@ -164,7 +164,7 @@ public class TableDataDictPane extends FurtherBasicBeanPane<TableDataDictionary>
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Dic_Data_Query"); 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(); TableDataWrapper tableDataWrappe = this.tableDataNameComboBox.getSelectedItem();
if (tableDataWrappe == null) { if (tableDataWrappe == null) {
return; return;
@ -173,7 +173,7 @@ public class TableDataDictPane extends FurtherBasicBeanPane<TableDataDictionary>
itemListener.itemStateChanged(e); itemListener.itemStateChanged(e);
localFormulaEditor.addChangeListener(event -> itemListener.itemStateChanged(e)); localFormulaEditor.addChangeListener(event -> itemListener.itemStateChanged(e));
} }
if (needTableDataChange) { if (isNeedTableDataChange()) {
changeColumnsName(); changeColumnsName();
} }
} }
@ -404,4 +404,8 @@ public class TableDataDictPane extends FurtherBasicBeanPane<TableDataDictionary>
public void registerDSChangeListener() { public void registerDSChangeListener() {
tableDataNameComboBox.registerGlobalDSChangeListener(); tableDataNameComboBox.registerGlobalDSChangeListener();
} }
public boolean isNeedTableDataChange() {
return needTableDataChange;
}
} }

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

@ -29,9 +29,9 @@ public class CheckBoxGroupDefinePane extends ButtonGroupDefinePane<CheckBoxGroup
protected void initComponents() { protected void initComponents() {
super.initComponents(); super.initComponents();
dictPane = new DictionaryPane(); dictPane = new DictionaryPane(false);
} }
@Override @Override
public String title4PopupWindow() { public String title4PopupWindow() {
return "CheckBoxGroup"; return "CheckBoxGroup";

Loading…
Cancel
Save