From f80fd2f4cff5e471b83939f293fe4696273b225d Mon Sep 17 00:00:00 2001 From: Michael Golubev Date: Wed, 29 Mar 2017 17:09:56 +0200 Subject: [PATCH] IDEA-169956 - Wrong HelpId's are mapped to dialog boxes: Help button: 404 error - delegate to RemoteServersViewContribution --- .../impl/runtime/ui/RemoteServersViewContribution.java | 8 ++++++++ .../impl/runtime/ui/ServersToolWindowContent.java | 7 ++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/platform/remote-servers/impl/src/com/intellij/remoteServer/impl/runtime/ui/RemoteServersViewContribution.java b/platform/remote-servers/impl/src/com/intellij/remoteServer/impl/runtime/ui/RemoteServersViewContribution.java index 5a59656748d7..9f17c9ff5104 100644 --- a/platform/remote-servers/impl/src/com/intellij/remoteServer/impl/runtime/ui/RemoteServersViewContribution.java +++ b/platform/remote-servers/impl/src/com/intellij/remoteServer/impl/runtime/ui/RemoteServersViewContribution.java @@ -23,6 +23,7 @@ import com.intellij.remoteServer.impl.runtime.ui.tree.ServersTreeNodeSelector; import com.intellij.remoteServer.impl.runtime.ui.tree.ServersTreeStructure; import com.intellij.remoteServer.runtime.ServerConnection; import com.intellij.util.containers.ContainerUtil; +import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -30,6 +31,9 @@ import java.util.List; public abstract class RemoteServersViewContribution extends RemoteServersViewContributor { + @NonNls + private static final String HELP_ID = "Application_Servers_tool_window"; + public abstract List> getRemoteServers(); @Override @@ -71,4 +75,8 @@ public abstract class RemoteServersViewContribution extends RemoteServersViewCon return ContainerUtil.filter(RemoteServersManager.getInstance().getServers(), server -> getRemoteServerToolWindowId(server) == toolWindowId); } + + protected String getContextHelpId() { + return HELP_ID; + } } 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 218b13e671ed..40dc2f710abb 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 @@ -52,8 +52,6 @@ public class ServersToolWindowContent extends JPanel implements Disposable, Serv @NonNls private static final String SERVERS_TOOL_WINDOW_TOOLBAR = "RemoteServersViewToolbar"; @NonNls private static final String SERVERS_TOOL_WINDOW_POPUP = "RemoteServersViewPopup"; - @NonNls - private static final String HELP_ID = "Application_Servers_tool_window"; private static final String MESSAGE_CARD = "message"; private static final String EMPTY_SELECTION_MESSAGE = "Select a server or deployment in the tree to view details"; @@ -263,7 +261,7 @@ public class ServersToolWindowContent extends JPanel implements Disposable, Serv DefaultActionGroup group = new DefaultActionGroup(); group.add(ActionManager.getInstance().getAction(SERVERS_TOOL_WINDOW_TOOLBAR)); group.add(new Separator()); - group.add(new ContextHelpAction(HELP_ID)); + group.add(new ContextHelpAction(myContribution.getContextHelpId())); ActionToolbar actionToolBar = ActionManager.getInstance().createActionToolbar(PLACE_TOOLBAR, group, false); @@ -275,6 +273,9 @@ public class ServersToolWindowContent extends JPanel implements Disposable, Serv if (KEY.getName().equals(dataId)) { return ServersToolWindowContent.this; } + else if (PlatformDataKeys.HELP_ID.is(dataId)) { + return myContribution.getContextHelpId(); + } return myContribution.getData(dataId, ServersToolWindowContent.this); } });