diff options
Diffstat (limited to 'platform/remote-servers/impl/src/com/intellij/remoteServer/impl')
3 files changed, 21 insertions, 22 deletions
diff --git a/platform/remote-servers/impl/src/com/intellij/remoteServer/impl/configuration/RemoteServerConfigurable.java b/platform/remote-servers/impl/src/com/intellij/remoteServer/impl/configuration/RemoteServerConfigurable.java index a614c4e642c9..7e68ca4c5b69 100644 --- a/platform/remote-servers/impl/src/com/intellij/remoteServer/impl/configuration/RemoteServerConfigurable.java +++ b/platform/remote-servers/impl/src/com/intellij/remoteServer/impl/configuration/RemoteServerConfigurable.java @@ -7,6 +7,7 @@ import com.intellij.openapi.progress.ProgressIndicator; import com.intellij.openapi.progress.Task; import com.intellij.openapi.ui.NamedConfigurable; import com.intellij.openapi.util.Disposer; +import com.intellij.openapi.util.text.StringUtil; import com.intellij.remoteServer.configuration.RemoteServer; import com.intellij.remoteServer.configuration.ServerConfiguration; import com.intellij.remoteServer.runtime.ServerConnection; @@ -79,7 +80,7 @@ public class RemoteServerConfigurable extends NamedConfigurable<RemoteServer<?>> if (result) { myUncheckedApply = false; - setConnectionStatus(""); + setConnectionStatus(false, false, ""); myConnectionTester = null; if (modified) { @@ -88,7 +89,7 @@ public class RemoteServerConfigurable extends NamedConfigurable<RemoteServer<?>> myInnerApplied = true; } catch (ConfigurationException e) { - setConnectionStatus(e.getMessage()); + setConnectionStatus(true, false, e.getMessage()); } } } @@ -97,7 +98,7 @@ public class RemoteServerConfigurable extends NamedConfigurable<RemoteServer<?>> @Override protected void run() { - setConnectionStatus("Connecting..."); + setConnectionStatus(false, false, "Connecting..."); myConnectionTester = new ConnectionTester(); myConnectionTester.testConnection(); @@ -105,19 +106,20 @@ public class RemoteServerConfigurable extends NamedConfigurable<RemoteServer<?>> }; } - private void setConnectionStatus(String text) { - setConnectionStatus(false, text); - } - - private void setConnectionStatus(boolean connected, String text) { + private void setConnectionStatus(boolean error, boolean connected, String text) { boolean changed = myConnected != connected; myConnected = connected; - myConnectionStatusLabel.setText(UIUtil.toHtml(text)); + setConnectionStatusText(error, text); if (changed) { notifyDataLoader(); } } + protected void setConnectionStatusText(boolean error, String text) { + myConnectionStatusLabel.setText(UIUtil.toHtml(text)); + myConnectionStatusLabel.setVisible(StringUtil.isNotEmpty(text)); + } + public void setDataLoader(CloudDataLoader dataLoader) { myDataLoader = dataLoader; notifyDataLoader(); @@ -238,7 +240,7 @@ public class RemoteServerConfigurable extends NamedConfigurable<RemoteServer<?>> @Override public void run() { if (myConnectionTester == ConnectionTester.this) { - setConnectionStatus(connected, connected ? "Connection successful" : "Cannot connect: " + connection.getStatusText()); + setConnectionStatus(!connected, connected, connected ? "Connection successful" : "Cannot connect: " + connection.getStatusText()); } } }); diff --git a/platform/remote-servers/impl/src/com/intellij/remoteServer/impl/runtime/ui/ServersToolWindowContent.java b/platform/remote-servers/impl/src/com/intellij/remoteServer/impl/runtime/ui/ServersToolWindowContent.java index f860d6dfa98c..7a1f27f3b8ee 100644 --- a/platform/remote-servers/impl/src/com/intellij/remoteServer/impl/runtime/ui/ServersToolWindowContent.java +++ b/platform/remote-servers/impl/src/com/intellij/remoteServer/impl/runtime/ui/ServersToolWindowContent.java @@ -146,6 +146,9 @@ public class ServersToolWindowContent extends JPanel implements Disposable { } myPropertiesPanelLayout.show(myPropertiesPanel, cardName); } + else { + showMessageLabel(""); + } } else if (node instanceof ServersTreeStructure.RemoteServerNode) { updateServerDetails((ServersTreeStructure.RemoteServerNode)node); diff --git a/platform/remote-servers/impl/src/com/intellij/remoteServer/impl/runtime/ui/tree/ServersTreeStructure.java b/platform/remote-servers/impl/src/com/intellij/remoteServer/impl/runtime/ui/tree/ServersTreeStructure.java index 4cb1c01943be..5895be279f85 100644 --- a/platform/remote-servers/impl/src/com/intellij/remoteServer/impl/runtime/ui/tree/ServersTreeStructure.java +++ b/platform/remote-servers/impl/src/com/intellij/remoteServer/impl/runtime/ui/tree/ServersTreeStructure.java @@ -287,16 +287,6 @@ public class ServersTreeStructure extends AbstractTreeStructureBase { myParentNode = parentNode; } - @Override - public boolean equals(Object object) { - return object instanceof DeploymentNodeImpl && getValue().getName().equals(((DeploymentNodeImpl)object).getValue().getName()); - } - - @Override - public int hashCode() { - return getValue().getName().hashCode(); - } - @NotNull @Override public ServerNode getServerNode() { @@ -377,10 +367,14 @@ public class ServersTreeStructure extends AbstractTreeStructureBase { return (DeploymentLogManagerImpl)myConnection.getLogManager(getValue()); } + public String getId() { + return myParentNode.getName() + ";deployment" + getValue().getName(); + } + @NotNull @Override public String getLogId() { - return "deployment:" + getValue().getName(); + return getId() + ";main-log"; } @NotNull @@ -451,7 +445,7 @@ public class ServersTreeStructure extends AbstractTreeStructureBase { @NotNull @Override public String getLogId() { - return "deployment:" + myDeploymentNode.getValue().getName() + ";log:" + getLogName(); + return myDeploymentNode.getId() + ";log:" + getLogName(); } } } |