use of com.intellij.ui.content.Content in project intellij-community by JetBrains.
the class BaseViewAction method update.
@Override
public final void update(final AnActionEvent e) {
ViewContext context = getViewFacade(e);
Content[] content = getContent(e);
if (context != null && content != null) {
if (containsInvalidContent(content)) {
e.getPresentation().setEnabled(false);
} else {
update(e, context, content);
}
} else {
e.getPresentation().setEnabled(false);
}
}
use of com.intellij.ui.content.Content in project intellij-community by JetBrains.
the class QuickDocUtil method getActiveDocComponent.
@Nullable
public static DocumentationComponent getActiveDocComponent(@NotNull Project project) {
DocumentationManager documentationManager = DocumentationManager.getInstance(project);
DocumentationComponent component;
JBPopup hint = documentationManager.getDocInfoHint();
if (hint != null) {
component = (DocumentationComponent) ((AbstractPopup) hint).getComponent();
} else if (documentationManager.hasActiveDockedDocWindow()) {
ToolWindow toolWindow = ToolWindowManager.getInstance(project).getToolWindow(ToolWindowId.DOCUMENTATION);
Content selectedContent = toolWindow == null ? null : toolWindow.getContentManager().getSelectedContent();
component = selectedContent == null ? null : (DocumentationComponent) selectedContent.getComponent();
} else {
component = null;
}
return component;
}
use of com.intellij.ui.content.Content in project intellij-community by JetBrains.
the class LogConsoleManagerBase method addAdditionalTabComponent.
public Content addAdditionalTabComponent(@NotNull AdditionalTabComponent tabComponent, @NotNull String id, @Nullable Icon icon) {
Content logContent = getUi().createContent(id, (ComponentWithActions) tabComponent, tabComponent.getTabTitle(), icon, tabComponent.getPreferredFocusableComponent());
myAdditionalContent.put(tabComponent, logContent);
getUi().addContent(logContent);
return logContent;
}
use of com.intellij.ui.content.Content in project intellij-community by JetBrains.
the class CyclicDependenciesHandler method analyze.
public void analyze() {
final CyclicDependenciesBuilder builder = new CyclicDependenciesBuilder(myProject, myScope);
final Runnable process = () -> builder.analyze();
final Runnable successRunnable = () -> SwingUtilities.invokeLater(() -> {
CyclicDependenciesPanel panel = new CyclicDependenciesPanel(myProject, builder);
Content content = ContentFactory.SERVICE.getInstance().createContent(panel, AnalysisScopeBundle.message("action.analyzing.cyclic.dependencies.in.scope", builder.getScope().getDisplayName()), false);
content.setDisposer(panel);
panel.setContent(content);
DependenciesToolWindow.getInstance(myProject).addContent(content);
});
ProgressManager.getInstance().runProcessWithProgressAsynchronously(myProject, AnalysisScopeBundle.message("package.dependencies.progress.title"), process, successRunnable, null, new PerformAnalysisInBackgroundOption(myProject));
}
use of com.intellij.ui.content.Content in project intellij-community by JetBrains.
the class ExternalSystemNotificationManager method clearNotifications.
public void clearNotifications(@Nullable final String groupName, @NotNull final NotificationSource notificationSource, @NotNull final ProjectSystemId externalSystemId) {
myMessageCounter.remove(groupName, notificationSource, externalSystemId);
myUpdater.submit(() -> {
if (myProject.isDisposed())
return;
for (Iterator<Notification> iterator = myNotifications.iterator(); iterator.hasNext(); ) {
Notification notification = iterator.next();
if (groupName == null || groupName.equals(notification.getGroupId())) {
notification.expire();
iterator.remove();
}
}
final ToolWindow toolWindow = ToolWindowManager.getInstance(myProject).getToolWindow(ToolWindowId.MESSAGES_WINDOW);
if (toolWindow == null)
return;
final Pair<NotificationSource, ProjectSystemId> contentIdPair = Pair.create(notificationSource, externalSystemId);
final MessageView messageView = ServiceManager.getService(myProject, MessageView.class);
UIUtil.invokeLaterIfNeeded(() -> {
if (myProject.isDisposed())
return;
for (Content content : messageView.getContentManager().getContents()) {
if (!content.isPinned() && contentIdPair.equals(content.getUserData(CONTENT_ID_KEY))) {
if (groupName == null) {
messageView.getContentManager().removeContent(content, true);
} else {
assert content.getComponent() instanceof NewEditableErrorTreeViewPanel;
NewEditableErrorTreeViewPanel errorTreeView = (NewEditableErrorTreeViewPanel) content.getComponent();
ErrorViewStructure errorViewStructure = errorTreeView.getErrorViewStructure();
errorViewStructure.removeGroup(groupName);
}
}
}
});
});
}
Aggregations