|
|
@ -36,8 +36,12 @@ public class ColumnSelectedEditor extends Editor<SimpleDSColumn> { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void itemStateChanged(ItemEvent e) { |
|
|
|
public void itemStateChanged(ItemEvent e) { |
|
|
|
|
|
|
|
TableDataWrapper tableDataWrapper = tableDataComboBox.getSelectedItem(); |
|
|
|
|
|
|
|
if (tableDataWrapper == null) { |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
//这边需要重新初始化columnNames, 否则nameList长度和columnNames长度不同导致出錯。
|
|
|
|
//这边需要重新初始化columnNames, 否则nameList长度和columnNames长度不同导致出錯。
|
|
|
|
List<String> nameList = tableDataComboBox.getSelectedItem().calculateColumnNameList(); |
|
|
|
List<String> nameList = tableDataWrapper.calculateColumnNameList(); |
|
|
|
columnNames = new String[nameList.size()]; |
|
|
|
columnNames = new String[nameList.size()]; |
|
|
|
columnNames = tableDataComboBox.getSelectedItem().calculateColumnNameList().toArray(columnNames); |
|
|
|
columnNames = tableDataComboBox.getSelectedItem().calculateColumnNameList().toArray(columnNames); |
|
|
|
columnNameComboBox.removeAllItems(); |
|
|
|
columnNameComboBox.removeAllItems(); |
|
|
@ -64,7 +68,7 @@ public class ColumnSelectedEditor extends Editor<SimpleDSColumn> { |
|
|
|
dsColumn.setDsName(tableDataWrappe.getTableDataName()); |
|
|
|
dsColumn.setDsName(tableDataWrappe.getTableDataName()); |
|
|
|
TableDataColumn column; |
|
|
|
TableDataColumn column; |
|
|
|
String columnExp = (String) this.columnNameComboBox.getSelectedItem(); |
|
|
|
String columnExp = (String) this.columnNameComboBox.getSelectedItem(); |
|
|
|
if (StringUtils.isNotBlank(columnExp) && (columnExp.length() > 0 && columnExp.charAt(0) == '#') && !columnExp.endsWith("#")) { |
|
|
|
if (StringUtils.isNotBlank(columnExp) && checkColumnExp(columnExp)) { |
|
|
|
String number = columnExp.substring(1); |
|
|
|
String number = columnExp.substring(1); |
|
|
|
Pattern pattern = Pattern.compile("[^\\d]"); |
|
|
|
Pattern pattern = Pattern.compile("[^\\d]"); |
|
|
|
if (pattern.matcher(number).find()) { |
|
|
|
if (pattern.matcher(number).find()) { |
|
|
@ -80,6 +84,10 @@ public class ColumnSelectedEditor extends Editor<SimpleDSColumn> { |
|
|
|
return dsColumn; |
|
|
|
return dsColumn; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private boolean checkColumnExp (String columnExp) { |
|
|
|
|
|
|
|
return (columnExp.length() > 0 && columnExp.charAt(0) == '#') && !columnExp.endsWith("#"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public String getIconName() { |
|
|
|
public String getIconName() { |
|
|
|
return "ds_column"; |
|
|
|
return "ds_column"; |
|
|
|
} |
|
|
|
} |
|
|
|