本文整理匯總了Java中com.intellij.openapi.wm.StatusBar類的典型用法代碼示例。如果您正苦於以下問題:Java StatusBar類的具體用法?Java StatusBar怎麽用?Java StatusBar使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
StatusBar類屬於com.intellij.openapi.wm包,在下文中一共展示了StatusBar類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: handleBadRequest
import com.intellij.openapi.wm.StatusBar; //導入依賴的package包/類
private void handleBadRequest(final HybrisHttpResult httpResult, final Project project) {
if (httpResult.getStatusCode() != SC_OK) {
final StatusBar statusBar = WindowManager.getInstance().getStatusBar(project);
if (httpResult.getStatusCode() == SC_NOT_FOUND || httpResult.getStatusCode() == SC_MOVED_TEMPORARILY) {
JBPopupFactory.getInstance().createHtmlTextBalloonBuilder(
"Hybris Host URL '" + httpResult.getErrorMessage() + "' was incorrect. Please, check your settings.",
MessageType.ERROR,
null
).setFadeoutTime(FADEOUT_TIME)
.createBalloon().show(
RelativePoint.getCenterOf(statusBar.getComponent()),
Balloon.Position.atRight
);
}
}
}
開發者ID:AlexanderBartash,項目名稱:hybris-integration-intellij-idea-plugin,代碼行數:18,代碼來源:ExecuteHybrisConsole.java
示例2: generateProject
import com.intellij.openapi.wm.StatusBar; //導入依賴的package包/類
@Override
public void generateProject(@NotNull Project project, @NotNull VirtualFile baseDir, @NotNull GravProjectSettings settings, @NotNull Module module) {
StatusBar statusBar = WindowManager.getInstance().getStatusBar(project);
VirtualFile vf = LocalFileSystem.getInstance().findFileByIoFile(new File(settings.gravInstallationPath));
if (vf == null || !GravSdkType.isValidGravSDK(vf)) {
JBPopupFactory.getInstance()
.createHtmlTextBalloonBuilder("Project couldn't be created because Grav Installation isn't valid", MessageType.ERROR, null)
.setFadeoutTime(3500)
.createBalloon()
.show(RelativePoint.getSouthEastOf(statusBar.getComponent()), Balloon.Position.above);
} else {
storage.setDefaultGravDownloadPath(settings.gravInstallationPath);
PropertiesComponent.getInstance().setValue(LAST_USED_GRAV_HOME, new File(settings.gravInstallationPath).getAbsolutePath());
GravProjectGeneratorUtil projectGenerator = new GravProjectGeneratorUtil();
projectGenerator.generateProject(project, baseDir, settings, module);
try {
List<String> includePath = new ArrayList<>();
includePath.add(baseDir.getPath());
PhpIncludePathManager.getInstance(project).setIncludePath(includePath);
} catch (Exception e) {
e.printStackTrace();
}
}
}
示例3: moduleCreated
import com.intellij.openapi.wm.StatusBar; //導入依賴的package包/類
@Override
public void moduleCreated(@NotNull Module module) {
StatusBar statusBar = WindowManager.getInstance().getStatusBar(project);
String msg = String.format("Please wait while module for project %s is created", project.getName());
settings = GravProjectSettings.getInstance(project);
JBPopupFactory.getInstance()
.createHtmlTextBalloonBuilder(msg, MessageType.WARNING, null)
.setFadeoutTime(4000)
.createBalloon()
.show(RelativePoint.getSouthEastOf(statusBar.getComponent()), Balloon.Position.above);
VirtualFile[] roots1 = ModuleRootManager.getInstance(module).getContentRoots();
if (roots1.length != 0) {
final VirtualFile src = roots1[0];
settings.withSrcDirectory = withSrcDirectory;
settings.gravInstallationPath = getGravInstallPath().getPath();
// settings.withSrcDirectory =
GravProjectGeneratorUtil generatorUtil = new GravProjectGeneratorUtil();
generatorUtil.generateProject(project, src, settings, module);
}
}
示例4: showMessage
import com.intellij.openapi.wm.StatusBar; //導入依賴的package包/類
private static void showMessage(final Project project, final MessageType messageType, final String format, final Object[] args) {
StatusBar statusBar = windowManager.getStatusBar(project);
if(statusBar == null || statusBar.getComponent() == null){
return;
}
String message = String.format(format, args);
jbPopupFactory.createHtmlTextBalloonBuilder(message, messageType, null)
.setFadeoutTime(7500)
.createBalloon()
.show(RelativePoint.getNorthEastOf(statusBar.getComponent()), Balloon.Position.atRight);
if(messageType == MessageType.INFO){
log.info(message);
}
else if(messageType == MessageType.WARNING) {
log.warn(message);
}
else{
log.debug(message);
}
}
示例5: installGtmWidget
import com.intellij.openapi.wm.StatusBar; //導入依賴的package包/類
private void installGtmWidget() {
StatusBar statusBar = WindowManager.getInstance().getStatusBar(myProject);
if (statusBar != null) {
statusBar.addWidget(myStatusWidget, myProject);
myStatusWidget.installed();
if (!GTMRecord.initGtmExePath()) {
JBPopupFactory.getInstance()
.createHtmlTextBalloonBuilder(GTMConfig.getInstance().gtmNotFound, ERROR, null)
.setFadeoutTime(30000)
.createBalloon()
.show(RelativePoint.getSouthEastOf(statusBar.getComponent()),
Balloon.Position.atRight);
return;
}
if (!GTMRecord.checkVersion()) {
JBPopupFactory.getInstance()
.createHtmlTextBalloonBuilder(GTMConfig.getInstance().gtmVerOutdated, WARNING, null)
.setFadeoutTime(30000)
.createBalloon()
.show(RelativePoint.getSouthEastOf(statusBar.getComponent()),
Balloon.Position.atRight);
}
}
}
示例6: install
import com.intellij.openapi.wm.StatusBar; //導入依賴的package包/類
@Override
public void install(@NotNull StatusBar statusBar) {
Toolkit.getDefaultToolkit().addAWTEventListener(this,
AWTEvent.KEY_EVENT_MASK |
AWTEvent.MOUSE_EVENT_MASK |
AWTEvent.MOUSE_MOTION_EVENT_MASK
);
saveDocumentListener = new FileDocumentManagerAdapter() {
@Override
public void beforeAllDocumentsSaving() {
foldRunningTime();
}
@Override
public void beforeDocumentSaving(@NotNull Document document) {
foldRunningTime();
}
};
Extensions.getArea(null).getExtensionPoint(FileDocumentManagerListener.EP_NAME).registerExtension(saveDocumentListener);
synchronized (ALL_OPENED_TRACKERS_LOCK) {
ALL_OPENED_TRACKERS.add(this);
}
}
示例7: getCurrentFileEditor
import com.intellij.openapi.wm.StatusBar; //導入依賴的package包/類
/**
* Finds the current file editor.
*/
@Nullable
public static FileEditor getCurrentFileEditor(@NotNull Project project, @Nullable StatusBar statusBar) {
if (statusBar == null) {
return null;
}
DockContainer c = DockManager.getInstance(project).getContainerFor(statusBar.getComponent());
EditorsSplitters splitters = null;
if (c instanceof DockableEditorTabbedContainer) {
splitters = ((DockableEditorTabbedContainer)c).getSplitters();
}
if (splitters != null && splitters.getCurrentWindow() != null) {
EditorWithProviderComposite editor = splitters.getCurrentWindow().getSelectedEditor();
if (editor != null) {
return editor.getSelectedEditorWithProvider().getFirst();
}
}
return null;
}
示例8: getStatusBar
import com.intellij.openapi.wm.StatusBar; //導入依賴的package包/類
@Override
public StatusBar getStatusBar(@NotNull Component c, @Nullable Project project) {
Component parent = UIUtil.findUltimateParent(c);
if (parent instanceof IdeFrame) {
return ((IdeFrame)parent).getStatusBar().findChild(c);
}
IdeFrame frame = findFrameFor(project);
if (frame != null) {
return frame.getStatusBar().findChild(c);
}
assert false : "Cannot find status bar for " + c;
return null;
}
示例9: start
import com.intellij.openapi.wm.StatusBar; //導入依賴的package包/類
@Override
public void start() {
super.start();
//noinspection SSBasedInspection
SwingUtilities.invokeLater(
new Runnable() {
@Override
public void run() {
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(), "");
myStatusBar2SavedText.put(statusBar, pair(info, info)); // initial value
}
}
}
}
);
}
示例10: stop
import com.intellij.openapi.wm.StatusBar; //導入依賴的package包/類
@Override
public void stop() {
super.stop();
//noinspection SSBasedInspection
SwingUtilities.invokeLater(
new Runnable() {
@Override
public void run() {
for (StatusBar statusBar : myStatusBar2SavedText.keySet()) {
String textToRestore = updateRestoreText(statusBar);
statusBar.setInfo(textToRestore);
}
myStatusBar2SavedText.clear();
}
}
);
}
示例11: update
import com.intellij.openapi.wm.StatusBar; //導入依賴的package包/類
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(
new Runnable() {
@Override
public void run() {
for (StatusBar statusBarEx : myStatusBar2SavedText.keySet()) {
setStatusBarText(statusBarEx, _text);
}
}
}
);
}
示例12: postRefresh
import com.intellij.openapi.wm.StatusBar; //導入依賴的package包/類
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)));
}
}
示例13: updateStatus
import com.intellij.openapi.wm.StatusBar; //導入依賴的package包/類
private void updateStatus() {
Editor editor = FileEditorManager.getInstance(myProject).getSelectedTextEditor();
if (editor == null || !editor.getContentComponent().hasFocus()){
return;
}
final Document document = editor.getDocument();
if (document instanceof DocumentEx && ((DocumentEx)document).isInBulkUpdate()) return;
int offset = editor.getCaretModel().getOffset();
DaemonCodeAnalyzer codeAnalyzer = DaemonCodeAnalyzer.getInstance(myProject);
HighlightInfo info = ((DaemonCodeAnalyzerImpl)codeAnalyzer).findHighlightByOffset(document, offset, false, HighlightSeverity.WARNING);
String text = info != null && info.getDescription() != null ? info.getDescription() : "";
StatusBar statusBar = WindowManager.getInstance().getStatusBar(editor.getContentComponent(), myProject);
if (statusBar != null && !text.equals(statusBar.getInfo())) {
statusBar.setInfo(text, "updater");
}
}
示例14: actionPerformed
import com.intellij.openapi.wm.StatusBar; //導入依賴的package包/類
@Override
public void actionPerformed(AnActionEvent e) {
final PsiElement[] elements = e.getData(LangDataKeys.PSI_ELEMENT_ARRAY);
if (elements == null) return;
final List<File> pycFiles = new ArrayList<File>();
ProgressManager.getInstance().runProcessWithProgressSynchronously(new Runnable() {
@Override
public void run() {
for (PsiElement element : elements) {
PsiDirectory dir = (PsiDirectory) element;
collectPycFiles(new File(dir.getVirtualFile().getPath()), pycFiles);
}
FileUtil.asyncDelete(pycFiles);
}
}, "Cleaning up .pyc files...", false, e.getProject());
final StatusBar statusBar = WindowManager.getInstance().getIdeFrame(e.getProject()).getStatusBar();
statusBar.setInfo("Deleted " + pycFiles.size() + " bytecode file" + (pycFiles.size() != 1 ? "s" : ""));
}
示例15: updateStatusBar
import com.intellij.openapi.wm.StatusBar; //導入依賴的package包/類
private void updateStatusBar() {
ApplicationManager.getApplication().invokeLater(new Runnable() {
@Override
public void run() {
IdeFrame frame = WindowManager.getInstance().getIdeFrame(myProject);
StatusBar statusBar = frame != null ? frame.getStatusBar() : null;
StatusBarWidget widget = statusBar != null ? statusBar.getWidget("LineSeparator") : null;
if (widget instanceof LineSeparatorPanel) {
FileEditorManagerEvent event = new FileEditorManagerEvent(FileEditorManager.getInstance(myProject),
null, null, null, null);
((LineSeparatorPanel)widget).selectionChanged(event);
}
}
});
}