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

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

Introduction

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

Prototype

String ACTION_PIN_ACTIVE_TAB

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

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);//w  w w. ja 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]);
}