Java Code Examples for com.intellij.ui.content.Content#setActions()

The following examples show how to use com.intellij.ui.content.Content#setActions() . 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: RNUtil.java    From react-native-console with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
public static void addAdditionalConsoleEditorActions(final ConsoleView console, final Content consoleContent) {
    final DefaultActionGroup consoleActions = new DefaultActionGroup();
        for (AnAction action : console.createConsoleActions()) {
            consoleActions.add(action);
        }

    consoleContent.setActions(consoleActions, ActionPlaces.RUNNER_TOOLBAR, console.getComponent());
}
 
Example 2
Source File: XDebugSessionTab.java    From consulo with Apache License 2.0 6 votes vote down vote up
private Content createVariablesContent(@Nonnull XDebugSessionImpl session) {
  XVariablesView variablesView;
  if (myWatchesInVariables) {
    variablesView = myWatchesView = new XWatchesViewImpl(session, myWatchesInVariables);
  }
  else {
    variablesView = new XVariablesView(session);
  }
  registerView(DebuggerContentInfo.VARIABLES_CONTENT, variablesView);
  Content result =
          myUi.createContent(DebuggerContentInfo.VARIABLES_CONTENT, variablesView.getPanel(), XDebuggerBundle.message("debugger.session.tab.variables.title"),
                             AllIcons.Debugger.Value, null);
  result.setCloseable(false);

  ActionGroup group = getCustomizedActionGroup(XDebuggerActions.VARIABLES_TREE_TOOLBAR_GROUP);
  result.setActions(group, ActionPlaces.DEBUGGER_TOOLBAR, variablesView.getTree());
  return result;
}
 
Example 3
Source File: RunnerLayoutUiImpl.java    From consulo with Apache License 2.0 6 votes vote down vote up
@Override
@Nonnull
public Content createContent(@Nonnull final String contentId, @Nonnull final ComponentWithActions withActions, @Nonnull final String displayName,
                             @Nullable final Image icon,
                             @Nullable final JComponent toFocus) {
  final Content content = getContentFactory().createContent(withActions.getComponent(), displayName, false);
  content.putUserData(CONTENT_TYPE, contentId);
  content.putUserData(ViewImpl.ID, contentId);
  content.setIcon(icon);
  if (toFocus != null) {
    content.setPreferredFocusableComponent(toFocus);
  }

  if (!withActions.isContentBuiltIn()) {
    content.setSearchComponent(withActions.getSearchComponent());
    content.setActions(withActions.getToolbarActions(), withActions.getToolbarPlace(), withActions.getToolbarContextComponent());
  }

  return content;
}
 
Example 4
Source File: RunContentBuilder.java    From consulo with Apache License 2.0 5 votes vote down vote up
public static void addAdditionalConsoleEditorActions(final ExecutionConsole console, final Content consoleContent) {
  final DefaultActionGroup consoleActions = new DefaultActionGroup();
  if (console instanceof ConsoleView) {
    for (AnAction action : ((ConsoleView)console).createConsoleActions()) {
      consoleActions.add(action);
    }
  }

  consoleContent.setActions(consoleActions, ActionPlaces.UNKNOWN, console.getComponent());
}