forked from fanruan/design
Browse Source
* commit 'de729d8231a641c4f7e5082d26f7220e560151b2': REPORT-46268 frm中途添加的模板参数,识别不到 发现前面的jwb的几个更新操作其实跟DesignModelAdapter的fireTargetModified()和parameterChanged()重复了,并且parameterChanged()中比上面的jwb的操作还多了个更新ParameterPropertyPane,debug了下发现这也是个必要操作,如果不随着更新会造成一些问题,但是还没有测试测出来,所以其实这里之前就是全量更新的,关于hades说的数据集参数更新的问题,感觉可以后面再提个任务,统一在DesignModelAdapter.getCurrentModelAdapter().parameterChanged()方法中处理 REPORT-46268 frm中途添加的模板参数,识别不到 【问题原因】过滤条件中的参数是从DesignModelAdapter中拿的,但是frm表单在添加了模板参数之后没有通知DesignModelAdapter更新参数,最初第一个参数p1能拿到的原因是设置了模板参数后,有个添加数据集的操作,而操作了数据集之后会更新DesignModelAdapter中存的参数,所以表现为只能看到p1 【改动思路】在表单添加模板参数的TemplateParameterAction中,添加通知DesignModelAdapter更新参数的逻辑 REPORT-45775 决策报表参数面板控件可以复制到另一个参数面板--来源【客户需求 510651】 KERNEL-6380 调整下返回点 CHART-17633 地图gis埋点 KERNEL-6380 添加一些注释 KERNEL-6380 修改名称 KERNEL-6380 调整下接口调用 KERNEL-6380 解耦 仅处理插件afterRun生命周期 + 重命名 KERNEL-6154 GeneralXMLTools注册问题 REPORT-46102 产品改进,水印面板不能直接输入文字,必须在弹出的公式面板下才能编辑 CHART-17357 组合图只有一个图形时的留白问题 REPORT-42240 【10.0.13】设计器里功能描述(表单、组件)优化 feature->release KERNEL-6380 在部分插件切换的时候,需要有一个集中刷新缓存的地方 KERNEL-6380 格式调整 KERNEL-6380 在部分插件切换的时候,需要有一个集中刷新缓存的地方 KERNEL-6380 在部分插件切换的时候,需要有一个集中刷新缓存的地方persist/11.0
superman
4 years ago
16 changed files with 245 additions and 78 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