Browse Source

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

feature/big-screen
hades 4 years ago
parent
commit
b170de527b
  1. 32
      designer-base/src/main/java/com/fr/env/RemoteEnvPane.java

32
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>() {
@Override
protected String doInBackground() throws Exception {
return supplier.get();
} }
@Override
protected void done() {
String name = defaultName;
try { try {
servletName = ServerConfig.getInstance().getServletName(); name = get();
} catch (Exception ignored) { } catch (Exception e) {
servletName = RemoteWorkspaceURL.DEFAULT_SERVLET_NAME; FineLoggerFactory.getLogger().error(e.getMessage() , e);
}
textField.setText(name);
} }
webAppNameInput.setText(appName); }.execute();
servletNameInput.setText(servletName);
} }

Loading…
Cancel
Save