Skip to content

Commit

Permalink
update for removing a deprecated API.
Browse files Browse the repository at this point in the history
  • Loading branch information
jumperchen committed Jul 29, 2022
1 parent 6ccc88a commit f803616
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/main/java/org/zkoss/zkidea/newsNotification/ZKNews.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@
*/
package org.zkoss.zkidea.newsNotification;

import java.io.File;
import java.io.IOException;

import com.intellij.ide.BrowserUtil;
import com.intellij.notification.NotificationAction;
import com.intellij.notification.NotificationGroupManager;
import com.intellij.notification.NotificationListener;
import com.intellij.notification.NotificationType;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.startup.StartupActivity;
Expand All @@ -21,9 +25,8 @@
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;

import org.zkoss.zkidea.project.ZKPathManager;
import java.io.File;
import java.io.IOException;

public class ZKNews implements StartupActivity {
public static final String ZK_WEBSITE_URL = "http://www.zkoss.org?ide=in";
Expand All @@ -48,8 +51,9 @@ private void newsNotificationPopup(Project project) throws IOException {
if(!news.equals(newsCache)) {
FileUtil.writeToFile(zkNewsFile, news);
NotificationGroupManager.getInstance().getNotificationGroup("news notification")
.createNotification(news + " Visit <a href=\"" + ZK_WEBSITE_URL + "&read=more#news-sec\">zkoss.org</a> for detail.", NotificationType.INFORMATION)
.setListener(new NotificationListener.UrlOpeningListener(true))
.createNotification(news, NotificationType.INFORMATION)
.addAction(NotificationAction.createSimpleExpiring("Visit zkoss.org for detail.",
() -> BrowserUtil.browse(ZK_WEBSITE_URL + "&read=more#news-sec")))
.notify(project);
}
}
Expand Down

0 comments on commit f803616

Please sign in to comment.