|
|
@ -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")); |
|
|
|