Search in sources :

Example 11 with StatusBar

use of com.intellij.openapi.wm.StatusBar in project intellij-community by JetBrains.

the class ActionMenu method showDescriptionInStatusBar.

public static void showDescriptionInStatusBar(boolean isIncluded, Component component, String description) {
    IdeFrame frame = (IdeFrame) (component instanceof IdeFrame ? component : SwingUtilities.getAncestorOfClass(IdeFrame.class, component));
    StatusBar statusBar;
    if (frame != null && (statusBar = frame.getStatusBar()) != null) {
        statusBar.setInfo(isIncluded ? description : null);
    }
}
Also used : IdeFrame(com.intellij.openapi.wm.IdeFrame) StatusBar(com.intellij.openapi.wm.StatusBar)

Example 12 with StatusBar

use of com.intellij.openapi.wm.StatusBar 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)

Example 13 with StatusBar

use of com.intellij.openapi.wm.StatusBar in project intellij-community by JetBrains.

the class StatusBarProgress method start.

@Override
public void start() {
    super.start();
    //noinspection SSBasedInspection
    SwingUtilities.invokeLater(() -> {
        if (ApplicationManager.getApplication().isDisposed())
            return;
        WindowManager windowManager = WindowManager.getInstance();
        if (windowManager == null)
            return;
        Project[] projects = ProjectManager.getInstance().getOpenProjects();
        if (projects.length == 0)
            projects = new Project[] { null };
        for (Project project : projects) {
            StatusBar statusBar = windowManager.getStatusBar(project);
            if (statusBar != null) {
                String info = notNull(statusBar.getInfo(), "");
                // initial value
                myStatusBar2SavedText.put(statusBar, pair(info, info));
            }
        }
    });
}
Also used : Project(com.intellij.openapi.project.Project) StatusBar(com.intellij.openapi.wm.StatusBar) WindowManager(com.intellij.openapi.wm.WindowManager)

Example 14 with StatusBar

use of com.intellij.openapi.wm.StatusBar in project intellij-community by JetBrains.

the class StatusBarProgress method update.

private void update() {
    String text;
    if (!isRunning()) {
        text = "";
    } else {
        text = getText();
        double fraction = getFraction();
        if (fraction > 0) {
            text += " " + (int) (fraction * 100 + 0.5) + "%";
        }
    }
    final String _text = text;
    //noinspection SSBasedInspection
    SwingUtilities.invokeLater(() -> {
        for (StatusBar statusBarEx : myStatusBar2SavedText.keySet()) {
            setStatusBarText(statusBarEx, _text);
        }
    });
}
Also used : StatusBar(com.intellij.openapi.wm.StatusBar)

Example 15 with StatusBar

use of com.intellij.openapi.wm.StatusBar in project intellij-community by JetBrains.

the class SynchronizeCurrentFileAction method postRefresh.

private static void postRefresh(Project project, VirtualFile[] files) {
    VcsDirtyScopeManager dirtyScopeManager = VcsDirtyScopeManager.getInstance(project);
    for (VirtualFile f : files) {
        if (f.isDirectory()) {
            dirtyScopeManager.dirDirtyRecursively(f);
        } else {
            dirtyScopeManager.fileDirty(f);
        }
    }
    StatusBar statusBar = WindowManager.getInstance().getStatusBar(project);
    if (statusBar != null) {
        statusBar.setInfo(IdeBundle.message("action.sync.completed.successfully", getMessage(files)));
    }
}
Also used : NewVirtualFile(com.intellij.openapi.vfs.newvfs.NewVirtualFile) VirtualFile(com.intellij.openapi.vfs.VirtualFile) StatusBar(com.intellij.openapi.wm.StatusBar) VcsDirtyScopeManager(com.intellij.openapi.vcs.changes.VcsDirtyScopeManager)

Aggregations

StatusBar (com.intellij.openapi.wm.StatusBar)28 Project (com.intellij.openapi.project.Project)6 Editor (com.intellij.openapi.editor.Editor)4 PsiElement (com.intellij.psi.PsiElement)4 FindManager (com.intellij.find.FindManager)3 FindModel (com.intellij.find.FindModel)3 FileEditorManager (com.intellij.openapi.fileEditor.FileEditorManager)3 VirtualFile (com.intellij.openapi.vfs.VirtualFile)3 IdeFrame (com.intellij.openapi.wm.IdeFrame)3 WindowManager (com.intellij.openapi.wm.WindowManager)3 CalledInAwt (org.jetbrains.annotations.CalledInAwt)3 HighlightManager (com.intellij.codeInsight.highlighting.HighlightManager)2 Application (com.intellij.openapi.application.Application)2 Document (com.intellij.openapi.editor.Document)2 EditorColorsManager (com.intellij.openapi.editor.colors.EditorColorsManager)2 EditorColorsScheme (com.intellij.openapi.editor.colors.EditorColorsScheme)2 TextAttributes (com.intellij.openapi.editor.markup.TextAttributes)2 DaemonCodeAnalyzer (com.intellij.codeInsight.daemon.DaemonCodeAnalyzer)1 Printable (com.intellij.execution.testframework.Printable)1 Printer (com.intellij.execution.testframework.Printer)1