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

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

Introduction

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

Prototype

@Nullable
    JComponent getSearchComponent();

Source Link

Usage

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

License:Apache License

@Override
@NotNull/*from ww  w. ja  v a 2s . c om*/
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;
}