Example usage for com.intellij.openapi.actionSystem ActionPlaces TESTTREE_VIEW_TOOLBAR

List of usage examples for com.intellij.openapi.actionSystem ActionPlaces TESTTREE_VIEW_TOOLBAR

Introduction

In this page you can find the example usage for com.intellij.openapi.actionSystem ActionPlaces TESTTREE_VIEW_TOOLBAR.

Prototype

String TESTTREE_VIEW_TOOLBAR

To view the source code for com.intellij.openapi.actionSystem ActionPlaces TESTTREE_VIEW_TOOLBAR.

Click Source Link

Usage

From source file:com.intellij.execution.testframework.ToolbarPanel.java

License:Apache License

public ToolbarPanel(final TestConsoleProperties properties, ExecutionEnvironment environment,
        JComponent parent) {//from www  .  j  a va2s  . co m
    super(new BorderLayout());
    final DefaultActionGroup actionGroup = new DefaultActionGroup(null, false);
    actionGroup.addAction(new ToggleBooleanProperty(
            ExecutionBundle.message("junit.run.hide.passed.action.name"),
            ExecutionBundle.message("junit.run.hide.passed.action.description"),
            AllIcons.RunConfigurations.HidePassed, properties, TestConsoleProperties.HIDE_PASSED_TESTS));
    actionGroup.addSeparator();

    actionGroup.addAction(new ToggleBooleanProperty(
            ExecutionBundle.message("junit.runing.info.track.test.action.name"),
            ExecutionBundle.message("junit.runing.info.track.test.action.description"),
            AllIcons.RunConfigurations.TrackTests, properties, TestConsoleProperties.TRACK_RUNNING_TEST))
            .setAsSecondary(true);
    actionGroup
            .addAction(new ToggleBooleanProperty(ExecutionBundle.message("junit.run.hide.ignored.action.name"),
                    null, AllIcons.RunConfigurations.HideIgnored, properties,
                    TestConsoleProperties.HIDE_IGNORED_TEST))
            .setAsSecondary(true);

    actionGroup.addAction(new ToggleBooleanProperty(
            ExecutionBundle.message("junit.runing.info.sort.alphabetically.action.name"),
            ExecutionBundle.message("junit.runing.info.sort.alphabetically.action.description"),
            AllIcons.ObjectBrowser.Sorted, properties, TestConsoleProperties.SORT_ALPHABETICALLY));
    actionGroup.addSeparator();

    AnAction action = CommonActionsManager.getInstance().createExpandAllAction(myTreeExpander, parent);
    action.getTemplatePresentation()
            .setDescription(ExecutionBundle.message("junit.runing.info.expand.test.action.name"));
    actionGroup.add(action);

    action = CommonActionsManager.getInstance().createCollapseAllAction(myTreeExpander, parent);
    action.getTemplatePresentation()
            .setDescription(ExecutionBundle.message("junit.runing.info.collapse.test.action.name"));
    actionGroup.add(action);

    actionGroup.addSeparator();
    final CommonActionsManager actionsManager = CommonActionsManager.getInstance();
    myOccurenceNavigator = new FailedTestsNavigator();
    actionGroup.add(actionsManager.createPrevOccurenceAction(myOccurenceNavigator));
    actionGroup.add(actionsManager.createNextOccurenceAction(myOccurenceNavigator));

    actionGroup.addAction(new ToggleBooleanProperty(
            ExecutionBundle.message("junit.runing.info.select.first.failed.action.name"), null,
            AllIcons.RunConfigurations.SelectFirstDefect, properties,
            TestConsoleProperties.SELECT_FIRST_DEFECT)).setAsSecondary(true);
    actionGroup.addAction(new ToggleBooleanProperty(
            ExecutionBundle.message("junit.runing.info.scroll.to.stacktrace.action.name"),
            ExecutionBundle.message("junit.runing.info.scroll.to.stacktrace.action.description"),
            AllIcons.RunConfigurations.ScrollToStackTrace, properties,
            TestConsoleProperties.SCROLL_TO_STACK_TRACE)).setAsSecondary(true);
    myScrollToSource = new ScrollToTestSourceAction(properties);
    actionGroup.addAction(myScrollToSource).setAsSecondary(true);
    actionGroup.addAction(new ToggleBooleanProperty(
            ExecutionBundle.message("junit.runing.info.open.source.at.exception.action.name"),
            ExecutionBundle.message("junit.runing.info.open.source.at.exception.action.description"),
            AllIcons.RunConfigurations.SourceAtException, properties, TestConsoleProperties.OPEN_FAILURE_LINE))
            .setAsSecondary(true);

    actionGroup.addAction(new ShowStatisticsAction(properties)).setAsSecondary(true);
    actionGroup.addAction(new AdjustAutotestDelayActionGroup(environment)).setAsSecondary(true);

    for (ToggleModelActionProvider actionProvider : Extensions
            .getExtensions(ToggleModelActionProvider.EP_NAME)) {
        final ToggleModelAction toggleModelAction = actionProvider.createToggleModelAction(properties);
        myActions.add(toggleModelAction);
        actionGroup.add(toggleModelAction);
    }

    myExportAction = ExportTestResultsAction.create(properties.getExecutor().getToolWindowId(),
            properties.getConfiguration());
    actionGroup.addAction(myExportAction);

    appendAdditionalActions(actionGroup, properties, environment, parent);

    add(ActionManager.getInstance().createActionToolbar(ActionPlaces.TESTTREE_VIEW_TOOLBAR, actionGroup, true)
            .getComponent(), BorderLayout.CENTER);
}