IDEA-169956 - Wrong HelpId's are mapped to dialog boxes: Help button: 404 error

- delegate to RemoteServersViewContribution
This commit is contained in:
Michael Golubev
2017-03-29 17:30:51 +02:00
parent e8d557f55a
commit f80fd2f4cf
2 changed files with 12 additions and 3 deletions
@@ -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<RemoteServer<?>> 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;
}
}
@@ -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);
}
});