当前位置: 首页>>代码示例>>Java>>正文


Java NotificationDisplayType类代码示例

本文整理汇总了Java中com.intellij.notification.NotificationDisplayType的典型用法代码示例。如果您正苦于以下问题:Java NotificationDisplayType类的具体用法?Java NotificationDisplayType怎么用?Java NotificationDisplayType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


NotificationDisplayType类属于com.intellij.notification包,在下文中一共展示了NotificationDisplayType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: register

import com.intellij.notification.NotificationDisplayType; //导入依赖的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);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:NotificationsConfigurationImpl.java

示例2: setValueAt

import com.intellij.notification.NotificationDisplayType; //导入依赖的package包/类
@Override
public void setValueAt(final Object value, final int rowIndex, final int columnIndex) {
  final SettingsWrapper wrapper = getSettings(rowIndex);

  switch (columnIndex) {
    case NotificationsTable.DISPLAY_TYPE_COLUMN:
      wrapper.myVersion = wrapper.myVersion.withDisplayType((NotificationDisplayType)value);
      break;
    case NotificationsTable.LOG_COLUMN:
      wrapper.myVersion = wrapper.myVersion.withShouldLog((Boolean)value);
      break;
    case NotificationsTable.READ_ALOUD_COLUMN:
      wrapper.myVersion = wrapper.myVersion.withShouldReadAloud((Boolean)value);
      break;
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:NotificationsConfigurablePanel.java

示例3: load

import com.intellij.notification.NotificationDisplayType; //导入依赖的package包/类
@Nullable
public static NotificationSettings load(@NotNull final Element element) {
  final String displayTypeString = element.getAttributeValue("displayType");
  NotificationDisplayType displayType = NotificationDisplayType.BALLOON;
  boolean shouldLog = !"false".equals(element.getAttributeValue("shouldLog"));
  boolean shouldReadAloud = "true".equals(element.getAttributeValue("shouldReadAloud"));
  if ("BALLOON_ONLY".equals(displayTypeString)) {
    shouldLog = false;
    displayType = NotificationDisplayType.BALLOON;
  }
  else if (displayTypeString != null) {
    try {
      displayType = NotificationDisplayType.valueOf(displayTypeString.toUpperCase());
    }
    catch (IllegalArgumentException ignored) {
    }
  }

  final String groupId = element.getAttributeValue("groupId");
  return groupId != null ? new NotificationSettings(groupId, displayType, shouldLog, shouldReadAloud) : null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:NotificationSettings.java

示例4: save

import com.intellij.notification.NotificationDisplayType; //导入依赖的package包/类
@NotNull
public Element save() {
  final Element result = new Element("notification");

  result.setAttribute("groupId", getGroupId());
  final NotificationDisplayType displayType = getDisplayType();
  if (displayType != NotificationDisplayType.BALLOON) {
    result.setAttribute("displayType", displayType.toString());
  }
  if (!myShouldLog) {
    result.setAttribute("shouldLog", "false");
  }
  if (myShouldReadAloud) {
    result.setAttribute("shouldReadAloud", "true");
  }

  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:NotificationSettings.java

示例5: MyPanel

import com.intellij.notification.NotificationDisplayType; //导入依赖的package包/类
MyPanel() {
  setText("You can format your XML resources in the 'standard' Android way. " +
          "Choose 'Set from... | Android' in the XML code style settings.");

  createActionLabel("Open code style settings", new Runnable() {
    @Override
    public void run() {
      ShowSettingsUtilImpl.showSettingsDialog(
        myProject, "preferences.sourceCode." + XmlCodeStyleSettingsProvider.CONFIGURABLE_DISPLAY_NAME, "");
        myNotifications.updateAllNotifications();
    }
  });

  createActionLabel("Disable notification", new Runnable() {
    @Override
    public void run() {
      NotificationsConfiguration.getNotificationsConfiguration()
        .changeSettings(ANDROID_XML_CODE_STYLE_NOTIFICATION_GROUP, NotificationDisplayType.NONE, false, false);
      myNotifications.updateAllNotifications();
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:AndroidCodeStyleNotificationProvider.java

示例6: warnUser

import com.intellij.notification.NotificationDisplayType; //导入依赖的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

示例7: load

import com.intellij.notification.NotificationDisplayType; //导入依赖的package包/类
@Nullable
public static NotificationSettings load(@NotNull final Element element) {
  final String displayTypeString = element.getAttributeValue("displayType");
  NotificationDisplayType displayType = NotificationDisplayType.BALLOON;
  boolean shouldLog = !"false".equals(element.getAttributeValue("shouldLog"));
  if ("BALLOON_ONLY".equals(displayTypeString)) {
    shouldLog = false;
    displayType = NotificationDisplayType.BALLOON;
  }
  else if (displayTypeString != null) {
    try {
      displayType = NotificationDisplayType.valueOf(displayTypeString.toUpperCase());
    }
    catch (IllegalArgumentException ignored) {
    }
  }

  final String groupId = element.getAttributeValue("groupId");
  return groupId != null ? new NotificationSettings(groupId, displayType, shouldLog) : null;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:21,代码来源:NotificationSettings.java

示例8: projectOpened

import com.intellij.notification.NotificationDisplayType; //导入依赖的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);
  }
}
 
开发者ID:mplushnikov,项目名称:lombok-intellij-plugin,代码行数:17,代码来源:LombokPluginUpdateProjectComponent.java

示例9: notifyAboutConnectionFailure

import com.intellij.notification.NotificationDisplayType; //导入依赖的package包/类
private void notifyAboutConnectionFailure(final TaskRepository repository, String details)
{
	Notifications.Bus.register(TASKS_NOTIFICATION_GROUP, NotificationDisplayType.BALLOON);
	String content = "<p><a href=\"\">Configure server...</a></p>";
	if(!StringUtil.isEmpty(details))
	{
		content = "<p>" + details + "</p>" + content;
	}
	Notifications.Bus.notify(new Notification(TASKS_NOTIFICATION_GROUP, "Cannot connect to " + repository.getUrl(), content, NotificationType.WARNING, new NotificationListener()
	{
		public void hyperlinkUpdate(@NotNull Notification notification, @NotNull HyperlinkEvent event)
		{
			TaskRepositoriesConfigurable configurable = new TaskRepositoriesConfigurable(myProject);
			ShowSettingsUtil.getInstance().editConfigurable(myProject, configurable);
			if(!ArrayUtil.contains(repository, getAllRepositories()))
			{
				notification.expire();
			}
		}
	}), myProject);
}
 
开发者ID:consulo,项目名称:consulo-tasks,代码行数:22,代码来源:TaskManagerImpl.java

示例10: value

import com.intellij.notification.NotificationDisplayType; //导入依赖的package包/类
@Override
public boolean value(Object o) {
    YiiStormProjectComponent component = YiiStormProjectComponent.getInstance((Project) o);

    Notifications.Bus.register("yiicnotfound", NotificationDisplayType.BALLOON);
    if (component.getBooleanProp("useYiiMigrations")) {
        boolean phpOk = CommonHelper.phpVersionCheck();
        if (component.getProp("yiicFile").length() < 1) {
            Notifications.Bus.notify(new Notification("yiistormMigration",
                    "YiiStorm migrations",
                    "Yiic not selected ",
                    NotificationType.WARNING));
            return false;
        }
        if (component.getProp("yiicFile") != null && phpOk && Yiic.yiicIsRunnable(component.getProp("yiicFile"))) {
            return true;
        } else {
            Notifications.Bus.notify(new Notification("yiistormMigration",
                    "YiiStorm migrations",
                    phpOk ? "Yiic file not configured." : "Can't run php. Check your system configuration. ",
                    NotificationType.WARNING));
        }
    }
    return false;
}
 
开发者ID:cmazx,项目名称:yiistorm,代码行数:26,代码来源:MigrationsCondition.java

示例11: register

import com.intellij.notification.NotificationDisplayType; //导入依赖的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);
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:18,代码来源:NotificationsConfigurationImpl.java

示例12: setValueAt

import com.intellij.notification.NotificationDisplayType; //导入依赖的package包/类
@Override
public void setValueAt(Object value, Object node, int column) {
  SettingsWrapper wrapper = (SettingsWrapper)((DefaultMutableTreeNode)node).getUserObject();

  switch (column) {
    case NotificationsTreeTable.DISPLAY_TYPE_COLUMN:
      wrapper.myVersion = wrapper.myVersion.withDisplayType((NotificationDisplayType)value);
      break;
    case NotificationsTreeTable.LOG_COLUMN:
      wrapper.myVersion = wrapper.myVersion.withShouldLog((Boolean)value);
      break;
    case NotificationsTreeTable.READ_ALOUD_COLUMN:
      wrapper.myVersion = wrapper.myVersion.withShouldReadAloud((Boolean)value);
      break;
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:17,代码来源:NotificationsConfigurablePanel.java

示例13: load

import com.intellij.notification.NotificationDisplayType; //导入依赖的package包/类
@Nullable
public static NotificationSettings load(@Nonnull final Element element) {
  final String displayTypeString = element.getAttributeValue("displayType");
  NotificationDisplayType displayType = NotificationDisplayType.BALLOON;
  boolean shouldLog = !"false".equals(element.getAttributeValue("shouldLog"));
  boolean shouldReadAloud = "true".equals(element.getAttributeValue("shouldReadAloud"));
  if ("BALLOON_ONLY".equals(displayTypeString)) {
    shouldLog = false;
    displayType = NotificationDisplayType.BALLOON;
  }
  else if (displayTypeString != null) {
    try {
      displayType = NotificationDisplayType.valueOf(displayTypeString.toUpperCase());
    }
    catch (IllegalArgumentException ignored) {
    }
  }

  final String groupId = element.getAttributeValue("groupId");
  return groupId != null ? new NotificationSettings(groupId, displayType, shouldLog, shouldReadAloud) : null;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:22,代码来源:NotificationSettings.java

示例14: save

import com.intellij.notification.NotificationDisplayType; //导入依赖的package包/类
@Nonnull
public Element save() {
  final Element result = new Element("notification");

  result.setAttribute("groupId", getGroupId());
  final NotificationDisplayType displayType = getDisplayType();
  if (displayType != NotificationDisplayType.BALLOON) {
    result.setAttribute("displayType", displayType.toString());
  }
  if (!myShouldLog) {
    result.setAttribute("shouldLog", "false");
  }
  if (myShouldReadAloud) {
    result.setAttribute("shouldReadAloud", "true");
  }

  return result;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:19,代码来源:NotificationSettings.java

示例15: notify

import com.intellij.notification.NotificationDisplayType; //导入依赖的package包/类
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);
}
 
开发者ID:Jamling,项目名称:SmartQQ4IntelliJ,代码行数:8,代码来源:Notifications.java


注:本文中的com.intellij.notification.NotificationDisplayType类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。