|
|
|
@ -5,12 +5,16 @@ 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; |
|
|
|
|
import com.fr.design.ui.util.UIUtil; |
|
|
|
|
import com.fr.form.share.DefaultSharableWidget; |
|
|
|
|
import com.fr.form.share.Group; |
|
|
|
|
import com.fr.form.share.GroupManege; |
|
|
|
|
import com.fr.form.share.SharableWidgetProvider; |
|
|
|
|
import com.fr.form.share.group.DefaultShareGroupManager; |
|
|
|
|
import com.fr.log.FineLoggerFactory; |
|
|
|
|
import com.fr.stable.StableUtils; |
|
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
@ -106,6 +110,9 @@ public class LocalWidgetUpdater implements Process<Double> {
|
|
|
|
|
} catch (InterruptedException | ExecutionException e) { |
|
|
|
|
FineLoggerFactory.getLogger().error(e.getMessage(), e); |
|
|
|
|
} |
|
|
|
|
if (success) { |
|
|
|
|
resetWidgetOfBlock(); |
|
|
|
|
} |
|
|
|
|
if (updateListener != null) { |
|
|
|
|
updateListener.onUpdated(success, getGroup().getGroupName(), widget.getId()); |
|
|
|
|
} |
|
|
|
@ -115,6 +122,21 @@ public class LocalWidgetUpdater implements Process<Double> {
|
|
|
|
|
worker.execute(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void resetWidgetOfBlock() { |
|
|
|
|
GroupManege groupManege = DefaultShareGroupManager.getInstance(); |
|
|
|
|
Group group = groupManege.getGroup(getGroup().getGroupName()); |
|
|
|
|
if (group != null) { |
|
|
|
|
String id = widgetBlock.getWidgetUuid(); |
|
|
|
|
if (StringUtils.isNotEmpty(id)) { |
|
|
|
|
SharableWidgetProvider localLatestWidget = group.getElCaseBindInfoById(widgetBlock.getWidgetUuid()); |
|
|
|
|
if (localLatestWidget instanceof DefaultSharableWidget) { |
|
|
|
|
widgetBlock.widget = (DefaultSharableWidget) localLatestWidget; |
|
|
|
|
repaintBlockAndOverlay(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void cancelUpdate() { |
|
|
|
|
if (worker.isDone() || worker.isCancelled()) { |
|
|
|
|
return; |
|
|
|
@ -126,7 +148,10 @@ public class LocalWidgetUpdater implements Process<Double> {
|
|
|
|
|
@Override |
|
|
|
|
public void process(Double processValue) { |
|
|
|
|
this.processValue = processValue; |
|
|
|
|
repaintBlockAndOverlay(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void repaintBlockAndOverlay() { |
|
|
|
|
UIUtil.invokeAndWaitIfNeeded(new Runnable() { |
|
|
|
|
@Override |
|
|
|
|
public void run() { |
|
|
|
|