Example usage for com.intellij.openapi.actionSystem IdeActions ACTION_CLOSE

List of usage examples for com.intellij.openapi.actionSystem IdeActions ACTION_CLOSE

Introduction

In this page you can find the example usage for com.intellij.openapi.actionSystem IdeActions ACTION_CLOSE.

Prototype

String ACTION_CLOSE

To view the source code for com.intellij.openapi.actionSystem IdeActions ACTION_CLOSE.

Click Source Link

Usage

From source file:com.google.cloud.tools.intellij.debugger.CloudDebugProcessTest.java

License:Apache License

@Test
public void testRegisterAdditionalActions_close() {
    ActionManager manager = ActionManager.getInstance();
    AnAction action0 = manager.getAction(IdeActions.ACTION_PIN_ACTIVE_TAB);
    AnAction action1 = manager.getAction(IdeActions.ACTION_CLOSE);
    action1.getTemplatePresentation().setText("Close");
    AnAction action2 = manager.getAction(IdeActions.ACTION_CONTEXT_HELP);
    AnAction action3 = manager.getAction(IdeActions.ACTION_CALL_HIERARCHY);
    List<AnAction> leftToolbarActions = Lists.newArrayList();
    leftToolbarActions.add(action0);/*from   ww  w  . j a v a 2s .  c  o  m*/
    leftToolbarActions.add(action1);
    leftToolbarActions.add(action2);
    leftToolbarActions.add(action3);
    DefaultActionGroup leftToolbar = new DefaultActionGroup(leftToolbarActions);
    List<AnAction> actions = Lists.newArrayList();
    DefaultActionGroup topToolbar = new DefaultActionGroup(actions);
    DefaultActionGroup settings = new DefaultActionGroup(actions);

    process.registerAdditionalActions(leftToolbar, topToolbar, settings);

    assertEquals(4, leftToolbar.getChildrenCount());
    assertEquals(action0, leftToolbar.getChildActionsOrStubs()[0]);
    assertEquals(action3, leftToolbar.getChildActionsOrStubs()[1]);
}

From source file:com.intellij.execution.ui.actions.CloseAction.java

License:Apache License

public CloseAction(Executor executor, RunContentDescriptor contentDescriptor, Project project) {
    myExecutor = executor;/*from   w w w  .  j  a  va 2 s . c o m*/
    myContentDescriptor = contentDescriptor;
    myProject = project;
    copyFrom(ActionManager.getInstance().getAction(IdeActions.ACTION_CLOSE));
    final Presentation templatePresentation = getTemplatePresentation();
    templatePresentation.setIcon(AllIcons.Actions.Cancel);
    templatePresentation.setText(ExecutionBundle.message("close.tab.action.name"));
    templatePresentation.setDescription(null);
}