|
|
@ -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); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|