本文整理汇总了Java中com.intellij.notification.NotificationGroup类的典型用法代码示例。如果您正苦于以下问题:Java NotificationGroup类的具体用法?Java NotificationGroup怎么用?Java NotificationGroup使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
NotificationGroup类属于com.intellij.notification包,在下文中一共展示了NotificationGroup类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: register
import com.intellij.notification.NotificationGroup; //导入依赖的package包/类
@Override
public void register(@NotNull String groupDisplayName,
@NotNull NotificationDisplayType displayType,
boolean shouldLog,
boolean shouldReadAloud) {
if (!isRegistered(groupDisplayName)) {
// register a new group and remember these settings as default
new NotificationGroup(groupDisplayName, displayType, shouldLog);
// and decide whether to save them explicitly (in case of non-default shouldReadAloud)
changeSettings(groupDisplayName, displayType, shouldLog, shouldReadAloud);
}
else if (displayType == NotificationDisplayType.TOOL_WINDOW && !hasToolWindowCapability(groupDisplayName)) {
// the first time with tool window capability
changeSettings(getSettings(groupDisplayName).withDisplayType(NotificationDisplayType.TOOL_WINDOW));
myToolWindowCapable.put(groupDisplayName, null);
}
}
示例2: warnUser
import com.intellij.notification.NotificationGroup; //导入依赖的package包/类
private void warnUser(Project project, List<Module> invalidModules) {
String message =
new StringBuilder()
.append("<p>")
.append(
GctBundle.message(
"appengine.support.java.version.alert.detail",
"<a href=\"" + UPDATE_HREF + "\">",
"</a>"))
.append("</p>")
.toString();
NotificationGroup notification =
new NotificationGroup(
GctBundle.message("appengine.support.java.version.alert.title"),
NotificationDisplayType.BALLOON,
true);
notification
.createNotification(
GctBundle.message("appengine.support.java.version.alert.title"),
message,
NotificationType.WARNING,
new LanguageLevelLinkListener(invalidModules))
.notify(project);
}
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-intellij,代码行数:27,代码来源:AppEngineStandardUnsupportedJavaVersionCheck.java
示例3: showNotification
import com.intellij.notification.NotificationGroup; //导入依赖的package包/类
public void showNotification(@NotNull final String title,
@NotNull final String message,
@NotNull final NotificationType type,
@NotNull final Project project,
@NotNull final ProjectSystemId externalSystemId,
@Nullable final NotificationListener listener)
{
UIUtil.invokeLaterIfNeeded(new Runnable() {
@Override
public void run() {
NotificationGroup group = ExternalSystemUtil.getToolWindowElement(NotificationGroup.class,
project,
ExternalSystemDataKeys.NOTIFICATION_GROUP,
externalSystemId);
if (group == null) {
return;
}
Notification notification = group.createNotification(title, message, type, listener);
applyNotification(notification, project);
}
});
}
示例4: notifyInspectionsFinished
import com.intellij.notification.NotificationGroup; //导入依赖的package包/类
@Override
protected void notifyInspectionsFinished() {
if (ApplicationManager.getApplication().isUnitTestMode()) return;
UIUtil.invokeLaterIfNeeded(new Runnable() {
@Override
public void run() {
LOG.info("Code inspection finished");
if (myView != null) {
if (!myView.update() && !getUIOptions().SHOW_ONLY_DIFF) {
NotificationGroup.toolWindowGroup("Inspection Results", ToolWindowId.INSPECTION, true)
.createNotification(InspectionsBundle.message("inspection.no.problems.message"), MessageType.INFO).notify(getProject());
close(true);
}
else {
addView(myView);
}
}
}
});
}
示例5: projectOpened
import com.intellij.notification.NotificationGroup; //导入依赖的package包/类
@Override
public void projectOpened() {
if (application.isUpdated() && !application.isUpdateNotificationShown()) {
application.setUpdateNotificationShown(true);
NotificationGroup group = new NotificationGroup(Version.PLUGIN_NAME, NotificationDisplayType.STICKY_BALLOON, true);
Notification notification = group.createNotification(
LombokBundle.message("daemon.donate.title", Version.PLUGIN_VERSION),
LombokBundle.message("daemon.donate.content"),
NotificationType.INFORMATION,
new NotificationListener.UrlOpeningListener(false)
);
Notifications.Bus.notify(notification);
}
}
示例6: register
import com.intellij.notification.NotificationGroup; //导入依赖的package包/类
@Override
public void register(@Nonnull String groupDisplayName,
@Nonnull NotificationDisplayType displayType,
boolean shouldLog,
boolean shouldReadAloud) {
if (!isRegistered(groupDisplayName)) {
// register a new group and remember these settings as default
new NotificationGroup(groupDisplayName, displayType, shouldLog);
// and decide whether to save them explicitly (in case of non-default shouldReadAloud)
changeSettings(groupDisplayName, displayType, shouldLog, shouldReadAloud);
}
else if (displayType == NotificationDisplayType.TOOL_WINDOW && !hasToolWindowCapability(groupDisplayName)) {
// the first time with tool window capability
changeSettings(getSettings(groupDisplayName).withDisplayType(NotificationDisplayType.TOOL_WINDOW));
myToolWindowCapable.put(groupDisplayName, null);
}
}
示例7: findParent
import com.intellij.notification.NotificationGroup; //导入依赖的package包/类
@Nullable
public static NotificationParentGroupBean findParent(@Nonnull NotificationSettings setting) {
prepareInfo();
String groupId = setting.getGroupId();
NotificationGroup group = NotificationGroup.findRegisteredGroup(groupId);
NotificationParentGroupBean parent;
if (group == null) {
parent = myGroupToParent.get(groupId);
}
else {
String parentId = group.getParentId();
if (parentId == null) {
parent = myGroupToParent.get(group.getDisplayId());
if (parent != null) {
group.setParentId(parent.id);
}
}
else {
parent = myParents.get(parentId);
}
}
return parent;
}
示例8: hotSwapSessions
import com.intellij.notification.NotificationGroup; //导入依赖的package包/类
private void hotSwapSessions( final List<DebuggerSession> sessions )
{
HotSwapProgressImpl findClassesProgress = new HotSwapProgressImpl( getIjProject() );
ApplicationManager.getApplication().executeOnPooledThread( () ->
{
final Map<DebuggerSession, Map<String, HotSwapFile>> modifiedClasses = scanForModifiedClassesWithProgress( sessions, findClassesProgress );
final Application application = ApplicationManager.getApplication();
if( modifiedClasses.isEmpty() )
{
final String message = DebuggerBundle.message( "status.hotswap.uptodate" );
NotificationGroup.toolWindowGroup( "HotSwap", ToolWindowId.DEBUG ).createNotification( message, NotificationType.INFORMATION ).notify( getIjProject() );
return;
}
application.invokeLater( () ->
{
if( !modifiedClasses.isEmpty() )
{
final HotSwapProgressImpl progress = new HotSwapProgressImpl( getIjProject() );
if( modifiedClasses.keySet().size() == 1 )
{
//noinspection ConstantConditions
progress.setSessionForActions( ContainerUtil.getFirstItem( modifiedClasses.keySet() ) );
}
application.executeOnPooledThread( () -> reloadModifiedClasses( modifiedClasses, progress ) );
}
}, ModalityState.NON_MODAL );
} );
}
示例9: askUserToDisablePlugins
import com.intellij.notification.NotificationGroup; //导入依赖的package包/类
private void askUserToDisablePlugins(Collection<IdeaPluginDescriptor> conflictingPlugins) {
final String text = formatMessage(conflictingPlugins);
NotificationGroup ng = NotificationGroup.balloonGroup("Conflicting Plugins");
ng.createNotification(PLUGIN_NAME, text, NotificationType.WARNING,
(notification, event) -> {
if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
for (IdeaPluginDescriptor foreignPlugin : conflictingPlugins) {
PluginManager.disablePlugin(foreignPlugin.getPluginId().toString());
}
Application application = ApplicationManager.getApplication();
application.restart();
}
}).notify(project);
}
示例10: ExternalProjectsViewImpl
import com.intellij.notification.NotificationGroup; //导入依赖的package包/类
public ExternalProjectsViewImpl(@NotNull Project project, @NotNull ToolWindowEx toolWindow, @NotNull ProjectSystemId externalSystemId) {
super(true, true);
myProject = project;
myToolWindow = toolWindow;
myExternalSystemId = externalSystemId;
myUiAware = ExternalSystemUiUtil.getUiAware(externalSystemId);
myProjectsManager = ExternalProjectsManager.getInstance(myProject);
String toolWindowId =
toolWindow instanceof ToolWindowImpl ? ((ToolWindowImpl)toolWindow).getId() : myExternalSystemId.getReadableName();
String notificationId = "notification.group.id." + externalSystemId.getId().toLowerCase(Locale.ENGLISH);
NotificationGroup registeredGroup = NotificationGroup.findRegisteredGroup(notificationId);
myNotificationGroup = registeredGroup != null ? registeredGroup : NotificationGroup.toolWindowGroup(notificationId, toolWindowId);
}
示例11: printToEventLog
import com.intellij.notification.NotificationGroup; //导入依赖的package包/类
private void printToEventLog(String message) {
NotificationGroup group = NotificationGroup.logOnlyGroup("typing-delay-stats");
Notification notification = group.createNotification(message, NotificationType.INFORMATION);
notification.setImportant(true);
notification.notify(myEditor.getProject());
notification.hideBalloon();
}
示例12: getAllSettings
import com.intellij.notification.NotificationGroup; //导入依赖的package包/类
public synchronized NotificationSettings[] getAllSettings() {
Collection<NotificationSettings> settings = new THashSet<NotificationSettings>(myIdToSettingsMap.values());
for (NotificationGroup group : NotificationGroup.getAllRegisteredGroups()) {
settings.add(getSettings(group.getDisplayId()));
}
NotificationSettings[] result = settings.toArray(new NotificationSettings[settings.size()]);
Arrays.sort(result, NOTIFICATION_SETTINGS_COMPARATOR);
return result;
}
示例13: getDefaultSettings
import com.intellij.notification.NotificationGroup; //导入依赖的package包/类
@NotNull
private static NotificationSettings getDefaultSettings(String groupId) {
NotificationGroup group = NotificationGroup.findRegisteredGroup(groupId);
if (group != null) {
return new NotificationSettings(groupId, group.getDisplayType(), group.isLogByDefault(), false);
}
return new NotificationSettings(groupId, NotificationDisplayType.BALLOON, true, false);
}
示例14: notify
import com.intellij.notification.NotificationGroup; //导入依赖的package包/类
@Override
@NotNull
public Notification notify(@NotNull NotificationGroup notificationGroup, @NotNull String title, @NotNull String message,
@NotNull NotificationType type, @Nullable NotificationListener listener) {
myLastNotification = new Notification(TEST_NOTIFICATION_GROUP, title, message, type, listener);
return myLastNotification;
}
示例15: showBalloon
import com.intellij.notification.NotificationGroup; //导入依赖的package包/类
public void showBalloon(@NotNull String title,
@NotNull String text,
@NotNull NotificationType type,
@NotNull NotificationGroup group,
@NotNull NotificationHyperlink... hyperlinks) {
NotificationListener notificationListener = new CustomNotificationListener(myProject, hyperlinks);
String newText = addHyperlinksToText(text, hyperlinks);
showBalloon(title, newText, type, group, notificationListener);
}