Browse Source

REPORT-78886【迭代】【起始页】起始页配置问题

1、兼容 1107
2、起始页逻辑补充
feature/x
Harrison 2 years ago
parent
commit
d19dc92201
  1. 9
      designer-base/src/main/java/com/fr/start/common/DesignerStartupConfig.java
  2. 14
      designer-base/src/main/java/com/fr/start/common/DesignerStartupContext.java

9
designer-base/src/main/java/com/fr/start/common/DesignerStartupConfig.java

@ -12,6 +12,11 @@ public class DesignerStartupConfig implements XMLable {
private static final DesignerStartupConfig INSTANCE = new DesignerStartupConfig();
/**
* 加上版本不然回滚到 1107 会有兼容问题
*/
private static final String TAG_ENABLED = "isEnabled1108";
public static DesignerStartupConfig getInstance() {
return INSTANCE;
@ -40,14 +45,14 @@ public class DesignerStartupConfig implements XMLable {
@Override
public void readXML(XMLableReader reader) {
if (reader.isAttr()) {
this.setEnabled(reader.getAttrAsBoolean("isEnabled", true));
this.setEnabled(reader.getAttrAsBoolean(TAG_ENABLED, true));
}
}
@Override
public void writeXML(XMLPrintWriter writer) {
writer.startTAG(XML_TAG);
writer.attr("isEnabled", this.isEnabled());
writer.attr(TAG_ENABLED, this.isEnabled());
writer.end();
}

14
designer-base/src/main/java/com/fr/start/common/DesignerStartupContext.java

@ -117,7 +117,7 @@ public class DesignerStartupContext {
/**
* 展示启动页
* 1. 判断当前的工作目录数量
* 1. 判断当前的工作目录数量为空或者为1
* 2. 判断是否是 demo还是打开目标文件
* 3. 功能是否开启
*
@ -125,10 +125,20 @@ public class DesignerStartupContext {
*/
public boolean isShowStartupPage() {
DesignerEnvManager envManager = DesignerEnvManager.getEnvManager();
return !startupArgs.isDemo() && DesignerStartupUtil.convertArgs2FILE(startupArgs.get()) == null
// 见该 field 的注释
&& enabled
&& isWorkspaceValid()
&& envManager.isStartupPageEnabled();
}
private boolean isWorkspaceValid() {
DesignerEnvManager envManager = DesignerEnvManager.getEnvManager();
Iterator<String> envNameIterator = envManager.getEnvNameIterator();
ArrayList<String> envs = Lists.newArrayList(envNameIterator);
return !startupArgs.isDemo() && DesignerStartupUtil.convertArgs2FILE(startupArgs.get()) == null && !envs.isEmpty() && (envs.size() != 1) && envManager.isStartupPageEnabled() && enabled;
return !envs.isEmpty() && (envs.size() != 1);
}
/* 预热相关 */

Loading…
Cancel
Save