@ -9,6 +9,7 @@ import com.fr.design.ExtraDesignClassManager;
import com.fr.design.actions.UpdateAction ;
import com.fr.design.constants.UIConstants ;
import com.fr.design.data.BasicTableDataTreePane ;
import com.fr.design.data.BasicTableDataUtils ;
import com.fr.design.data.DesignTableDataManager ;
import com.fr.design.data.tabledata.StoreProcedureWorkerListener ;
import com.fr.design.data.tabledata.tabledatapane.AbstractTableDataPane ;
@ -339,10 +340,11 @@ public class TableDataTreePane extends BasicTableDataTreePane {
/ * *
* 合并数据集
*
* @param srcName 数据集来源 ( 比如报表块 , 就是报表块的名称 )
* @param tableDataSource 数据集
* /
public Map < String , String > addTableData ( String srcName , TableDataSource tableDataSource ) {
public Map < String , String > addTableData ( String srcName , TableDataSource tableDataSource , boolean isCover ) {
Map < String , String > tdNameMap = new HashMap < > ( ) ;
allDSNames = DesignTableDataManager . getAllDSNames ( tc . getBook ( ) ) ;
DesignTableDataManager . setThreadLocal ( DesignTableDataManager . NO_PARAMETER ) ;
@ -352,14 +354,8 @@ public class TableDataTreePane extends BasicTableDataTreePane {
String tdName = ( String ) tdIterator . next ( ) ;
String oldName = tdName ;
TableData td = tableDataSource . getTableData ( tdName ) ;
if ( tds . getTableData ( tdName ) ! = null | | isDsNameRepeaded ( tdName ) ) { //如果有同名的就拼上来源名称
tdName = srcName + tdName ;
}
int i = 0 ;
while ( tds . getTableData ( tdName ) ! = null ) {
i + + ; //如果拼上名字后依然已经存在就加编号
tdName + = i ;
}
boolean isDsNameRepeaded = isDsNameRepeaded ( tdName ) ;
tdName = BasicTableDataUtils . getTableDataName ( isCover , tds , tdName , srcName , isDsNameRepeaded ) ;
tds . putTableData ( tdName , td ) ;
if ( ! ComparatorUtils . equals ( oldName , tdName ) ) {
tdNameMap . put ( oldName , tdName ) ;
@ -369,6 +365,17 @@ public class TableDataTreePane extends BasicTableDataTreePane {
dataTree . refresh ( ) ;
return Collections . unmodifiableMap ( tdNameMap ) ;
}
@Override
public void removeTableData ( String sourceName ) {
TableDataSource tds = tc . getBook ( ) ;
tds . removeTableData ( sourceName ) ;
dataTree . refresh ( ) ;
}
public void addDataPane ( final AbstractTableDataPane < ? > uPanel , String paneName ) {
final NamePane nPanel = uPanel . asNamePane ( ) ;
nPanel . setObjectName ( paneName ) ;