|
|
|
@ -1,10 +1,14 @@
|
|
|
|
|
package com.fr.design.gui.controlpane; |
|
|
|
|
|
|
|
|
|
import com.fr.base.Parameter; |
|
|
|
|
import com.fr.base.ParameterConfig; |
|
|
|
|
import com.fr.design.beans.BasicBeanPane; |
|
|
|
|
import com.fr.design.dialog.FineJOptionPane; |
|
|
|
|
import com.fr.design.gui.icontainer.UIScrollPane; |
|
|
|
|
import com.fr.design.gui.ilist.JNameEdList; |
|
|
|
|
import com.fr.design.gui.ilist.ListModelElement; |
|
|
|
|
import com.fr.design.gui.ilist.ModNameActionListener; |
|
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
|
|
import com.fr.design.utils.gui.GUICoreUtils; |
|
|
|
|
import com.fr.form.event.Listener; |
|
|
|
|
import com.fr.general.ComparatorUtils; |
|
|
|
@ -12,6 +16,7 @@ import com.fr.general.IOUtils;
|
|
|
|
|
import com.fr.invoke.Reflect; |
|
|
|
|
import com.fr.stable.ArrayUtils; |
|
|
|
|
import com.fr.stable.Nameable; |
|
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
|
import com.fr.stable.core.PropertyChangeAdapter; |
|
|
|
|
|
|
|
|
|
import javax.swing.DefaultListCellRenderer; |
|
|
|
@ -23,12 +28,16 @@ import javax.swing.ListSelectionModel;
|
|
|
|
|
import javax.swing.SwingUtilities; |
|
|
|
|
import javax.swing.event.ListSelectionEvent; |
|
|
|
|
import javax.swing.event.ListSelectionListener; |
|
|
|
|
import java.util.Arrays; |
|
|
|
|
import java.util.Collection; |
|
|
|
|
import java.awt.BorderLayout; |
|
|
|
|
import java.awt.Component; |
|
|
|
|
import java.awt.event.MouseAdapter; |
|
|
|
|
import java.awt.event.MouseEvent; |
|
|
|
|
import java.awt.event.MouseListener; |
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
import static javax.swing.JOptionPane.WARNING_MESSAGE; |
|
|
|
|
|
|
|
|
|
public abstract class JListControlPane extends JControlPane implements ListControlPaneProvider { |
|
|
|
|
private static final String LIST_NAME = "JControl_List"; |
|
|
|
@ -424,4 +433,28 @@ public abstract class JListControlPane extends JControlPane implements ListContr
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void showTipWithIllegalName(String tip) { |
|
|
|
|
Parameter[] parameters = ParameterConfig.getInstance().getGlobalParameters(); |
|
|
|
|
String[] allListNames = nameableList.getAllNames(); |
|
|
|
|
allListNames[editingIndex] = StringUtils.EMPTY; |
|
|
|
|
String tempName = getEditingName(); |
|
|
|
|
if (StringUtils.isEmpty(tempName)) { |
|
|
|
|
nameableList.stopEditing(); |
|
|
|
|
FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(JListControlPane.this), |
|
|
|
|
Toolkit.i18nText("Fine-Design_Basic_Empty_Parameter_Name")); |
|
|
|
|
setIllegalIndex(editingIndex); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!ComparatorUtils.equals(tempName, selectedName) |
|
|
|
|
&& isNameRepeated(new List[]{Arrays.asList(parameters), Arrays.asList(allListNames)}, tempName)) { |
|
|
|
|
nameableList.stopEditing(); |
|
|
|
|
FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(JListControlPane.this), |
|
|
|
|
tip, |
|
|
|
|
Toolkit.i18nText("Fine-Design_Basic_Alert"), |
|
|
|
|
WARNING_MESSAGE); |
|
|
|
|
setIllegalIndex(editingIndex); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|