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