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


Java Notification.expire方法代码示例

本文整理汇总了Java中com.intellij.notification.Notification.expire方法的典型用法代码示例。如果您正苦于以下问题:Java Notification.expire方法的具体用法?Java Notification.expire怎么用?Java Notification.expire使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.notification.Notification的用法示例。


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

示例1: UnableToSaveProjectNotification

import com.intellij.notification.Notification; //导入方法依赖的package包/类
public UnableToSaveProjectNotification(@NotNull final Project project, @NotNull VirtualFile[] readOnlyFiles) {
  super("Project Settings", "Could not save project", "Unable to save project files. Please ensure project files are writable and you have permissions to modify them." +
                                                       " <a href=\"\">Try to save project again</a>.", NotificationType.ERROR, new NotificationListener() {
    @Override
    public void hyperlinkUpdate(@NotNull Notification notification, @NotNull HyperlinkEvent event) {
      final UnableToSaveProjectNotification unableToSaveProjectNotification = (UnableToSaveProjectNotification)notification;
      final Project _project = unableToSaveProjectNotification.myProject;
      notification.expire();

      if (_project != null && !_project.isDisposed()) {
        _project.save();
      }
    }
  });

  myProject = project;
  myFiles = readOnlyFiles;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:ProjectManagerImpl.java

示例2: notifyAboutSyncedBranches

import com.intellij.notification.Notification; //导入方法依赖的package包/类
private void notifyAboutSyncedBranches() {
  String description =
    "You have several " + myVcs.getDisplayName() + " roots in the project and they all are checked out at the same branch. " +
    "We've enabled synchronous branch control for the project. <br/>" +
    "If you wish to control branches in different roots separately, " +
    "you may <a href='settings'>disable</a> the setting.";
  NotificationListener listener = new NotificationListener() {
    @Override
    public void hyperlinkUpdate(@NotNull Notification notification, @NotNull HyperlinkEvent event) {
      if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
        ShowSettingsUtil.getInstance().showSettingsDialog(myProject, myVcs.getConfigurable().getDisplayName());
        if (myVcsSettings.getSyncSetting() == DvcsSyncSettings.Value.DONT_SYNC) {
          notification.expire();
        }
      }
    }
  };
  VcsNotifier.getInstance(myProject).notifyImportantInfo("Synchronous branch control enabled", description, listener);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:DvcsBranchPopup.java

示例3: hyperlinkActivated

import com.intellij.notification.Notification; //导入方法依赖的package包/类
@Override
protected void hyperlinkActivated(@NotNull Notification notification, @NotNull HyperlinkEvent event) {
  if (event.getDescription().equals("configure") && !myProject.isDisposed()) {
    ShowSettingsUtil.getInstance().showSettingsDialog(myProject, ActionsBundle.message("group.VcsGroup.text"));
    Collection<VcsRootError> errorsAfterPossibleFix = getInstance(myProject).scan();
    if (errorsAfterPossibleFix.isEmpty() && !notification.isExpired()) {
      notification.expire();
    }
  }
  else if (event.getDescription().equals("ignore")) {
    mySettings.addIgnoredUnregisteredRoots(ContainerUtil.map(myImportantUnregisteredRoots, PATH_FROM_ROOT_ERROR));
    notification.expire();
  }
  else if (event.getDescription().equals("add")) {
    List<VcsDirectoryMapping> mappings = myVcsManager.getDirectoryMappings();
    for (VcsRootError root : myImportantUnregisteredRoots) {
      mappings = VcsUtil.addMapping(mappings, root.getMapping(), root.getVcsKey().getName());
    }
    myVcsManager.setDirectoryMappings(mappings);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:VcsRootProblemNotifier.java

示例4: hyperlinkActivated

import com.intellij.notification.Notification; //导入方法依赖的package包/类
@Override
protected void hyperlinkActivated(@NotNull Notification notification, @NotNull HyperlinkEvent e) {
  final Project project = myProjectRef.get();
  if (project != null && !project.isDisposed() && CompilerTask.showCompilerContent(project, myContentId)) {
    final ToolWindow tw = ToolWindowManager.getInstance(project).getToolWindow(ToolWindowId.MESSAGES_WINDOW);
    if (tw != null) {
      tw.activate(null, false);
    }
  }
  else {
    notification.expire();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:CompileDriver.java

示例5: hyperlinkUpdate

import com.intellij.notification.Notification; //导入方法依赖的package包/类
@Override
public void hyperlinkUpdate(@NotNull Notification notification, @NotNull HyperlinkEvent event) {
  if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
    final String description = event.getDescription();
    if ("allow".equals(description)) {
      mySettings.setAllowed(true);
      mySettings.setShowNotification(false);
      notification.expire();

      ApplicationManager.getApplication().executeOnPooledThread(new Runnable() {
        @Override
        public void run() {
           myStatisticsService.send();
        }
      });
    }
    else if ("decline".equals(description)) {
      mySettings.setAllowed(false);
      mySettings.setShowNotification(false);
      notification.expire();
    }
    else if ("settings".equals(description)) {
      final ShowSettingsUtil util = ShowSettingsUtil.getInstance();
      IdeFrame ideFrame = WindowManagerEx.getInstanceEx().findFrameFor(null);
      util.editConfigurable((JFrame)ideFrame, new StatisticsConfigurable(true));
      notification.expire();
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:30,代码来源:StatisticsNotificationManager.java

示例6: actionPerformed

import com.intellij.notification.Notification; //导入方法依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
  LogModel model = EventLog.getLogModel(e.getData(CommonDataKeys.PROJECT));
  for (Notification notification : model.getNotifications()) {
    model.removeNotification(notification);
    notification.expire();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:MarkAllNotificationsAsReadAction.java

示例7: showSetupFrameworksDialog

import com.intellij.notification.Notification; //导入方法依赖的package包/类
private void showSetupFrameworksDialog(Notification notification) {
  List<? extends DetectedFrameworkDescription> descriptions;
  try {
    descriptions = getValidDetectedFrameworks();
  }
  catch (IndexNotReadyException e) {
    DumbService.getInstance(myProject)
      .showDumbModeNotification("Information about detected frameworks is not available until indices are built");
    return;
  }

  if (descriptions.isEmpty()) {
    Messages.showInfoMessage(myProject, "No frameworks are detected", "Framework Detection");
    return;
  }
  final ConfigureDetectedFrameworksDialog dialog = new ConfigureDetectedFrameworksDialog(myProject, descriptions);
  if (dialog.showAndGet()) {
    notification.expire();
    List<DetectedFrameworkDescription> selected = dialog.getSelectedFrameworks();
    FrameworkDetectionUtil.setupFrameworks(selected, new PlatformModifiableModelsProvider(), new DefaultModulesProvider(myProject));
    for (DetectedFrameworkDescription description : selected) {
      final int detectorId = FrameworkDetectorRegistry.getInstance().getDetectorId(description.getDetector());
      myDetectedFrameworksData.putExistentFrameworkFiles(detectorId, description.getRelatedFiles());
    }
    ;
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:28,代码来源:FrameworkDetectionManager.java

示例8: showBalloon

import com.intellij.notification.Notification; //导入方法依赖的package包/类
public void showBalloon(@NotNull String title,
                        @NotNull String text,
                        @NotNull NotificationType type,
                        @NotNull NotificationGroup group,
                        @Nullable NotificationListener listener) {
  final Notification notification = group.createNotification(title, text, type, listener);
  Runnable notificationTask = new Runnable() {
    @Override
    public void run() {
      if (!myProject.isDisposed() && myProject.isOpen()) {
        Notification old = myNotification;
        if (old != null) {
          boolean similar = Objects.equal(notification.getContent(), old.getContent());
          if (similar) {
            old.expire();
          }
        }
        myNotification = notification;
        notification.notify(myProject);
      }
    }
  };
  Application application = ApplicationManager.getApplication();
  if (application.isDispatchThread()) {
    notificationTask.run();
  }
  else {
    application.invokeLater(notificationTask);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:31,代码来源:AndroidGradleNotification.java

示例9: hyperlinkUpdate

import com.intellij.notification.Notification; //导入方法依赖的package包/类
@Override public void hyperlinkUpdate(@NotNull final Notification notification, @NotNull HyperlinkEvent event) {
  if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED && event.getDescription().equals("resolve")) {
    notification.expire();
    ApplicationManager.getApplication().executeOnPooledThread(new Runnable() {
      @Override public void run() {
        mergeNoProceed();
      }
    });
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:GitConflictResolver.java

示例10: showSettingsAndExpireIfFixed

import com.intellij.notification.Notification; //导入方法依赖的package包/类
@Override
protected void showSettingsAndExpireIfFixed(@NotNull Notification notification) {
  showSettings();
  // always expire notification as different message could be detected
  notification.expire();

  myVcs.checkCommandLineVersion();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:SvnExecutableChecker.java

示例11: hyperlinkActivated

import com.intellij.notification.Notification; //导入方法依赖的package包/类
@Override
protected void hyperlinkActivated(@NotNull Notification notification, @NotNull HyperlinkEvent e) {
  URL url = e.getURL();
  if (url != null) openFile(new File(url.getPath()));
  notification.expire();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:ShowFilePathAction.java

示例12: expireAll

import com.intellij.notification.Notification; //导入方法依赖的package包/类
public void expireAll() {
  for (Notification notification : myNotificationManager.getNotificationsOfType(ExecutableNotValidNotification.class, myProject)) {
    notification.expire();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:SvnExecutableChecker.java


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