mirror of https://gitee.com/makejava/EasyCode.git
修复复制分组与切换分组时导致配置信息被意外清空BUG
This commit is contained in:
parent
d27532f73d
commit
b6a61be603
|
@ -36,8 +36,9 @@ public abstract class AbstractTableModel<T> extends DefaultTableModel {
|
|||
if (CollectionUtil.isEmpty(data)) {
|
||||
return;
|
||||
}
|
||||
this.data = data;
|
||||
// 先移除后赋值,修复复制分组后无数据展示问题
|
||||
removeAllRow();
|
||||
this.data = data;
|
||||
data.forEach(item -> super.addRow(toObj(item)));
|
||||
}
|
||||
|
||||
|
@ -49,7 +50,8 @@ public abstract class AbstractTableModel<T> extends DefaultTableModel {
|
|||
int rowCount = getRowCount();
|
||||
if (rowCount > 0) {
|
||||
for (int i = 0; i < rowCount; i++) {
|
||||
removeRow(0);
|
||||
// 只移除行数据,不移除储存数据,修复切换分组数据自动清空BUG
|
||||
super.removeRow(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ public class TypeMapperSetting implements Configurable {
|
|||
/**
|
||||
* 类型映射分组切换下拉框
|
||||
*/
|
||||
private JComboBox typeMapperComboBox;
|
||||
private JComboBox<String> typeMapperComboBox;
|
||||
/**
|
||||
* 分组复制按钮
|
||||
*/
|
||||
|
@ -166,7 +166,6 @@ public class TypeMapperSetting implements Configurable {
|
|||
init = false;
|
||||
//初始化下拉框
|
||||
this.typeMapperComboBox.removeAllItems();
|
||||
//noinspection unchecked
|
||||
typeMapperGroupMap.keySet().forEach(this.typeMapperComboBox::addItem);
|
||||
this.typeMapperComboBox.setSelectedItem(this.currGroupName);
|
||||
this.typeMapperModel.init(this.typeMapperGroupMap.get(currGroupName).getElementList());
|
||||
|
|
Loading…
Reference in New Issue