Browse Source

Pull request #9107: REPORT-72831 设计器环境检测-设计器正常的,但是抛出异常了

Merge in DESIGN/design from ~HARRISON/design:feature/x to feature/x

* commit '09c7d6c6c414d0850ad2d58d6e226b005a8bb795':
  REPORT-72831 设计器环境检测-设计器正常的,但是抛出异常了 1-修复抛出异常,写反了 2-修改一个 Activator 的名字和启动项 3-修改 重新检测的时候的 UI 界面 4-修复小部分自己发现的问题
feature/x
Harrison 3 years ago
parent
commit
c0ef48b65d
  1. 3
      designer-base/src/main/java/com/fr/env/EnvPrepare.java
  2. 21
      designer-base/src/main/java/com/fr/env/detect/EnvDetectorCenter.java
  3. 5
      designer-base/src/main/java/com/fr/env/detect/base/DetectorBridge.java
  4. 3
      designer-base/src/main/java/com/fr/env/detect/impl/JarLackDetector.java
  5. 9
      designer-base/src/main/java/com/fr/env/detect/impl/converter/ClassConflictConvertor.java
  6. 13
      designer-base/src/main/java/com/fr/env/detect/ui/EnvDetectorDialog.java

3
designer-base/src/main/java/com/fr/env/detect/EnvPrepare.java → designer-base/src/main/java/com/fr/env/EnvPrepare.java vendored

@ -1,5 +1,6 @@
package com.fr.env.detect;
package com.fr.env;
import com.fr.env.detect.EnvDetectorCenter;
import com.fr.module.Activator;
/**

21
designer-base/src/main/java/com/fr/env/detect/EnvDetectorCenter.java vendored

@ -10,6 +10,7 @@ import com.fr.design.mainframe.DesignerContext;
import com.fr.design.ui.util.UIUtil;
import com.fr.env.detect.base.DetectorBridge;
import com.fr.env.detect.base.DetectorUtil;
import com.fr.env.detect.base.EnvDetectorConfig;
import com.fr.env.detect.bean.DetectorResult;
import com.fr.env.detect.bean.DetectorStatus;
import com.fr.event.Event;
@ -51,6 +52,14 @@ public class EnvDetectorCenter {
*/
public void init() {
// 重置逻辑
DetectorBridge.getInstance().reset();
// 如果已经启动了,则不再启动
if (PROCESS.get() != null) {
return;
}
// 默认是启动
PROCESS.set(DetectorProcess.DESIGN_LAUNCH);
start();
@ -121,14 +130,18 @@ public class EnvDetectorCenter {
*/
public void stop() {
// 一分钟后执行
// 结束
DetectorBridge.getInstance().stop();
// 30s后执行
DelayHelper.delayCall(EnvDetectorCenter.class.getName(), () -> {
// 如果当前没开启,则直接返回
if (!EnvDetectorConfig.getInstance().isEnabled()) {
return;
}
Stream<DetectorResult> resultStream = DetectorBridge.getInstance().detect();
// 结束
DetectorBridge.getInstance().stop();
// 展示效果
NotificationDialogProperties properties = new NotificationDialogProperties(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Basic_Detect_Notification_Title"));
List<NotificationModel> notificationModels = resultStream

5
designer-base/src/main/java/com/fr/env/detect/base/DetectorBridge.java vendored

@ -71,6 +71,11 @@ public class DetectorBridge {
}
}
public void reset() {
ThrowableStore.getInstance().reset();
}
/**
* 针对某一项进行检测
* 主要用于手动检测时

3
designer-base/src/main/java/com/fr/env/detect/impl/JarLackDetector.java vendored

@ -78,7 +78,8 @@ public class JarLackDetector extends AbstractExceptionDetector {
}
private boolean isLackInfo(BuildInfo e) {
return StringUtils.isNotEmpty(e.getGroupBuild());
return StringUtils.isEmpty(e.getGroupBuild());
}
private Message tipsMessage(List<BuildInfo> infos) {

9
designer-base/src/main/java/com/fr/env/detect/impl/converter/ClassConflictConvertor.java vendored

@ -110,13 +110,18 @@ public class ClassConflictConvertor implements ThrowableConverter {
}
}
// 如果少于两个,则不需要提示
if (allPath.size() < 2) {
return null;
}
String msg = StringUtils.join(allPath, SEPARATOR);
DetectorType type = DetectorType.JAR_CONFLICT;
return DetectorResult.exception(type,
ExceptionTips.create(Toolkit.i18nText(type.getTipsLocale(), msg)),
ExceptionTips.create(Toolkit.i18nText(type.getTipsLocale()) + msg),
ExceptionSolution.create(Toolkit.i18nText(type.getSolutionLocale()), DetectorConstants.JAR_HELP_LINK, null),
ExceptionLog.create(Toolkit.i18nText(type.getLogLocale()), msg));
ExceptionLog.create(Toolkit.i18nText(type.getLogLocale()) + msg));
}
@NotNull

13
designer-base/src/main/java/com/fr/env/detect/ui/EnvDetectorDialog.java vendored

@ -167,6 +167,10 @@ public class EnvDetectorDialog extends JDialog {
private void startDetecting(UIButton detectButton) {
// 重新检测的时候需要处理一些逻辑
if (buttonStatus == EnvDetectorButtonStatus.A_NEW) {
reInit();
}
// 执行前
buttonStatus = buttonStatus.next();
UIUtil.invokeLaterIfNeeded(() -> detectButton.setText(buttonStatus.getDesc()));
@ -222,6 +226,15 @@ public class EnvDetectorDialog extends JDialog {
detectWorker.execute();
}
private void reInit() {
currentDetectIndex = 0;
for (EnvDetectorItem e : model.getItems()) {
e.setResult(null);
}
// 刷新一下面板-开始执行啦
UIUtil.invokeLaterIfNeeded(EnvDetectorDialog.this::refresh);
}
private void stopDetecting(UIButton detectButton) {
buttonStatus = buttonStatus.next();

Loading…
Cancel
Save