|
|
|
@ -24,11 +24,13 @@ import com.fr.stable.core.PropertyChangeAdapter;
|
|
|
|
|
import javax.swing.*; |
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.Arrays; |
|
|
|
|
import java.util.Collection; |
|
|
|
|
import java.util.HashMap; |
|
|
|
|
import java.util.Iterator; |
|
|
|
|
import java.util.LinkedHashMap; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.Map; |
|
|
|
|
import java.util.Set; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* TableDataList Pane. |
|
|
|
@ -49,8 +51,7 @@ public class TableDataPaneListPane extends JListControlPane implements TableData
|
|
|
|
|
//说明双击之后又取消了,啥也不用做
|
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
TableDataSource source = DesignTableDataManager.getEditingTableDataSource(); |
|
|
|
|
String[] allDSNames = DesignTableDataManager.getAllDSNames(source); |
|
|
|
|
Set<String> allDSNames = DesignTableDataManager.getGlobalDataSet().keySet(); |
|
|
|
|
String[] allListNames = nameableList.getAllNames(); |
|
|
|
|
allListNames[editingIndex] = StringUtils.EMPTY; |
|
|
|
|
|
|
|
|
@ -73,7 +74,7 @@ public class TableDataPaneListPane extends JListControlPane implements TableData
|
|
|
|
|
setIllegalIndex(editingIndex); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
boolean isRepeated = isNameRepeated(new List[]{Arrays.asList(allDSNames), Arrays.asList(allListNames)}, tempName); |
|
|
|
|
boolean isRepeated = isNameRepeated(new Collection[]{allDSNames, Arrays.asList(allListNames)}, tempName); |
|
|
|
|
if (isRepeated) { |
|
|
|
|
isNamePermitted = false; |
|
|
|
|
nameableList.stopEditing(); |
|
|
|
@ -98,11 +99,16 @@ public class TableDataPaneListPane extends JListControlPane implements TableData
|
|
|
|
|
for (Map.Entry<String, String> entry : dsNameChangedMap.entrySet()) { |
|
|
|
|
if (StringUtils.equals(oldName, entry.getValue())) { |
|
|
|
|
oldName = entry.getKey(); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (StringUtils.equals(oldName, newName)) { |
|
|
|
|
//a -> b;b -> a,说明没改
|
|
|
|
|
dsNameChangedMap.remove(oldName); |
|
|
|
|
} else { |
|
|
|
|
dsNameChangedMap.put(oldName, newName); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 名字是否允许 |
|
|
|
|