Browse Source

REPORT-9480 & REPORT-9159

master
Mata.Li 7 years ago
parent
commit
3c20a24f0d
  1. 3
      designer-base/src/main/java/com/fr/design/DesignerEnvManager.java
  2. 64
      designer-base/src/main/java/com/fr/start/ServerStarter.java
  3. 9
      designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java

3
designer-base/src/main/java/com/fr/design/DesignerEnvManager.java

@ -534,7 +534,8 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
private String getDefaultenvPath(String installHome){
return StableUtils.pathJoin(installHome, WEB_NAME, ProjectConstants.WEBAPP_NAME, ProjectConstants.WEBINF_NAME);
//这里需要转成反斜杠和生成默认路径一致
return new File(StableUtils.pathJoin(installHome, WEB_NAME, ProjectConstants.WEBAPP_NAME, ProjectConstants.WEBINF_NAME)).getPath();
}
/**
* 设置当前环境为默认

64
designer-base/src/main/java/com/fr/start/ServerStarter.java

@ -50,26 +50,6 @@ public class ServerStarter {
}
public static void switchWorkContext(){
DesignerEnvManager envManager = DesignerEnvManager.getEnvManager();
if (!envManager.isCurrentEnvDefault()) {
InformationPane inf = new InformationPane(envManager.getDefaultEnvName());
inf.showSmallWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() {
@Override
public void doOk() {
try {
WorkContext.switchTo(DesignerWorkspaceGenerator.generate(DesignerEnvManager.getEnvManager().getDefaultConfig()));
TemplateTreePane.getInstance().refreshDockingView();
TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter());
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage());
}
}
}).setVisible(true);
}
}
private static void initDemoServerAndBrowser() {
@ -126,49 +106,5 @@ public class ServerStarter {
}
}
private static class InformationPane extends BasicPane {
private static final long serialVersionUID = 1L;
private static final int FREE_STYLE_TOP = 15;
private static final int FREE_STYLE_OTHER = 5;
InformationPane(String message) {
init(message);
}
private void init(String message) {
this.setLayout(new BorderLayout(10, 10));
this.setBorder(BorderFactory.createEmptyBorder(FREE_STYLE_TOP, FREE_STYLE_OTHER, FREE_STYLE_OTHER, FREE_STYLE_OTHER));
String text;
if (!ComparatorUtils.equals(message, Inter.getLocText(new String[]{"Default", "Utils-Report_Runtime_Env"}))) {
text = Inter.getLocText("FR-Designer_Open") +
ProductConstants.APP_NAME +
Inter.getLocText("FR-Designer_Utils-OpenDemoEnv") +
message + Inter.getLocText("FR-Designer_Utils-switch");
} else {
text = Inter.getLocText("FR-Designer_Open") +
ProductConstants.APP_NAME +
Inter.getLocText("FR-Designer_Utils-NewDemoEnv") +
message + Inter.getLocText("FR-Designer_Utils-switch");
}
UITextArea a = new UITextArea(text);
a.setFont(new Font("Dialog", Font.PLAIN, 12));
a.setEditable(false);
a.setBackground(this.getBackground());
a.setLineWrap(true);
this.add(a);
}
@Override
protected String title4PopupWindow() {
return Inter.getLocText("FR-Designer_Tooltips");
}
}
}

9
designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java

@ -53,15 +53,6 @@ public class DesignerStartup extends Activator {
DesignerContext.getDesignerFrame().getProgressDialog().setVisible(true);
//需要切换工作目录的弹窗放在打开设计器后,以免被挡住
if (args != null) {
for (String arg : args) {
if (ComparatorUtils.equals(arg, "demo")) {
ServerStarter.switchWorkContext();
break;
}
}
}
startSub(StartFinishActivator.class);
}

Loading…
Cancel
Save