Search in sources :

Example 1 with ExternalProjectsViewImpl

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;
}
Also used : ExternalProjectsViewImpl(com.intellij.openapi.externalSystem.view.ExternalProjectsViewImpl) ExternalProjectsView(com.intellij.openapi.externalSystem.view.ExternalProjectsView) ExternalProjectsViewState(com.intellij.openapi.externalSystem.view.ExternalProjectsViewState) NotNull(org.jetbrains.annotations.NotNull)

Example 2 with ExternalProjectsViewImpl

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);
}
Also used : ContentManager(com.intellij.ui.content.ContentManager) ExternalProjectsViewImpl(com.intellij.openapi.externalSystem.view.ExternalProjectsViewImpl) ContentImpl(com.intellij.ui.content.impl.ContentImpl)

Example 3 with ExternalProjectsViewImpl

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());
    });
}
Also used : ExternalProjectsViewImpl(com.intellij.openapi.externalSystem.view.ExternalProjectsViewImpl) ExternalProjectsView(com.intellij.openapi.externalSystem.view.ExternalProjectsView) NotificationGroup(com.intellij.notification.NotificationGroup) Application(com.intellij.openapi.application.Application) Notification(com.intellij.notification.Notification)

Example 4 with ExternalProjectsViewImpl

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();
    }
}
Also used : ExternalProjectsViewImpl(com.intellij.openapi.externalSystem.view.ExternalProjectsViewImpl)

Aggregations

ExternalProjectsViewImpl (com.intellij.openapi.externalSystem.view.ExternalProjectsViewImpl)4 ExternalProjectsView (com.intellij.openapi.externalSystem.view.ExternalProjectsView)2 Notification (com.intellij.notification.Notification)1 NotificationGroup (com.intellij.notification.NotificationGroup)1 Application (com.intellij.openapi.application.Application)1 ExternalProjectsViewState (com.intellij.openapi.externalSystem.view.ExternalProjectsViewState)1 ContentManager (com.intellij.ui.content.ContentManager)1 ContentImpl (com.intellij.ui.content.impl.ContentImpl)1 NotNull (org.jetbrains.annotations.NotNull)1