|
|
|
@ -275,18 +275,25 @@ public class DesensitizationRuleChoosePane extends JPanel {
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
|
// 获取当前选中规则
|
|
|
|
|
DesensitizationRule selectedValue = getSelectedValue(); |
|
|
|
|
// 获取当前选中规则的副本
|
|
|
|
|
DesensitizationRule selectedValue = null; |
|
|
|
|
try { |
|
|
|
|
selectedValue = (DesensitizationRule) getSelectedValue().clone(); |
|
|
|
|
} catch (CloneNotSupportedException ex) { |
|
|
|
|
throw new RuntimeException(ex); |
|
|
|
|
} |
|
|
|
|
DesensitizationRuleEditPane editPane = new DesensitizationRuleEditPane(getCurrentExistRuleNames(selectedValue.getRuleName())); |
|
|
|
|
editPane.populateBean(selectedValue); |
|
|
|
|
final DesensitizationRule finalRule = selectedValue; |
|
|
|
|
BasicDialog basicDialog = editPane.showWindowWithCustomSize(SwingUtilities.getWindowAncestor(parent), new DialogActionAdapter() { |
|
|
|
|
@Override |
|
|
|
|
public void doOk() { |
|
|
|
|
DesensitizationRule rule = editPane.updateBean(); |
|
|
|
|
// 修改同步到RuleManager中
|
|
|
|
|
if (DesensitizationRule.valid(rule)) { |
|
|
|
|
DesensitizationRuleManager.getInstance().updateRule(rule); |
|
|
|
|
DesensitizationRuleManager.getInstance().updateRule(finalRule, rule); |
|
|
|
|
} |
|
|
|
|
setSelectedValue(rule); |
|
|
|
|
fireTableDataChanged(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|