本文整理汇总了Java中ch.swingfx.twinkle.event.NotificationEventAdapter类的典型用法代码示例。如果您正苦于以下问题:Java NotificationEventAdapter类的具体用法?Java NotificationEventAdapter怎么用?Java NotificationEventAdapter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NotificationEventAdapter类属于ch.swingfx.twinkle.event包,在下文中一共展示了NotificationEventAdapter类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initCallTimer
import ch.swingfx.twinkle.event.NotificationEventAdapter; //导入依赖的package包/类
/**
*
*/
private static void initCallTimer()
{
UiUtil.runAndRepeat(new Runnable() {
@Override
public void run()
{
System.out.println("Check for calls...");
if (DataStoreManager.getSettings().isCallReminder())
{
final Call c = CrmManager.getUpcomingCall();
if (c != null)
{
String msg = "You have an upcoming call: " + c.getTitle();
NotificationBuilder nb = DesktopUtil.createNotificationBuilder();
nb.withTitle("Upcoming Call");
nb.withMessage(msg);
nb.withIcon(CrmIcons.CALL);
nb.withDisplayTime(30000);
nb.withListener(new NotificationEventAdapter() {
@Override
public void clicked(NotificationEvent event)
{
DesktopUtil.openBrowser(c.getViewUrl());
}
});
nb.showNotification();
}
}
}
}, 5000, 120000);
}
示例2: initMeetingTimer
import ch.swingfx.twinkle.event.NotificationEventAdapter; //导入依赖的package包/类
/**
*
*/
private static void initMeetingTimer()
{
UiUtil.runAndRepeat(new Runnable() {
@Override
public void run()
{
System.out.println("Check for meetings...");
if (DataStoreManager.getSettings().isMeetingReminder())
{
final Meeting c = CrmManager.getUpcomingMeeting();
if (c != null)
{
String msg = "You have an upcoming meeting: " + c.getTitle();
NotificationBuilder nb = DesktopUtil.createNotificationBuilder();
nb.withTitle("Upcoming Meeting");
nb.withMessage(msg);
nb.withIcon(CrmIcons.COFFEE);
nb.withDisplayTime(30000);
nb.withListener(new NotificationEventAdapter() {
@Override
public void clicked(NotificationEvent event)
{
DesktopUtil.openBrowser(c.getViewUrl());
}
});
nb.showNotification();
}
}
}
}, 7000, 120000);
}
示例3: initActionTimer
import ch.swingfx.twinkle.event.NotificationEventAdapter; //导入依赖的package包/类
/**
*
*/
private static void initActionTimer()
{
UiUtil.runAndRepeat(new Runnable() {
@Override
public void run()
{
List<AbstractCrmObject> leadList = CrmHelper.getActionObjects();
for (final AbstractCrmObject lead : leadList)
{
System.out.println("request action item for " + lead.getTitle());
String msg = "'" + lead.getTitle() + "' has no planned actions. Click here to schedule a task.";
NotificationBuilder nb = DesktopUtil.createNotificationBuilder();
nb.withTitle("Plan Follow Up Action");
nb.withMessage(msg);
nb.withIcon(CrmIcons.TALK);
nb.withDisplayTime(60000);
nb.withListener(new NotificationEventAdapter() {
@Override
public void clicked(NotificationEvent event)
{
DesktopUtil.openBrowser(lead.getViewUrl());
}
});
nb.showNotification();
// wait 2 minutes
try
{
Thread.sleep(180000);
}
catch (InterruptedException e1)
{
e1.printStackTrace();
}
}
}
}, 3000, 300000);
}