Browse Source

更新:将两个SwingWorker合并,将注释掉的代码和多余的逻辑删除

feature/big-screen
Yvan 4 years ago
parent
commit
60a4995b0f
  1. 15
      designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/StoreProcedureDataWrapper.java

15
designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/StoreProcedureDataWrapper.java

@ -169,16 +169,6 @@ public final class StoreProcedureDataWrapper implements TableDataWrapper {
*/
public void previewData(final int previewModel) {
this.previewModel = previewModel;
new SwingWorker() {
protected Object doInBackground() throws Exception {
loadingBar.close();
PreviewTablePane.resetPreviewTable();
// REPORT-40822 这里的dialog是个空界面,这里设置成可见之后,后面又会设置成不可见,造成闪屏
//dialog.setVisible(true);
return null;
}
}.execute();
connectionBar = new AutoProgressBar(dialog, Toolkit.i18nText("Fine-Design_Basic_Utils_Now_Create_Connection"), "", 0, 100) {
public void doMonitorCanceled() {
connectionBar.close();
@ -191,12 +181,12 @@ public final class StoreProcedureDataWrapper implements TableDataWrapper {
private void setWorker() {
worker = new SwingWorker<Void, Void>() {
protected Void doInBackground() throws Exception {
loadingBar.close();
PreviewTablePane.resetPreviewTable();
connectionBar.start();
boolean status = DataOperator.getInstance().testConnection(((StoreProcedure) getTableData()).getDatabaseConnection());
if (!status) {
connectionBar.close();
// bug 61345 预览失败时,关闭窗口
dialog.setVisible(false);
throw new Exception(Toolkit.i18nText("Fine-Design_Basic_Database_Connection_Failed"));
}
connectionBar.close();
@ -209,7 +199,6 @@ public final class StoreProcedureDataWrapper implements TableDataWrapper {
try {
get();
loadingBar.close();
dialog.setVisible(false);
switch (previewModel) {
case StoreProcedureDataWrapper.PREVIEW_ALL:
PreviewTablePane.previewStoreDataWithAllDs(dataModels);

Loading…
Cancel
Save