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);
}
}
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();
}
});
}
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));
}
}
});
}
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);
}
});
}
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)));
}
}
Aggregations