use of com.intellij.openapi.wm.StatusBar in project intellij-community by JetBrains.
the class StatusBarUpdater method updateStatus.
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, MIN);
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");
}
}
use of com.intellij.openapi.wm.StatusBar in project intellij-idea-plugin-connector-for-aws-lambda by satr.
the class MessageHelper method showMessage.
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 || isEmpty(format)) {
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);
}
}
use of com.intellij.openapi.wm.StatusBar in project google-cloud-intellij by GoogleCloudPlatform.
the class CloudSdkServiceManager method openBackgroundProcessWindow.
/**
* Exposes process window so that installation / dependent processes are explicitly visible.
*/
private void openBackgroundProcessWindow(Project project) {
WindowManager windowManager = WindowManager.getInstance();
StatusBar statusBar = windowManager.getStatusBar(project);
if (statusBar != null && statusBar instanceof StatusBarEx) {
((StatusBarEx) statusBar).setProcessWindowOpen(true);
}
}
use of com.intellij.openapi.wm.StatusBar in project azure-tools-for-java by Microsoft.
the class UpdateDeploymentForm method doOKAction.
@Override
protected void doOKAction() {
String deploymentName = deploymentNode.getDeployment().name();
final AzureString title = AzureOperationBundle.title("arm|deployment.update", deploymentName);
AzureTaskManager.getInstance().runInBackground(new AzureTask(project, title, false, () -> {
EventUtil.executeWithLog(TelemetryConstants.ARM, TelemetryConstants.UPDATE_DEPLOYMENT, (operation -> {
Deployment.Update update = deploymentNode.getDeployment().update();
String templatePath = templateTextField.getText();
update = update.withTemplate(IOUtils.toString(new FileReader(templatePath)));
String parametersPath = parametersTextField.getText();
if (!StringUtils.isEmpty(parametersPath)) {
String parameters = IOUtils.toString(new FileReader(parametersPath));
update = update.withParameters(DeploymentUtils.parseParameters(parameters));
}
update.withMode(DeploymentMode.INCREMENTAL).apply();
UIUtils.showNotification(statusBar, NOTIFY_UPDATE_DEPLOYMENT_SUCCESS, MessageType.INFO);
}), (e) -> {
UIUtils.showNotification(statusBar, NOTIFY_UPDATE_DEPLOYMENT_FAIL + ", " + e.getMessage(), MessageType.ERROR);
});
}));
close(OK_EXIT_CODE, true);
}
use of com.intellij.openapi.wm.StatusBar in project azure-tools-for-java by Microsoft.
the class CreateDeploymentAction method doActionPerformed.
private void doActionPerformed(NodeActionEvent e, boolean isLoggedIn, Project project) {
StatusBar statusBar = WindowManager.getInstance().getStatusBar(project);
try {
if (isLoggedIn) {
if (!AzureLoginHelper.isAzureSubsAvailableOrReportError(ERROR_CREATING_DEPLOYMENT)) {
return;
}
CreateDeploymentForm createDeploymentForm = new CreateDeploymentForm(project);
if (node instanceof ResourceManagementNode) {
ResourceManagementNode rmNode = (ResourceManagementNode) node;
createDeploymentForm.fillSubsAndRg(rmNode);
}
createDeploymentForm.show();
}
} catch (Exception ex) {
AzurePlugin.log(ERROR_CREATING_DEPLOYMENT, ex);
UIUtils.showNotification(statusBar, NOTIFY_CREATE_DEPLOYMENT_FAIL + ", " + ex.getMessage(), MessageType.ERROR);
}
}
Aggregations