Browse Source

Pull request #4806: REPORT-53699 启动设计器时模板提示插件未启用

Merge in DESIGN/design from ~VITO/c-design:bugfix/10.0 to bugfix/10.0

* commit '2cafff639d7c0a50e97dea693b14ba31bd55c2b1':
  REPORT-53699 启动设计器时模板提示插件未启用
bugfix/10.0
vito 3 years ago
parent
commit
b4193e16ac
  1. 22
      designer-realize/src/main/java/com/fr/design/mainframe/app/DesignerAppUtils.java
  2. 2
      designer-realize/src/main/java/com/fr/start/module/DesignerInitActivator.java

22
designer-realize/src/main/java/com/fr/design/mainframe/app/DesignerAppUtils.java

@ -16,6 +16,10 @@ import com.fr.plugin.manage.PluginManager;
import com.fr.plugin.manage.control.PluginControllerHelper; import com.fr.plugin.manage.control.PluginControllerHelper;
import com.fr.plugin.manage.control.PluginExtraInfo; import com.fr.plugin.manage.control.PluginExtraInfo;
import com.fr.plugin.manage.control.PluginTask; import com.fr.plugin.manage.control.PluginTask;
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 com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.stable.TemplateIOErrorContextHolder; import com.fr.stable.TemplateIOErrorContextHolder;
import com.fr.third.guava.cache.Cache; import com.fr.third.guava.cache.Cache;
@ -39,6 +43,7 @@ public class DesignerAppUtils {
private static final int DEFAULT_MAX_CACHE_SIZE = 50; private static final int DEFAULT_MAX_CACHE_SIZE = 50;
private static final int DEFAULT_CONCURRENCY_LEVEL = 8; private static final int DEFAULT_CONCURRENCY_LEVEL = 8;
private static final long DEFAULT_EXPIRE_HOURS = 1; private static final long DEFAULT_EXPIRE_HOURS = 1;
private static boolean enablePluginTipDialog = true;
private static final Cache<String, Multimap<String, PluginMarkerAdapter>> ERROR_CACHE = CacheBuilder.newBuilder() private static final Cache<String, Multimap<String, PluginMarkerAdapter>> ERROR_CACHE = CacheBuilder.newBuilder()
.maximumSize(DEFAULT_MAX_CACHE_SIZE) .maximumSize(DEFAULT_MAX_CACHE_SIZE)
@ -46,6 +51,21 @@ public class DesignerAppUtils {
.concurrencyLevel(DEFAULT_CONCURRENCY_LEVEL) .concurrencyLevel(DEFAULT_CONCURRENCY_LEVEL)
.build(); .build();
public static void initPluginAllActiveListener() {
PluginListenerRegistration.getInstance().listen(PluginEventType.BeforeAllActive, new PluginEventListener() {
@Override
public void on(PluginEvent event) {
enablePluginTipDialog = false;
}
});
PluginListenerRegistration.getInstance().listen(PluginEventType.AfterAllActive, new PluginEventListener() {
@Override
public void on(PluginEvent event) {
enablePluginTipDialog = true;
}
});
}
/** /**
* 弹出指定的插件信息 * 弹出指定的插件信息
* 并失效缓存 * 并失效缓存
@ -77,7 +97,7 @@ public class DesignerAppUtils {
* @return 格式化后的多行插件错误信息详情 * @return 格式化后的多行插件错误信息详情
*/ */
public static String dealWithErrorDetailMultiLineAndCache(String key) { public static String dealWithErrorDetailMultiLineAndCache(String key) {
if (!DesignerEnvManager.getEnvManager().isShowTemplateMissingPlugin()) { if (!DesignerEnvManager.getEnvManager().isShowTemplateMissingPlugin() || !enablePluginTipDialog) {
// 直接清空不提示 // 直接清空不提示
TemplateIOErrorContextHolder.reset(); TemplateIOErrorContextHolder.reset();
return StringUtils.EMPTY; return StringUtils.EMPTY;

2
designer-realize/src/main/java/com/fr/start/module/DesignerInitActivator.java

@ -1,6 +1,7 @@
package com.fr.start.module; package com.fr.start.module;
import com.fr.design.PluginClassRefreshManager; import com.fr.design.PluginClassRefreshManager;
import com.fr.design.mainframe.app.DesignerAppUtils;
import com.fr.module.Activator; import com.fr.module.Activator;
import com.fr.start.DesignerInitial; import com.fr.start.DesignerInitial;
@ -17,6 +18,7 @@ public class DesignerInitActivator extends Activator {
@Override @Override
public void start() { public void start() {
PluginClassRefreshManager.getInstance().load(); PluginClassRefreshManager.getInstance().load();
DesignerAppUtils.initPluginAllActiveListener();
DesignerInitial.init(findSingleton(StartupArgs.class).get()); DesignerInitial.init(findSingleton(StartupArgs.class).get());
} }

Loading…
Cancel
Save