Browse Source

Pull request #2013: REPORT-36404 远程-服务器断开后设计器未弹出工作目录选择框

Merge in DESIGN/design from ~HADES/design:release/10.0 to release/10.0

* commit 'b170de527b7a3b7f3fc56f0c7d0abcae24127480':
  REPORT-36404 远程-服务器断开后设计器未弹出工作目录选择框
feature/big-screen
Hades 4 years ago
parent
commit
f975d2e05f
  1. 38
      designer-base/src/main/java/com/fr/env/RemoteEnvPane.java

38
designer-base/src/main/java/com/fr/env/RemoteEnvPane.java vendored

@ -44,6 +44,7 @@ import java.awt.event.MouseEvent;
import java.awt.event.WindowAdapter; import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent; import java.awt.event.WindowEvent;
import java.io.File; import java.io.File;
import java.util.function.Supplier;
import static com.fr.design.layout.TableLayout.FILL; import static com.fr.design.layout.TableLayout.FILL;
import static com.fr.design.layout.TableLayout.PREFERRED; import static com.fr.design.layout.TableLayout.PREFERRED;
@ -439,20 +440,29 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
* 设置 app servlet 默认值 * 设置 app servlet 默认值
*/ */
private void setDefaultAppAndServlet() { private void setDefaultAppAndServlet() {
String appName; setWrap(webAppNameInput, () -> FRContext.getCommonOperator().getAppName(), RemoteWorkspaceURL.DEFAULT_WEB_APP_NAME);
String servletName; setWrap(servletNameInput, () -> ServerConfig.getInstance().getServletName(), RemoteWorkspaceURL.DEFAULT_SERVLET_NAME);
try { }
appName = FRContext.getCommonOperator().getAppName();
} catch (Exception ignored) { private void setWrap(final UITextField textField, final Supplier<String> supplier, final String defaultName) {
appName = RemoteWorkspaceURL.DEFAULT_WEB_APP_NAME; new SwingWorker<String, Void>() {
}
try { @Override
servletName = ServerConfig.getInstance().getServletName(); protected String doInBackground() throws Exception {
} catch (Exception ignored) { return supplier.get();
servletName = RemoteWorkspaceURL.DEFAULT_SERVLET_NAME; }
}
webAppNameInput.setText(appName); @Override
servletNameInput.setText(servletName); protected void done() {
String name = defaultName;
try {
name = get();
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage() , e);
}
textField.setText(name);
}
}.execute();
} }

Loading…
Cancel
Save