Browse Source

REPORT-41333 【冒烟】全局参数添加两个参数p1p2,将p2重命名为p1,不会有参数名重复的提醒

feature/big-screen
Yyming 4 years ago
parent
commit
98237ada99
  1. 12
      designer-base/src/main/java/com/fr/design/parameter/ParameterArrayPane.java

12
designer-base/src/main/java/com/fr/design/parameter/ParameterArrayPane.java

@ -23,17 +23,11 @@ public class ParameterArrayPane extends JListControlPane {
*/ */
public ParameterArrayPane() { public ParameterArrayPane() {
super(); super();
this.addModNameActionListener(new ModNameActionListener() { this.addModNameActionListener((index, oldName, newName) -> populateSelectedValue());
public void nameModed(int index, String oldName, String newName) {
populateSelectedValue();
}
});
this.addEditingListener(new PropertyChangeAdapter() { this.addEditingListener(new PropertyChangeAdapter() {
public void propertyChange() { public void propertyChange() {
Parameter[] parameters = ParameterConfig.getInstance().getGlobalParameters();
String[] allListNames = nameableList.getAllNames(); String[] allListNames = nameableList.getAllNames();
allListNames[nameableList.getSelectedIndex()] = StringUtils.EMPTY; allListNames[editingIndex] = StringUtils.EMPTY;
String tempName = getEditingName(); String tempName = getEditingName();
if (StringUtils.isEmpty(tempName)) { if (StringUtils.isEmpty(tempName)) {
nameableList.stopEditing(); nameableList.stopEditing();
@ -42,7 +36,7 @@ public class ParameterArrayPane extends JListControlPane {
return; return;
} }
if (!ComparatorUtils.equals(tempName, selectedName) if (!ComparatorUtils.equals(tempName, selectedName)
&& isNameRepeated(new List[]{Arrays.asList(parameters), Arrays.asList(allListNames)}, tempName)) { && isNameRepeated(new List[]{Arrays.asList(allListNames)}, tempName)) {
nameableList.stopEditing(); nameableList.stopEditing();
FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(ParameterArrayPane.this), FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(ParameterArrayPane.this),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Duplicate_Parameter_Name")); com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Duplicate_Parameter_Name"));

Loading…
Cancel
Save