Example usage for com.intellij.openapi.ui ComponentWithActions getToolbarContextComponent

List of usage examples for com.intellij.openapi.ui ComponentWithActions getToolbarContextComponent

Introduction

In this page you can find the example usage for com.intellij.openapi.ui ComponentWithActions getToolbarContextComponent.

Prototype

@Nullable
    JComponent getToolbarContextComponent();

Source Link

Usage

From source file:com.intellij.execution.ui.layout.impl.RunnerLayoutUiImpl.java

License:Apache License

@Override
@NotNull//from ww w .j  a va2 s.c  o  m
public Content createContent(@NotNull final String contentId, @NotNull final ComponentWithActions withActions,
        @NotNull final String displayName, @Nullable final Icon 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;
}