Java Code Examples for com.intellij.openapi.wm.ToolWindow#getId()

The following examples show how to use com.intellij.openapi.wm.ToolWindow#getId() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ActivateToolWindowAction.java    From consulo with Apache License 2.0 5 votes vote down vote up
public static void ensureToolWindowActionRegistered(@Nonnull ToolWindow toolWindow) {
  ActionManager actionManager = ActionManager.getInstance();
  String actionId = getActionIdForToolWindow(toolWindow.getId());
  AnAction action = actionManager.getAction(actionId);
  if (action == null) {
    ActivateToolWindowAction newAction = new ActivateToolWindowAction(toolWindow.getId());
    newAction.updatePresentation(newAction.getTemplatePresentation(), toolWindow);
    actionManager.registerAction(actionId, newAction);
  }
}
 
Example 2
Source File: ToolWindowTabRenameActionBase.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Override
public void update(@Nonnull AnActionEvent e, @Nonnull ToolWindow toolWindow, @Nullable Content content) {
  String id = toolWindow.getId();
  e.getPresentation().setEnabledAndVisible(e.getProject() != null && myToolWindowId.equals(id) && content != null);
}