ServiceViewDescriptor (@NotNull Project project, @NotNull AbstractTreeNode service) { return new ServiceViewDescriptor() { @Override public ActionGroup getToolbarActions() { return RunDashboardServiceViewContributor.getToolbarActions(null); } @Override public ActionGroup getPopupActions() { return RunDashboardServiceViewContributor.getPopupActions(); } @NotNull @Override public ItemPresentation getPresentation() { return service.getPresentation(); } @Nullable @Override public String getId() { ItemPresentation presentation = getPresentation(); String text = presentation.getPresentableText(); if (!StringUtil.isEmpty(text)) { return text; } if (presentation instanceof PresentationData) { List<PresentableNodeDescriptor.ColoredFragment> fragments = ((PresentationData)presentation).getColoredText(); if (!fragments.isEmpty()) { StringBuilder result = new StringBuilder(); for (PresentableNodeDescriptor.ColoredFragment fragment : fragments) { result.append(fragment.getText()); } return result.toString(); } } return null; } @Nullable @Override public Runnable getRemover() { return service instanceof RunDashboardNode ? ((RunDashboardNode)service).getRemover() : null; } @Override public @Nullable JComponent getContentComponent() { return ((RunDashboardManagerImpl)RunDashboardManager.getInstance(myNode.getProject())).getEmptyContent(); } }; }