forked from fanruan/design
Browse Source
* commit 'ef88c54c254e107150d5e3f742d9f55eec99e688': REPORT-52942 处理插件提到公共模块稍后展示 REPORT-51678 事件配置项支持重命名 REPORT-52928 部分埋点没有记录 REPORT-52895 部分埋点没有记录 REPORT-52818 图表块点击快捷配置触发了编辑效果 REPORT-52816 编辑框对齐 REPORT-52819 加密组件加载相关逻辑补充feature/big-screen
superman
4 years ago
17 changed files with 179 additions and 86 deletions
@ -0,0 +1,13 @@
|
||||
package com.fr.design.mainframe.share.util; |
||||
|
||||
import com.fr.form.share.encrypt.engine.SharableReadHelper; |
||||
import com.fr.stable.xml.XMLConf; |
||||
import com.fr.stable.xml.helper.XMLReadHelper; |
||||
|
||||
public class SharableXMLUtils { |
||||
public static synchronized void registerSharableReadHelper() { |
||||
XMLReadHelper readHelper = XMLConf.getReadHelper(); |
||||
XMLReadHelper helper = new SharableReadHelper(readHelper); |
||||
XMLConf.registerXMLHelper(helper); |
||||
} |
||||
} |
@ -0,0 +1,83 @@
|
||||
package com.fr.design.mainframe.app; |
||||
|
||||
import com.fr.design.dialog.DialogActionAdapter; |
||||
import com.fr.design.dialog.UIExpandDialog; |
||||
import com.fr.design.extra.exe.callback.InstallOnlineCallback; |
||||
import com.fr.design.extra.exe.callback.ModifyStatusCallback; |
||||
import com.fr.design.i18n.Toolkit; |
||||
import com.fr.design.mainframe.DesignerContext; |
||||
import com.fr.design.ui.util.UIUtil; |
||||
import com.fr.io.TemplateIOErrorUtils; |
||||
import com.fr.plugin.context.PluginMarker; |
||||
import com.fr.plugin.context.PluginMarkerAdapter; |
||||
import com.fr.plugin.manage.PluginManager; |
||||
import com.fr.plugin.manage.control.PluginControllerHelper; |
||||
import com.fr.plugin.manage.control.PluginTask; |
||||
import com.fr.third.guava.collect.Multimap; |
||||
import com.fr.workspace.WorkContext; |
||||
|
||||
import java.util.Collection; |
||||
|
||||
/** |
||||
* 设计器app共用工具类 |
||||
* |
||||
* @author vito |
||||
* @version 10.0 |
||||
* Created by vito on 2021/5/27 |
||||
*/ |
||||
public class DesignerAppUtils { |
||||
|
||||
/** |
||||
* 处理模板读取时的异常 |
||||
* |
||||
* @param path 模板路径 |
||||
*/ |
||||
public static void dealWithTemplateIOError(String path) { |
||||
// 试图获取多行读取错误提示并缓存待处理列表
|
||||
String detail = TemplateIOErrorUtils.dealWithErrorDetailMultiLineAndCache(path); |
||||
if (detail.length() > 0) { |
||||
UIUtil.invokeLaterIfNeeded(() -> { |
||||
if (WorkContext.getCurrent().isLocal()) { |
||||
UIExpandDialog.Builder() |
||||
.owner(DesignerContext.getDesignerFrame()) |
||||
.title(Toolkit.i18nText("Fine-Design_Basic_Tool_Tips")) |
||||
.message(Toolkit.i18nText("Fine-Design_Template_Plugin_Error_Message_Local")) |
||||
.detail(detail) |
||||
.okText(Toolkit.i18nText("Fine-Design_Template_Plugin_Error_OK_Btn")) |
||||
.cancelText(Toolkit.i18nText("Fine-Design_Template_Plugin_Error_Cancel_Btn")) |
||||
.dialogActionListener(new DialogActionAdapter() { |
||||
public void doOk() { |
||||
installAndEnablePlugin(path); |
||||
} |
||||
|
||||
@Override |
||||
public void doCancel() { |
||||
TemplateIOErrorUtils.invalidatePlugins(path); |
||||
} |
||||
}).build().setVisible(true); |
||||
} else { |
||||
UIExpandDialog.Builder().owner(DesignerContext.getDesignerFrame()) |
||||
.title(Toolkit.i18nText("Fine-Design_Basic_Tool_Tips")) |
||||
.message(Toolkit.i18nText("Fine-Design_Template_Plugin_Error_Message_Remote")) |
||||
.detail(detail) |
||||
.build() |
||||
.setVisible(true); |
||||
} |
||||
}); |
||||
} |
||||
} |
||||
|
||||
private static void installAndEnablePlugin(String key) { |
||||
Multimap<String, PluginMarkerAdapter> stringPluginMarkerAdapterMultimap = TemplateIOErrorUtils.popPluginInfoMap(key); |
||||
Collection<PluginMarkerAdapter> disablePlugins = stringPluginMarkerAdapterMultimap.get(TemplateIOErrorUtils.DISABLE_PLUGIN); |
||||
for (PluginMarkerAdapter disablePlugin : disablePlugins) { |
||||
PluginManager.getController().enable(disablePlugin, new ModifyStatusCallback(false)); |
||||
} |
||||
|
||||
Collection<PluginMarkerAdapter> uninstallPlugins = stringPluginMarkerAdapterMultimap.get(TemplateIOErrorUtils.NOT_INSTALLED_PLUGIN); |
||||
for (PluginMarker uninstallPlugin : uninstallPlugins) { |
||||
PluginTask pluginTask = PluginTask.installTask(uninstallPlugin); |
||||
PluginControllerHelper.installOnline(uninstallPlugin, new InstallOnlineCallback(pluginTask)); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,11 @@
|
||||
package com.fr.design.share; |
||||
|
||||
import com.fr.design.mainframe.share.collect.SharableCollectorManager; |
||||
import com.fr.design.mainframe.share.util.SharableXMLUtils; |
||||
|
||||
public class SharableInitManager { |
||||
public static void start() { |
||||
SharableXMLUtils.registerSharableReadHelper(); |
||||
SharableCollectorManager.getInstance().execute(); |
||||
} |
||||
} |
Loading…
Reference in new issue