@ -158,7 +158,7 @@ public class ProcedureDataPane extends AbstractTableDataPane<StoreProcedure> imp
private JToolBar creatToolBar ( ) {
private JToolBar creatToolBar ( ) {
ToolBarDef toolBarDef = new ToolBarDef ( ) ;
ToolBarDef toolBarDef = new ToolBarDef ( ) ;
toolBarDef . addShortCut ( new PreviewAction ( ) ) ;
toolBarDef . addShortCut ( new PreviewAction ( this ) ) ;
toolBarDef . addShortCut ( new RefreshAction ( ) ) ;
toolBarDef . addShortCut ( new RefreshAction ( ) ) ;
toolBarDef . addShortCut ( SeparatorDef . DEFAULT ) ;
toolBarDef . addShortCut ( SeparatorDef . DEFAULT ) ;
isShareCheckBox = new UICheckBox ( com . fr . design . i18n . Toolkit . i18nText ( "Fine-Design_Basic_Is_Share_DBTableData" ) ) ;
isShareCheckBox = new UICheckBox ( com . fr . design . i18n . Toolkit . i18nText ( "Fine-Design_Basic_Is_Share_DBTableData" ) ) ;
@ -243,7 +243,7 @@ public class ProcedureDataPane extends AbstractTableDataPane<StoreProcedure> imp
this . storeProcedureWorkerListener = null ;
this . storeProcedureWorkerListener = null ;
}
}
private StoreProcedure updateBeanWithOutExecute ( ) {
private StoreProcedure updateBeanWithOutExecute ( ) {
String dbName = connectionTableProcedurePane . getSelectedDatabaseConnnectonName ( ) ;
String dbName = connectionTableProcedurePane . getSelectedDatabaseConnnectonName ( ) ;
@ -266,16 +266,16 @@ public class ProcedureDataPane extends AbstractTableDataPane<StoreProcedure> imp
return sp ;
return sp ;
}
}
@Override
@Override
public StoreProcedure updateBean ( ) {
public StoreProcedure updateBean ( ) {
final StoreProcedure sp = updateBeanWithOutExecute ( ) ;
final StoreProcedure sp = updateBeanWithOutExecute ( ) ;
if ( updateWorker ! = null ) {
if ( updateWorker ! = null ) {
updateWorker . cancel ( true ) ;
updateWorker . cancel ( true ) ;
}
}
updateWorker = new SwingWorker < Void , Void > ( ) {
updateWorker = new SwingWorker < Void , Void > ( ) {
@Override
@Override
protected Void doInBackground ( ) throws Exception {
protected Void doInBackground ( ) throws Exception {
DesignTableDataManager . setThreadLocal ( DesignTableDataManager . NO_PARAMETER ) ;
DesignTableDataManager . setThreadLocal ( DesignTableDataManager . NO_PARAMETER ) ;
@ -284,7 +284,7 @@ public class ProcedureDataPane extends AbstractTableDataPane<StoreProcedure> imp
sp . refreshDataModelListAndResultNames ( dataModels ) ;
sp . refreshDataModelListAndResultNames ( dataModels ) ;
return null ;
return null ;
}
}
@Override
@Override
public void done ( ) {
public void done ( ) {
DesignTableDataManager . setThreadLocal ( DesignTableDataManager . NO_PARAMETER ) ;
DesignTableDataManager . setThreadLocal ( DesignTableDataManager . NO_PARAMETER ) ;
@ -293,7 +293,7 @@ public class ProcedureDataPane extends AbstractTableDataPane<StoreProcedure> imp
fireDSChanged ( ) ;
fireDSChanged ( ) ;
}
}
} ;
} ;
updateWorker . execute ( ) ;
updateWorker . execute ( ) ;
return sp ;
return sp ;
}
}
@ -359,17 +359,20 @@ public class ProcedureDataPane extends AbstractTableDataPane<StoreProcedure> imp
}
}
private class PreviewAction extends UpdateAction {
private class PreviewAction extends UpdateAction {
public PreviewAction ( ) {
ProcedureDataPane procedureDataPane ;
public PreviewAction ( ProcedureDataPane procedureDataPane ) {
this . setName ( PREVIEW_BUTTON ) ;
this . setName ( PREVIEW_BUTTON ) ;
this . setMnemonic ( 'P' ) ;
this . setMnemonic ( 'P' ) ;
this . setSmallIcon ( BaseUtils . readIcon ( "/com/fr/design/images/m_file/preview.png" ) ) ;
this . setSmallIcon ( BaseUtils . readIcon ( "/com/fr/design/images/m_file/preview.png" ) ) ;
this . procedureDataPane = procedureDataPane ;
}
}
@Override
@Override
public void actionPerformed ( ActionEvent evt ) {
public void actionPerformed ( ActionEvent evt ) {
StoreProcedure sp = updateBeanWithOutExecute ( ) ;
StoreProcedure sp = updateBeanWithOutExecute ( ) ;
StoreProcedureDataWrapper storeProcedureDataWrappe = new StoreProcedureDataWrapper ( sp , StringUtils . EMPTY , queryText . getText ( ) ) ;
StoreProcedureDataWrapper storeProcedureDataWrapper = new StoreProcedureDataWrapper ( this . procedureDataPane , sp , StringUtils . EMPTY , queryText . getText ( ) ) ;
storeProcedureDataWrappe . previewData ( StoreProcedureDataWrapper . PREVIEW_ALL ) ;
storeProcedureDataWrapper . previewData ( StoreProcedureDataWrapper . PREVIEW_ALL ) ;
}
}
}
}