use of com.intellij.notification.Notification in project Intellij-Plugin by getgauge.
the class GaugeWebBrowserPreview method previewUrl.
@Nullable
private Url previewUrl(OpenInBrowserRequest request, VirtualFile virtualFile, GaugeSettingsModel settings) throws IOException, InterruptedException {
ProcessBuilder builder = new ProcessBuilder(settings.getGaugePath(), Constants.DOCS, Spectacle.NAME, virtualFile.getPath());
String projectName = request.getProject().getName();
builder.environment().put("spectacle_out_dir", FileUtil.join(createOrGetTempDirectory(projectName).getPath(), "docs"));
File gaugeModuleDir = GaugeUtil.moduleDir(GaugeUtil.moduleForPsiElement(request.getFile()));
builder.directory(gaugeModuleDir);
GaugeUtil.setGaugeEnvironmentsTo(builder, settings);
Process docsProcess = builder.start();
int exitCode = docsProcess.waitFor();
if (exitCode != 0) {
String docsOutput = String.format("<pre>%s</pre>", GaugeUtil.getOutput(docsProcess.getInputStream(), " ").replace("<", "<").replace(">", ">"));
Notifications.Bus.notify(new Notification("Specification Preview", "Error: Specification Preview", docsOutput, NotificationType.ERROR));
return null;
}
String relativePath = FileUtil.getRelativePath(gaugeModuleDir, new File(virtualFile.getParent().getPath()));
return new UrlImpl(FileUtil.join(createOrGetTempDirectory(projectName).getPath(), "docs", "html", relativePath, virtualFile.getNameWithoutExtension() + ".html"));
}
use of com.intellij.notification.Notification in project Intellij-Plugin by getgauge.
the class Spectacle method notifyToInstall.
void notifyToInstall() {
Notification notification = STANDARD_NOTIFICATION.createNotification("Error: Specification Preview", "Missing plugin: Spectacle. To install, run `gauge install spectacle` or click below", NotificationType.ERROR, null);
notification.addAction(new NotificationAction("Install Spectacle") {
@Override
public void actionPerformed(@NotNull AnActionEvent e, @NotNull Notification notification) {
install();
notification.expire();
}
});
Notifications.Bus.notify(notification);
}
use of com.intellij.notification.Notification in project intellij-plugins by JetBrains.
the class PhoneGapProjectTemplateGenerator method showErrorMessage.
private static void showErrorMessage(@NotNull String message) {
String fullMessage = PhoneGapBundle.message("phonegap.project.template.error.text", message);
String title = PhoneGapBundle.message("phonegap.project.template.error.notification.title");
Notifications.Bus.notify(new Notification(PhoneGapBundle.message("phonegap.project.template.error.notification"), title, fullMessage, NotificationType.ERROR));
}
use of com.intellij.notification.Notification in project intellij-plugins by JetBrains.
the class PhoneGapExecutableChecker method noPhoneGap.
private static void noPhoneGap() {
String groupDisplayId = "PhoneGap notification";
String notificationTitle = "PhoneGap Plugin";
String notificationMessage = "PhoneGap/Cordova has incorrect executable path";
NotificationType notificationType = NotificationType.ERROR;
Notification notification = new Notification(groupDisplayId, notificationTitle, notificationMessage, notificationType);
Notifications.Bus.notify(notification);
}
use of com.intellij.notification.Notification in project scss-lint-plugin by idok.
the class ScssLintProjectComponent method showInfoNotification.
public void showInfoNotification(String content, NotificationType type) {
Notification errorNotification = new Notification(PLUGIN_NAME, PLUGIN_NAME, content, type);
Notifications.Bus.notify(errorNotification, this.project);
}
Aggregations