use of com.intellij.openapi.externalSystem.view.ExternalProjectsViewImpl in project intellij-community by JetBrains.
the class ExternalProjectsManager method getState.
@NotNull
@Override
public ExternalProjectsState getState() {
ApplicationManager.getApplication().assertIsDispatchThread();
for (ExternalProjectsView externalProjectsView : myProjectsViews) {
if (externalProjectsView instanceof ExternalProjectsViewImpl) {
final ExternalProjectsViewState externalProjectsViewState = ((ExternalProjectsViewImpl) externalProjectsView).getState();
final ExternalProjectsState.State state = myState.getExternalSystemsState().get(externalProjectsView.getSystemId().getId());
assert state != null;
state.setProjectsViewState(externalProjectsViewState);
}
}
return myState;
}
use of com.intellij.openapi.externalSystem.view.ExternalProjectsViewImpl in project intellij-community by JetBrains.
the class AbstractExternalSystemToolWindowFactory method createToolWindowContent.
@Override
public void createToolWindowContent(@NotNull final Project project, @NotNull final ToolWindow toolWindow) {
toolWindow.setTitle(myExternalSystemId.getReadableName());
ContentManager contentManager = toolWindow.getContentManager();
final ExternalProjectsViewImpl projectsView = new ExternalProjectsViewImpl(project, (ToolWindowEx) toolWindow, myExternalSystemId);
ExternalProjectsManager.getInstance(project).registerView(projectsView);
ContentImpl tasksContent = new ContentImpl(projectsView, ExternalSystemBundle.message("tool.window.title.projects"), true);
contentManager.addContent(tasksContent);
}
use of com.intellij.openapi.externalSystem.view.ExternalProjectsViewImpl in project intellij-community by JetBrains.
the class ExternalSystemNotificationManager method showNotification.
public void showNotification(@NotNull final ProjectSystemId externalSystemId, @NotNull final NotificationData notificationData) {
myUpdater.submit(() -> {
if (myProject.isDisposed())
return;
final Application app = ApplicationManager.getApplication();
Runnable action = () -> {
if (!initializedExternalSystem.contains(externalSystemId)) {
app.runWriteAction(() -> {
if (myProject.isDisposed())
return;
ExternalSystemUtil.ensureToolWindowContentInitialized(myProject, externalSystemId);
initializedExternalSystem.add(externalSystemId);
});
}
if (myProject.isDisposed())
return;
NotificationGroup group;
if (notificationData.getBalloonGroup() == null) {
ExternalProjectsView externalProjectsView = ExternalProjectsManager.getInstance(myProject).getExternalProjectsView(externalSystemId);
group = externalProjectsView instanceof ExternalProjectsViewImpl ? ((ExternalProjectsViewImpl) externalProjectsView).getNotificationGroup() : null;
} else {
final NotificationGroup registeredGroup = NotificationGroup.findRegisteredGroup(notificationData.getBalloonGroup());
group = registeredGroup != null ? registeredGroup : NotificationGroup.balloonGroup(notificationData.getBalloonGroup());
}
if (group == null)
return;
final Notification notification = group.createNotification(notificationData.getTitle(), notificationData.getMessage(), notificationData.getNotificationCategory().getNotificationType(), notificationData.getListener());
myNotifications.add(notification);
if (notificationData.isBalloonNotification()) {
applyNotification(notification);
} else {
addMessage(notification, externalSystemId, notificationData);
}
};
app.invokeLater(action, ModalityState.defaultModalityState(), myProject.getDisposed());
});
}
use of com.intellij.openapi.externalSystem.view.ExternalProjectsViewImpl in project intellij-community by JetBrains.
the class ExternalProjectsManager method registerView.
public void registerView(@NotNull ExternalProjectsView externalProjectsView) {
assert getExternalProjectsView(externalProjectsView.getSystemId()) == null;
init();
myProjectsViews.add(externalProjectsView);
if (externalProjectsView instanceof ExternalProjectsViewImpl) {
ExternalProjectsViewImpl view = (ExternalProjectsViewImpl) externalProjectsView;
view.loadState(myState.getExternalSystemsState().get(externalProjectsView.getSystemId().getId()).getProjectsViewState());
view.init();
}
}
Aggregations