Unverified Commit 358e6b4c authored by Vladimir Krivosheev's avatar Vladimir Krivosheev
Browse files

WEB-11110 Wrong error message "Built-in HTTP Server on custom port disabled"

parent b5918912
Showing with 7 additions and 2 deletions
+7 -2
......@@ -17,6 +17,11 @@ class BuiltInServerConfigurableUi implements ConfigurableUi<BuiltInServerOptions
public BuiltInServerConfigurableUi() {
portLabel.setLabelFor(builtInServerPort);
builtInServerPort.setMin(1024);
builtInServerPort.addChangeListener(e -> {
boolean isEnabled = builtInServerPort.getNumber() != BuiltInServerOptions.DEFAULT_PORT;
builtInServerAvailableExternallyCheckBox.setEnabled(isEnabled);
builtInServerAvailableExternallyCheckBox.setToolTipText(isEnabled ? null : "Can’t be enabled for default port. Please change it.");
});
}
@Override
......
......@@ -29,7 +29,7 @@ import java.util.Collections;
storages = @Storage("other.xml")
)
public class BuiltInServerOptions implements PersistentStateComponent<BuiltInServerOptions>, Getter<BuiltInServerOptions> {
private static final int DEFAULT_PORT = 63342;
public static final int DEFAULT_PORT = 63342;
@Attribute
public int builtInServerPort = DEFAULT_PORT;
......
......@@ -74,7 +74,7 @@ public class BuiltInServerManagerImpl extends BuiltInServerManager implements Ap
private static int getDefaultPort() {
if (System.getProperty(PROPERTY_RPC_PORT) == null) {
// Default port will be occupied by main idea instance - define the custom default to avoid searching of free port
return ApplicationManager.getApplication().isUnitTestMode() ? 64463 : 63342;
return ApplicationManager.getApplication().isUnitTestMode() ? 64463 : BuiltInServerOptions.DEFAULT_PORT;
}
else {
return Integer.parseInt(System.getProperty(PROPERTY_RPC_PORT));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment