@ -18,6 +18,7 @@ import com.fr.log.FineLoggerFactory;
import javax.swing.Icon ;
import javax.swing.Icon ;
import javax.swing.JFrame ;
import javax.swing.JFrame ;
import javax.swing.SwingWorker ;
import javax.swing.SwingWorker ;
import java.awt.Component ;
import java.util.ArrayList ;
import java.util.ArrayList ;
import java.util.Arrays ;
import java.util.Arrays ;
import java.util.List ;
import java.util.List ;
@ -52,16 +53,25 @@ public final class StoreProcedureDataWrapper implements TableDataWrapper {
private int previewModel ;
private int previewModel ;
public StoreProcedureDataWrapper ( StoreProcedure storeProcedure , String storeprocedureName , String dsName ) {
public StoreProcedureDataWrapper ( StoreProcedure storeProcedure , String storeprocedureName , String dsName ) {
this ( storeProcedure , storeprocedureName , dsName , true ) ;
this ( null , storeProcedure , storeprocedureName , dsName , true ) ;
}
}
public StoreProcedureDataWrapper ( StoreProcedure storeProcedure , String storeprocedureName , String dsName , boolean needLoad ) {
this ( null , storeProcedure , storeprocedureName , dsName , needLoad ) ;
}
public StoreProcedureDataWrapper ( Component component , StoreProcedure storeProcedure , String storeprocedureName , String dsName ) {
this ( component , storeProcedure , storeprocedureName , dsName , true ) ;
}
/ * *
/ * *
* @param dsName 存储过程一个返回数据集的名字
* @param : component loadingBar的父弹框 ( 如果不设置父弹框的话 , 可能出现loadingBar隐藏在一个弹框后的情况 )
* @param storeProcedure 存储过程
* @param : storeProcedure 存储过程
* @param storeprocedureName 存储过程的名字 ( 某些情况下可以为空 )
* @param : storeprocedureName 存储过程的名字 ( 某些情况下可以为空 )
* /
* @param : dsName 存储过程一个返回数据集的名字
public StoreProcedureDataWrapper ( StoreProcedure storeProcedure , String storeprocedureName , String dsName , boolean needLoad ) {
* @param : needLoad 是否要加载
* * /
public StoreProcedureDataWrapper ( Component component , StoreProcedure storeProcedure , String storeprocedureName , String dsName , boolean needLoad ) {
this . dsName = dsName ;
this . dsName = dsName ;
this . storeProcedure = storeProcedure ;
this . storeProcedure = storeProcedure ;
this . storeProcedure . setCalculating ( false ) ;
this . storeProcedure . setCalculating ( false ) ;
@ -69,7 +79,10 @@ public final class StoreProcedureDataWrapper implements TableDataWrapper {
if ( needLoad ) {
if ( needLoad ) {
setWorker ( ) ;
setWorker ( ) ;
}
}
loadingBar = new AutoProgressBar ( new JFrame ( ) , Toolkit . i18nText ( "Fine-Design_Basic_Loading_Data" ) , "" , 0 , 100 ) {
if ( component = = null ) {
component = new JFrame ( ) ;
}
loadingBar = new AutoProgressBar ( component , Toolkit . i18nText ( "Fine-Design_Basic_Loading_Data" ) , "" , 0 , 100 ) {
public void doMonitorCanceled ( ) {
public void doMonitorCanceled ( ) {
getWorker ( ) . cancel ( true ) ;
getWorker ( ) . cancel ( true ) ;
}
}