|
|
@ -36,15 +36,18 @@ public class ColumnSelectedEditor extends Editor<SimpleDSColumn> { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void itemStateChanged(ItemEvent e) { |
|
|
|
public void itemStateChanged(ItemEvent e) { |
|
|
|
//这边需要重新初始化columnNames, 否则nameList长度和columnNames长度不同导致出錯。
|
|
|
|
TableDataWrapper tableDataWrapper = tableDataComboBox.getSelectedItem(); |
|
|
|
List<String> nameList = tableDataComboBox.getSelectedItem().calculateColumnNameList(); |
|
|
|
if (tableDataWrapper != null) { |
|
|
|
columnNames = new String[nameList.size()]; |
|
|
|
//这边需要重新初始化columnNames, 否则nameList长度和columnNames长度不同导致出錯。
|
|
|
|
columnNames = tableDataComboBox.getSelectedItem().calculateColumnNameList().toArray(columnNames); |
|
|
|
List<String> nameList = tableDataComboBox.getSelectedItem().calculateColumnNameList(); |
|
|
|
columnNameComboBox.removeAllItems(); |
|
|
|
columnNames = new String[nameList.size()]; |
|
|
|
for (int i = 0; i < columnNames.length; i++) { |
|
|
|
columnNames = tableDataComboBox.getSelectedItem().calculateColumnNameList().toArray(columnNames); |
|
|
|
columnNameComboBox.addItem(columnNames[i]); |
|
|
|
columnNameComboBox.removeAllItems(); |
|
|
|
|
|
|
|
for (int i = 0; i < columnNames.length; i++) { |
|
|
|
|
|
|
|
columnNameComboBox.addItem(columnNames[i]); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
columnNameComboBox.validate(); |
|
|
|
} |
|
|
|
} |
|
|
|
columnNameComboBox.validate(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
columnNameComboBox = new UIComboBox(); |
|
|
|
columnNameComboBox = new UIComboBox(); |
|
|
|