Search in sources :

Example 1 with IdeNotificationArea

use of com.intellij.notification.impl.IdeNotificationArea in project intellij-community by JetBrains.

the class IdeFrameImpl method installDefaultProjectStatusBarWidgets.

private void installDefaultProjectStatusBarWidgets(@NotNull final Project project) {
    final StatusBar statusBar = getStatusBar();
    final PositionPanel positionPanel = new PositionPanel(project);
    statusBar.addWidget(positionPanel, "before " + IdeMessagePanel.FATAL_ERROR);
    final IdeNotificationArea notificationArea = new IdeNotificationArea();
    statusBar.addWidget(notificationArea, "before " + IdeMessagePanel.FATAL_ERROR);
    final EncodingPanel encodingPanel = new EncodingPanel(project);
    statusBar.addWidget(encodingPanel, "after Position");
    final LineSeparatorPanel lineSeparatorPanel = new LineSeparatorPanel(project);
    statusBar.addWidget(lineSeparatorPanel, "before " + encodingPanel.ID());
    final ToggleReadOnlyAttributePanel readOnlyAttributePanel = new ToggleReadOnlyAttributePanel(project);
    final InsertOverwritePanel insertOverwritePanel = new InsertOverwritePanel(project);
    statusBar.addWidget(insertOverwritePanel, "after Encoding");
    statusBar.addWidget(readOnlyAttributePanel, "after InsertOverwrite");
    Disposer.register(project, new Disposable() {

        public void dispose() {
            statusBar.removeWidget(encodingPanel.ID());
            statusBar.removeWidget(lineSeparatorPanel.ID());
            statusBar.removeWidget(positionPanel.ID());
            statusBar.removeWidget(notificationArea.ID());
            statusBar.removeWidget(readOnlyAttributePanel.ID());
            statusBar.removeWidget(insertOverwritePanel.ID());
            ((StatusBarEx) statusBar).removeCustomIndicationComponents();
        }
    });
}
Also used : Disposable(com.intellij.openapi.Disposable) IdeNotificationArea(com.intellij.notification.impl.IdeNotificationArea) StatusBar(com.intellij.openapi.wm.StatusBar)

Aggregations

IdeNotificationArea (com.intellij.notification.impl.IdeNotificationArea)1 Disposable (com.intellij.openapi.Disposable)1 StatusBar (com.intellij.openapi.wm.StatusBar)1