use of com.intellij.openapi.wm.StatusBar in project GsonFormat by zzz40500.
the class Toast method make.
/**
* Display simple notification of given type
*
* @param project
* @param type
* @param text
*/
public static void make(Project project, JComponent jComponent, MessageType type, String text) {
StatusBar statusBar = WindowManager.getInstance().getStatusBar(project);
JBPopupFactory.getInstance().createHtmlTextBalloonBuilder(text, type, null).setFadeoutTime(7500).createBalloon().show(RelativePoint.getCenterOf(jComponent), Balloon.Position.above);
}
use of com.intellij.openapi.wm.StatusBar in project intellij-community by JetBrains.
the class PackageFileAction method setStatusText.
private static void setStatusText(Project project, List<VirtualFile> files) {
if (!files.isEmpty()) {
StringBuilder fileNames = new StringBuilder();
for (VirtualFile file : files) {
if (fileNames.length() != 0)
fileNames.append(", ");
fileNames.append("'").append(file.getName()).append("'");
}
String time = TIME_FORMAT.format(Clock.getTime());
final String statusText = CompilerBundle.message("status.text.file.has.been.packaged", files.size(), fileNames, time);
final StatusBar statusBar = WindowManager.getInstance().getStatusBar(project);
if (statusBar != null) {
statusBar.setInfo(statusText);
}
}
}
use of com.intellij.openapi.wm.StatusBar in project intellij-community by JetBrains.
the class EscapeHandler method execute.
@Override
public void execute(Editor editor, DataContext dataContext) {
editor.setHeaderComponent(null);
Project project = CommonDataKeys.PROJECT.getData(dataContext);
if (project != null) {
HighlightManagerImpl highlightManager = (HighlightManagerImpl) HighlightManager.getInstance(project);
if (highlightManager != null && highlightManager.hideHighlights(editor, HighlightManager.HIDE_BY_ESCAPE | HighlightManager.HIDE_BY_ANY_KEY)) {
StatusBar statusBar = WindowManager.getInstance().getStatusBar(project);
if (statusBar != null) {
statusBar.setInfo("");
}
FindManager findManager = FindManager.getInstance(project);
if (findManager != null) {
FindModel model = findManager.getFindNextModel(editor);
if (model != null) {
model.setSearchHighlighters(false);
findManager.setFindNextModel(model);
}
}
return;
}
}
myOriginalHandler.execute(editor, dataContext);
}
use of com.intellij.openapi.wm.StatusBar in project intellij-community by JetBrains.
the class DvcsUtil method getSelectedFile.
/**
* Returns the currently selected file, based on which VcsBranch or StatusBar components will identify the current repository root.
*/
@Nullable
@CalledInAwt
public static VirtualFile getSelectedFile(@NotNull Project project) {
StatusBar statusBar = WindowManager.getInstance().getStatusBar(project);
final FileEditor fileEditor = StatusBarUtil.getCurrentFileEditor(project, statusBar);
VirtualFile result = null;
if (fileEditor != null) {
if (fileEditor instanceof TextEditor) {
Document document = ((TextEditor) fileEditor).getEditor().getDocument();
result = FileDocumentManager.getInstance().getFile(document);
} else if (fileEditor instanceof ImageFileEditor) {
result = ((ImageFileEditor) fileEditor).getImageEditor().getFile();
}
}
if (result == null) {
final FileEditorManager manager = FileEditorManager.getInstance(project);
if (manager != null) {
Editor editor = manager.getSelectedTextEditor();
if (editor != null) {
result = FileDocumentManager.getInstance().getFile(editor.getDocument());
}
}
}
return result;
}
use of com.intellij.openapi.wm.StatusBar in project intellij-community by JetBrains.
the class DvcsStatusWidget method installWidgetToStatusBar.
private void installWidgetToStatusBar(@NotNull final Project project, @NotNull final StatusBarWidget widget) {
ApplicationManager.getApplication().invokeLater(() -> {
StatusBar statusBar = WindowManager.getInstance().getStatusBar(project);
if (statusBar != null && !isDisposed()) {
statusBar.addWidget(widget, "after " + (SystemInfo.isMac ? "Encoding" : "InsertOverwrite"), project);
subscribeToMappingChanged();
subscribeToRepoChangeEvents(project);
update();
}
}, project.getDisposed());
}
Aggregations