diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/LocalWidgetUpdater.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/LocalWidgetUpdater.java index 65e5fcc94..68a3123f7 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/LocalWidgetUpdater.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/LocalWidgetUpdater.java @@ -5,7 +5,6 @@ import com.fr.design.extra.Process; import com.fr.design.login.DesignerLoginHelper; import com.fr.design.login.DesignerLoginSource; import com.fr.design.mainframe.share.collect.ComponentCollector; -import com.fr.design.mainframe.share.ui.local.LocalWidgetRepoUpdater; import com.fr.design.mainframe.share.ui.online.OnlineWidgetRepoPane; import com.fr.design.mainframe.share.util.DownloadUtils; import com.fr.design.mainframe.share.util.ShareComponentUtils; @@ -24,7 +23,6 @@ import java.awt.Component; import java.awt.Container; import java.io.File; import java.io.IOException; -import java.util.concurrent.ExecutionException; /** * @author Starryi @@ -107,7 +105,7 @@ public class LocalWidgetUpdater implements Process { boolean success = false; try { success = get(); - } catch (InterruptedException | ExecutionException e) { + } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); } if (success) { @@ -138,10 +136,11 @@ public class LocalWidgetUpdater implements Process { } public void cancelUpdate() { - if (worker.isDone() || worker.isCancelled()) { - return; + if (worker != null && !worker.isDone()) { + worker.cancel(true); + worker = null; } - worker.cancel(true); + process(-1.0); } @@ -152,7 +151,7 @@ public class LocalWidgetUpdater implements Process { } private void repaintBlockAndOverlay() { - UIUtil.invokeAndWaitIfNeeded(new Runnable() { + UIUtil.invokeLaterIfNeeded(new Runnable() { @Override public void run() { Container absoluteLayoutParent = getAbsoluteLayoutAncestor(widgetBlock);