Content (final @NotNull String contentId, final @NotNull ComponentWithActions withActions, final @NotNull String displayName, final @Nullable Icon icon, final @Nullable 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; }