use of com.intellij.notification.Notification in project ideavim by JetBrains.
the class VimShortcutKeyAction method notifyAboutShortcutConflict.
private void notifyAboutShortcutConflict(@NotNull final KeyStroke keyStroke) {
VimPlugin.getKey().getSavedShortcutConflicts().put(keyStroke, ShortcutOwner.VIM);
final String message = String.format("Using the <b>%s</b> shortcut for Vim emulation.<br/>" + "You can redefine it as an <a href='#ide'>IDE shortcut</a> or " + "configure its handler in <a href='#settings'>Vim Emulation</a> settings.", KeymapUtil.getShortcutText(new KeyboardShortcut(keyStroke, null)));
final NotificationListener listener = new NotificationListener.Adapter() {
@Override
protected void hyperlinkActivated(@NotNull Notification notification, @NotNull HyperlinkEvent e) {
final String description = e.getDescription();
if ("#ide".equals(description)) {
VimPlugin.getKey().getSavedShortcutConflicts().put(keyStroke, ShortcutOwner.IDE);
notification.expire();
} else if ("#settings".equals(description)) {
ShowSettingsUtil.getInstance().editConfigurable((Project) null, new VimEmulationConfigurable());
}
}
};
final Notification notification = new Notification(VimPlugin.IDEAVIM_NOTIFICATION_ID, VimPlugin.IDEAVIM_NOTIFICATION_TITLE, message, NotificationType.INFORMATION, listener);
notification.notify(null);
}
use of com.intellij.notification.Notification in project intellij-community by JetBrains.
the class AutoMakeMessageHandler method sessionTerminated.
@Override
public void sessionTerminated(UUID sessionId) {
String statusMessage = null;
switch(myBuildStatus) {
case SUCCESS:
//statusMessage = "Auto make completed successfully";
break;
case UP_TO_DATE:
//statusMessage = "All files are up-to-date";
break;
case ERRORS:
statusMessage = "Auto build completed with errors";
break;
case CANCELED:
//statusMessage = "Auto make has been canceled";
break;
}
if (statusMessage != null) {
final Notification notification = CompilerManager.NOTIFICATION_GROUP.createNotification(statusMessage, MessageType.INFO);
if (!myProject.isDisposed()) {
notification.notify(myProject);
}
myProject.putUserData(LAST_AUTO_MAKE_NOFITICATION, notification);
} else {
Notification notification = myProject.getUserData(LAST_AUTO_MAKE_NOFITICATION);
if (notification != null) {
notification.expire();
myProject.putUserData(LAST_AUTO_MAKE_NOFITICATION, null);
}
}
if (!myProject.isDisposed()) {
final ProblemsView view = ProblemsView.SERVICE.getInstance(myProject);
view.clearProgress();
view.clearOldMessages(null, sessionId);
}
}
use of com.intellij.notification.Notification in project intellij-community by JetBrains.
the class PackageFileWorker method startPackagingFiles.
public static ActionCallback startPackagingFiles(final Project project, final List<VirtualFile> files, final Artifact[] artifacts, final boolean packIntoArchives) {
final ActionCallback callback = new ActionCallback();
ProgressManager.getInstance().run(new Task.Backgroundable(project, "Packaging Files") {
@Override
public void run(@NotNull ProgressIndicator indicator) {
try {
for (final VirtualFile file : files) {
indicator.checkCanceled();
new ReadAction() {
@Override
protected void run(@NotNull final Result result) {
try {
packageFile(file, project, artifacts, packIntoArchives);
} catch (IOException e) {
String message = CompilerBundle.message("message.tect.package.file.io.error", e.toString());
Notifications.Bus.notify(new Notification("Package File", "Cannot package file", message, NotificationType.ERROR));
}
}
}.execute();
callback.setDone();
}
} finally {
if (!callback.isDone()) {
callback.setRejected();
}
}
}
});
return callback;
}
use of com.intellij.notification.Notification in project WebStormRequireJsPlugin by Fedott.
the class RequirejsProjectComponent method showInfoNotification.
public void showInfoNotification(String content, NotificationType type) {
Notification errorNotification = new Notification("Require.js plugin", "Require.js plugin", content, type);
Notifications.Bus.notify(errorNotification, this.project);
}
use of com.intellij.notification.Notification in project android by JetBrains.
the class AndroidCompileUtil method addSourceRoot.
@Nullable
public static SourceFolder addSourceRoot(final ModifiableRootModel model, @NotNull final VirtualFile root) {
ContentEntry contentEntry = findContentEntryForRoot(model, root);
if (contentEntry == null) {
final Project project = model.getProject();
final String message = "Cannot mark directory '" + FileUtil.toSystemDependentName(root.getPath()) + "' as source root, because it is not located under content root of module '" + model.getModule().getName() + "'\n<a href='fix'>Open Project Structure</a>";
final Notification notification = new Notification(AndroidBundle.message("android.autogeneration.notification.group"), "Autogeneration Error", message, NotificationType.ERROR, new NotificationListener.Adapter() {
@Override
protected void hyperlinkActivated(@NotNull Notification notification, @NotNull HyperlinkEvent e) {
notification.expire();
final ProjectStructureConfigurable configurable = ProjectStructureConfigurable.getInstance(project);
ShowSettingsUtil.getInstance().editConfigurable(project, configurable, new Runnable() {
@Override
public void run() {
final Module module = model.getModule();
final AndroidFacet facet = AndroidFacet.getInstance(module);
if (facet != null) {
configurable.select(facet, true);
}
}
});
}
});
Notifications.Bus.notify(notification, project);
LOG.debug(message);
return null;
} else {
return contentEntry.addSourceFolder(root, JavaSourceRootType.SOURCE, JpsJavaExtensionService.getInstance().createSourceRootProperties("", true));
}
}
Aggregations