本文整理汇总了Java中com.intellij.notification.NotificationType.INFORMATION属性的典型用法代码示例。如果您正苦于以下问题:Java NotificationType.INFORMATION属性的具体用法?Java NotificationType.INFORMATION怎么用?Java NotificationType.INFORMATION使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.intellij.notification.NotificationType
的用法示例。
在下文中一共展示了NotificationType.INFORMATION属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: notifyEnableMessage
public static void notifyEnableMessage(@NotNull final Project project) {
Notification notification = new Notification("Grav Plugin", "Grav Plugin",
"<a href=\"enable\">Enable</a> the Grav Plugin now, or open <a href=\"config\">Project Settings</a>. <br/>" +
"<a href=\"dismiss\">Do not</a> ask again.", NotificationType.INFORMATION, (notification1, event) -> {
// handle html click events
if ("config".equals(event.getDescription())) {
// open settings dialog and show panel
GravProjectConfigurable.show(project);
} else if ("enable".equals(event.getDescription())) {
enablePluginAndConfigure(project);
Notifications.Bus.notify(new Notification("Grav Plugin", "Grav Plugin", "Plugin enabled", NotificationType.INFORMATION), project);
} else if ("dismiss".equals(event.getDescription())) {
// user dont want to show notification again
GravProjectSettings.getInstance(project).dismissEnableNotification = true;
}
notification1.expire();
});
Notifications.Bus.notify(notification, project);
}
示例2: actionPerformed
@Override
public void actionPerformed(AnActionEvent e) {
final DataContext dataContext = e.getDataContext();
final Project project = CommonDataKeys.PROJECT.getData(dataContext);
List<String> fileNames = findTestDataFiles(dataContext);
if (fileNames == null || fileNames.isEmpty()) {
String testData = guessTestData(dataContext);
if (testData == null) {
String message = "Cannot find testdata files for class";
final Notification notification = new Notification("testdata", "Found no testdata files", message, NotificationType.INFORMATION);
Notifications.Bus.notify(notification, project);
return;
}
fileNames = Collections.singletonList(testData);
}
final Editor editor = e.getData(CommonDataKeys.EDITOR);
final JBPopupFactory popupFactory = JBPopupFactory.getInstance();
final RelativePoint point = editor != null ? popupFactory.guessBestPopupLocation(editor) : popupFactory.guessBestPopupLocation(dataContext);
TestDataNavigationHandler.navigate(point, fileNames, project);
}
示例3: createNotification
@NonNull
@Override
public Notification createNotification(@NotNull final String groupDisplayId,
@Nullable NotificationListener listener) {
final String fullProductName = ApplicationNamesInfo.getInstance().getFullProductName();
final String companyName = ApplicationInfo.getInstance().getCompanyName();
String text =
"<html>Please click <a href='allow'>I agree</a> if you want to help make " + fullProductName +
" better or <a href='decline'>I don't agree</a> otherwise. <a href='settings'>more...</a></html>";
String title = "Help improve " + fullProductName + " by sending usage statistics to " + companyName;
return new Notification(groupDisplayId, title,
text,
NotificationType.INFORMATION,
listener);
}
示例4: getMaximumType
@Nullable
private static NotificationType getMaximumType(List<Notification> notifications) {
NotificationType result = null;
for (Notification notification : notifications) {
if (NotificationType.ERROR == notification.getType()) {
return NotificationType.ERROR;
}
if (NotificationType.WARNING == notification.getType()) {
result = NotificationType.WARNING;
}
else if (result == null && NotificationType.INFORMATION == notification.getType()) {
result = NotificationType.INFORMATION;
}
}
return result;
}
示例5: notice
public static void notice(String message) {
Notification n = new Notification(
"extras",
"Notice",
String.format("%s - %s", MESSAGE_PREFIX, message),
NotificationType.INFORMATION);
Notifications.Bus.notify(n);
}
开发者ID:allandequeiroz,项目名称:random_image_background_any_jetbrains_plugin,代码行数:8,代码来源:NotificationCenter.java
示例6: notify
public static void notify(final IMPanel contactView,
final IContact target, final String title,
final CharSequence text) {
com.intellij.notification.Notifications.Bus.register("SmartIM", NotificationDisplayType.BALLOON);
Notification n = new Notification("SmartIM", title, StringUtils.isEmpty(text) ? "" : text.toString(), NotificationType.INFORMATION);
com.intellij.notification.Notifications.Bus.notify(n);
}
示例7: log
public static void log(String msg) {
Notification notification = new Notification(GROUP_ID, TITLE, msg, NotificationType.INFORMATION);//build a notification
//notification.hideBalloon();//didn't work
Notifications.Bus.notify(notification);//use the default bus to notify (application level)
Balloon balloon = notification.getBalloon();
if (balloon != null) {//fix: #20 潜在的NPE
balloon.hide(true);//try to hide the balloon immediately.
}
}
示例8: showPopupNotification
private static void showPopupNotification(Project project) {
String msg =
"Some relevant files (e.g. BUILD files, .blazeproject file) have changed "
+ "since the last sync. Please press the 'Sync' button in the toolbar to "
+ "re-sync your IntelliJ project.";
Notification notification =
new Notification(
NOTIFICATION_GROUP.getDisplayId(),
String.format("Changes since last %s sync", Blaze.buildSystemName(project)),
msg,
NotificationType.INFORMATION);
notification.setImportant(true);
Notifications.Bus.notify(notification, project);
}
示例9: getNotificationTypeForMessage
private NotificationType getNotificationTypeForMessage(LogMessage message)
{
if (message.error()) {
return NotificationType.ERROR;
} else if (message.notice()) {
return NotificationType.INFORMATION;
}
return NotificationType.WARNING;
}
示例10: iconForNotificationType
private Icon iconForNotificationType(NotificationType type) {
if (type == NotificationType.WARNING) {
return Messages.getWarningIcon();
} else if (type == NotificationType.ERROR) {
return Messages.getErrorIcon();
} else if (type == NotificationType.INFORMATION) {
return Messages.getInformationIcon();
} else {
return Messages.getErrorIcon();
}
}
示例11: error_notification_is_shown
@Then("^(success|warning|error) notification is shown '(.+)'$")
public void error_notification_is_shown(String notificationType, String title, String content) {
NotificationType type = notificationType.equals("success") ? NotificationType.INFORMATION :
notificationType.equals("warning") ? NotificationType.WARNING :
notificationType.equals("error") ? NotificationType.ERROR : null;
Notification actualNotification = lastNotification();
assertNotNull("Notification should be shown", actualNotification);
assertEquals("Notification type is incorrect in " + actualNotification, type, actualNotification.getType());
assertEquals("Notification title is incorrect in" + actualNotification, title, actualNotification.getTitle());
assertNotificationContent(content, actualNotification.getContent());
}
示例12: IncomingTipNotification
public IncomingTipNotification(IncomingAnswer incomingTip) {
super(GroupId,
MessageService.message("samebug.notification.incomingTip.title", incomingTip.getSolution().getDocument().getAuthor().getDisplayName()),
incomingTip.getSolution().getDocument().getMessage(),
NotificationType.INFORMATION,
null);
whenExpired(new Runnable() {
@Override
public void run() {
hideBalloon();
}
});
}
示例13: IncomingHelpRequestNotification
public IncomingHelpRequestNotification(IncomingHelpRequest helpRequest) {
super(GroupId,
MessageService.message("samebug.component.helpRequest.incoming.title", getRequesterName(helpRequest)),
getContext(helpRequest),
NotificationType.INFORMATION,
null);
whenExpired(new Runnable() {
@Override
public void run() {
hideBalloon();
}
});
}
示例14: handleFileTooBigException
protected void handleFileTooBigException(Logger logger, FilesTooBigForDiffException e, @NotNull PsiFile file) {
logger.info("Error while calculating changed ranges for: " + file.getVirtualFile(), e);
if (!ApplicationManager.getApplication().isUnitTestMode()) {
Notification notification = new Notification(ApplicationBundle.message("reformat.changed.text.file.too.big.notification.groupId"),
ApplicationBundle.message("reformat.changed.text.file.too.big.notification.title"),
ApplicationBundle.message("reformat.changed.text.file.too.big.notification.text", file.getName()),
NotificationType.INFORMATION);
notification.notify(file.getProject());
}
}
示例15: updateCourse
private void updateCourse() {
final Course course = StudyTaskManager.getInstance(myProject).getCourse();
if (course == null) {
return;
}
final File resourceDirectory = new File(course.getCourseDirectory());
if (!resourceDirectory.exists()) {
return;
}
StudyLanguageManager manager = StudyUtils.getLanguageManager(course);
if (manager == null) {
LOG.info("Study Language Manager is null for " + course.getLanguageById().getDisplayName());
return;
}
final File[] files = resourceDirectory.listFiles();
if (files == null) return;
for (File file : files) {
String testHelper = manager.getTestHelperFileName();
if (file.getName().equals(testHelper)) {
copyFile(file, new File(myProject.getBasePath(), testHelper));
}
if (file.getName().startsWith(EduNames.LESSON)) {
final File[] tasks = file.listFiles();
if (tasks == null) continue;
for (File task : tasks) {
final File taskDescr = new File(task, EduNames.TASK_HTML);
String testFileName = manager.getTestFileName();
final File taskTests = new File(task, testFileName);
copyFile(taskDescr, new File(new File(new File(myProject.getBasePath(), file.getName()), task.getName()), EduNames.TASK_HTML));
copyFile(taskTests, new File(new File(new File(myProject.getBasePath(), file.getName()), task.getName()),
testFileName));
}
}
}
final Notification notification =
new Notification("Update.course", "Course update", "Current course is synchronized", NotificationType.INFORMATION);
notification.notify(myProject);
}