Browse Source

REPORT-56840 树数据集点击选择赖所选数据集的父标记字段构建树-父节点字段发生变更

fix-lag
方磊 3 years ago
parent
commit
228098fb22
  1. 25
      designer-base/src/main/java/com/fr/design/data/datapane/TreeTableDataDictPane.java

25
designer-base/src/main/java/com/fr/design/data/datapane/TreeTableDataDictPane.java

@ -64,7 +64,7 @@ public class TreeTableDataDictPane extends BasicPane implements Previewable {
tableFlowPane.add(tableDataNameComboBox); tableFlowPane.add(tableDataNameComboBox);
tableDataNameComboBox.addItemListener(new ItemListener() { tableDataNameComboBox.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) { public void itemStateChanged(ItemEvent e) {
tdChange(); tdChange(true);
} }
}); });
tableFlowPane.add(new PreviewLabel(this)); tableFlowPane.add(new PreviewLabel(this));
@ -73,19 +73,21 @@ public class TreeTableDataDictPane extends BasicPane implements Previewable {
this.add(centerPane, BorderLayout.CENTER); this.add(centerPane, BorderLayout.CENTER);
parentMarkRadio = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Build_Tree_Accord_Parent_Marked_Filed"), true); parentMarkRadio = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Build_Tree_Accord_Parent_Marked_Filed"), true);
lengthMarkRadio = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Build_Tree_Accord_Marked_Filed_Length")); lengthMarkRadio = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Build_Tree_Accord_Marked_Filed_Length"));
parentMarkRadio.addActionListener(new ActionListener() { parentMarkRadio.addItemListener(new ItemListener() {
public void actionPerformed(ActionEvent e) { @Override
public void itemStateChanged(ItemEvent e) {
if (isBuildByParentFiled()) { if (isBuildByParentFiled()) {
makeParentEnable(); makeParentEnable();
tdChange(); tdChange(false);
} }
} }
}); });
lengthMarkRadio.addActionListener(new ActionListener() { lengthMarkRadio.addItemListener(new ItemListener() {
public void actionPerformed(ActionEvent e) { @Override
public void itemStateChanged(ItemEvent e) {
if (!isBuildByParentFiled()) { if (!isBuildByParentFiled()) {
makeLengthEnable(); makeLengthEnable();
tdChange(); tdChange(false);
} }
} }
}); });
@ -169,7 +171,7 @@ public class TreeTableDataDictPane extends BasicPane implements Previewable {
} }
private void tdChange() { private void tdChange(boolean isRefreshComboBoxItems) {
TableDataWrapper tableDataWrappe = this.tableDataNameComboBox.getSelectedItem(); TableDataWrapper tableDataWrappe = this.tableDataNameComboBox.getSelectedItem();
if (tableDataWrappe == null) { if (tableDataWrappe == null) {
return; return;
@ -186,8 +188,10 @@ public class TreeTableDataDictPane extends BasicPane implements Previewable {
String[] columnNames = new String[len]; String[] columnNames = new String[len];
namelist.toArray(columnNames); namelist.toArray(columnNames);
for (int i = 0; i < valueEditorPanes.length; i++) { for (int i = 0; i < valueEditorPanes.length; i++) {
if (isRefreshComboBoxItems || isNoSelectedColumnName(valueEditorPanes[i])) {
valueEditorPanes[i].setEditors(new Editor[]{new ColumnNameEditor(columnNames), new ColumnIndexEditor(len)}, columnNames[0]); valueEditorPanes[i].setEditors(new Editor[]{new ColumnNameEditor(columnNames), new ColumnIndexEditor(len)}, columnNames[0]);
} }
}
} catch (Exception e) { } catch (Exception e) {
for (int i = 0; i < valueEditorPanes.length; i++) { for (int i = 0; i < valueEditorPanes.length; i++) {
valueEditorPanes[i].setEditors(new Editor[]{new ColumnNameEditor(), new ColumnIndexEditor()}, 1); valueEditorPanes[i].setEditors(new Editor[]{new ColumnNameEditor(), new ColumnIndexEditor()}, 1);
@ -197,6 +201,11 @@ public class TreeTableDataDictPane extends BasicPane implements Previewable {
} }
} }
private boolean isNoSelectedColumnName(ValueEditorPane valueEditorPane) {
ColumnNameEditor columnNameEditor = (ColumnNameEditor) valueEditorPane.getCards()[0];
return StringUtils.isEmpty(columnNameEditor.getColumnName());
}
@Override @Override
protected String title4PopupWindow() { protected String title4PopupWindow() {
return "TreeTableDataDictionay"; return "TreeTableDataDictionay";

Loading…
Cancel
Save