private static boolean doClone( @NotNull Project project, @NotNull ProgressIndicator indicator, @NotNull Git git, @NotNull String directoryName, @NotNull String parentDirectory, @NotNull String sourceRepositoryUrl) { indicator.setIndeterminate(false); GitLineHandlerListener progressListener = GitStandardProgressAnalyzer.createListener(indicator); GitCommandResult result = git.clone( project, new File(parentDirectory), sourceRepositoryUrl, directoryName, progressListener); if (result.success()) { return true; } VcsNotifier.getInstance(project) .notifyError( CloudReposMessageBundle.message("clonefromgcp.failed"), result.getErrorOutputAsHtmlString() + "<br>" + result.getOutputAsJoinedString().replaceAll(URL_REGEX, "<a href=\"$0\">$0</a>"), new UrlOpeningListener(true)); return false; } }
public void projectOpened() { PerlApplicationSettings settings = PerlApplicationSettings.getInstance(); if (settings.shouldShowAnnounce()) { StartupManager.getInstance(myProject).runWhenProjectIsInitialized(() -> { settings.setAnnounceShown(); NotificationGroup group = new NotificationGroup(PerlBundle.message("plugin.update.baloon.group"), NotificationDisplayType.STICKY_BALLOON, true); Notification notification = group.createNotification( PerlBundle.message("plugin.update.baloon.title", PerlPluginUtil.getPluginVersion()), PerlBundle.message("plugin.update.baloon.text"), NotificationType.INFORMATION, new NotificationListener.UrlOpeningListener(false) ).setImportant(true) .addAction( new BrowseNotificationAction(PerlBundle.message("plugin.update.baloon.changes"), "https://plugins.jetbrains.com/plugin/7796")) .addAction(new BrowseNotificationAction(PerlBundle.message("plugin.update.baloon.tracker"), "https://github.com/hurricup/Perl5-IDEA/issues")) .addAction(new BrowseNotificationAction(PerlBundle.message("plugin.update.baloon.support"), "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=HJCUADZKY5G7E")); Notifications.Bus.notify(notification); }); } StartupManager.getInstance(myProject).runWhenProjectIsInitialized(() -> { PerlNamesCache.getInstance(myProject).forceCacheUpdate(); ApplicationManager.getApplication().invokeLater(FileContentUtil::reparseOpenedFiles); }); }
/** * Invoked when project opened, and check if the plugin is * updated and if should * show the notification window. */ @Override public void projectOpened() { if (applicationComponent.isUpdated() && !applicationComponent.isUpdateNotificationShown()) { applicationComponent.setUpdateNotificationShown(true); NotificationGroup balloonNotifications = new NotificationGroup( "Notification group", NotificationDisplayType.BALLOON, true); Notification success = balloonNotifications.createNotification( "HighlightBracketPair is updated to " +HighlightBracketPairSettings.getInstance().getVersion(), "<br/>If this plugin helps you, please give me a star on " + "<b><a href=\"https://github.com/qeesung/HighlightBracketPair\">Github</a>, ^_^.</b>", NotificationType.INFORMATION, new NotificationListener.UrlOpeningListener(true)); Notifications.Bus.notify(success, this.myProject); } }
@Override public void handle(SonarQubeNotification notification) { Notification notif = new Notification(GROUP_SONARQUBE_EVENT, "<b>SonarQube event</b>", createMessage(notification), NotificationType.INFORMATION, new NotificationListener.UrlOpeningListener(true)); notif.setImportant(true); notif.notify(myProject); }