Browse Source
* commit '4ca00f66b6e2879a5a9e0c618ec8a8ce4e278791': KERNEL-6380 漏提交代码 KERNEL-6380 调整下返回点 CHART-17633 地图gis埋点 KERNEL-6380 添加一些注释 KERNEL-6380 修改名称 KERNEL-6380 调整下接口调用 KERNEL-6380 解耦 仅处理插件afterRun生命周期 + 重命名 KERNEL-6154 GeneralXMLTools注册问题 CHART-17357 组合图只有一个图形时的留白问题 REPORT-42240 【10.0.13】设计器里功能描述(表单、组件)优化 feature->release CHART-17661 多层饼图面板 KERNEL-6380 在部分插件切换的时候,需要有一个集中刷新缓存的地方 KERNEL-6380 格式调整 KERNEL-6380 在部分插件切换的时候,需要有一个集中刷新缓存的地方 CHART-17573 && CHART-17567 && CHART-17434 bugfix 修改定位点文案 KERNEL-6380 在部分插件切换的时候,需要有一个集中刷新缓存的地方feature/big-screen
zheng
4 years ago
26 changed files with 376 additions and 119 deletions
@ -0,0 +1,78 @@
|
||||
package com.fr.design; |
||||
|
||||
import com.fr.design.constants.DesignerLaunchStatus; |
||||
import com.fr.design.file.HistoryTemplateListCache; |
||||
import com.fr.design.fun.HyperlinkProvider; |
||||
import com.fr.design.fun.TableDataDefineProvider; |
||||
import com.fr.plugin.observer.PluginEvent; |
||||
import com.fr.plugin.observer.PluginEventListener; |
||||
import com.fr.plugin.observer.PluginEventType; |
||||
import com.fr.plugin.observer.PluginListenerRegistration; |
||||
import java.util.HashSet; |
||||
import java.util.Set; |
||||
|
||||
/** |
||||
* |
||||
* @author hades |
||||
* @version 10.0 |
||||
* Created by hades on 2020/12/17 |
||||
*/ |
||||
public class PluginClassRefreshManager { |
||||
|
||||
|
||||
private static final PluginClassRefreshManager INSTANCE = new PluginClassRefreshManager(); |
||||
|
||||
private final Set<String> context = new HashSet<>(); |
||||
|
||||
private final PluginEventListener pluginAfterRunEventListener = new PluginEventListener() { |
||||
@Override |
||||
public void on(PluginEvent event) { |
||||
// 兼容之前版本特性
|
||||
for (String tag : context) { |
||||
if (event.getContext().contain(tag)) { |
||||
HistoryTemplateListCache.getInstance().reloadAllEditingTemplate(); |
||||
return; |
||||
} |
||||
} |
||||
// 重新载入模板xml内容 到 Workbook/Form对象中
|
||||
HistoryTemplateListCache.getInstance().reloadAllEditingTemplateByPlugin(event.getContext()); |
||||
} |
||||
}; |
||||
|
||||
|
||||
public static PluginClassRefreshManager getInstance() { |
||||
return INSTANCE; |
||||
} |
||||
|
||||
public void load() { |
||||
context.add(TableDataDefineProvider.XML_TAG); |
||||
context.add(HyperlinkProvider.XML_TAG); |
||||
} |
||||
|
||||
private PluginClassRefreshManager() { |
||||
PluginListenerRegistration.getInstance().listen(PluginEventType.BeforeAllActive, new PluginEventListener() { |
||||
@Override |
||||
public void on(PluginEvent event) { |
||||
removePluginListener(); |
||||
} |
||||
}); |
||||
PluginListenerRegistration.getInstance().listen(PluginEventType.AfterAllActive, new PluginEventListener() { |
||||
@Override |
||||
public void on(PluginEvent event) { |
||||
addPluginListener(); |
||||
if (DesignerLaunchStatus.getStatus() != DesignerLaunchStatus.WORKSPACE_INIT_COMPLETE) { |
||||
HistoryTemplateListCache.getInstance().reloadAllEditingTemplate(); |
||||
} |
||||
} |
||||
}); |
||||
} |
||||
|
||||
public void removePluginListener() { |
||||
PluginListenerRegistration.getInstance().stopListen(this.pluginAfterRunEventListener); |
||||
} |
||||
|
||||
public void addPluginListener() { |
||||
PluginListenerRegistration.getInstance().listen(PluginEventType.AfterRun, this.pluginAfterRunEventListener); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,29 @@
|
||||
package com.fr.base; |
||||
|
||||
import com.fr.form.main.Form; |
||||
import com.fr.invoke.ClassHelper; |
||||
import com.fr.main.impl.WorkBook; |
||||
import java.util.Set; |
||||
import junit.framework.TestCase; |
||||
import org.junit.Assert; |
||||
|
||||
|
||||
/** |
||||
* @author hades |
||||
* @version 10.0 |
||||
* Created by hades on 2020/12/28 |
||||
*/ |
||||
public class ClassHelperTest extends TestCase { |
||||
|
||||
|
||||
public void testGetClassLoaders() { |
||||
WorkBook workBook = new WorkBook(); |
||||
Set<ClassLoader> set = ClassHelper.getClassLoaders(workBook); |
||||
Assert.assertFalse(set.isEmpty()); |
||||
Form form = new Form(); |
||||
Set<ClassLoader> set1 = ClassHelper.getClassLoaders(form); |
||||
Assert.assertFalse(set1.isEmpty()); |
||||
|
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue