當前位置: 首頁>>代碼示例>>Java>>正文


Java NotificationBuilder類代碼示例

本文整理匯總了Java中ch.swingfx.twinkle.NotificationBuilder的典型用法代碼示例。如果您正苦於以下問題:Java NotificationBuilder類的具體用法?Java NotificationBuilder怎麽用?Java NotificationBuilder使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


NotificationBuilder類屬於ch.swingfx.twinkle包,在下文中一共展示了NotificationBuilder類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createNotificationBuilder

import ch.swingfx.twinkle.NotificationBuilder; //導入依賴的package包/類
public static NotificationBuilder createNotificationBuilder()
{
	NotificationBuilder nb = new NotificationBuilder();
	LightDefaultNotification style = new LightDefaultNotification();
	style.withCloseButton(new NullCloseButton());
	nb.withStyle(style);
	nb.withFadeInAnimation(true);
	nb.withFadeOutAnimation(true);
	nb.withPosition(Positions.NORTH_EAST);
	nb.withDisplayTime(10000);

	return nb;
}
 
開發者ID:tfreier,項目名稱:desktop-crm,代碼行數:14,代碼來源:DesktopUtil.java

示例2: initCallTimer

import ch.swingfx.twinkle.NotificationBuilder; //導入依賴的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);
}
 
開發者ID:tfreier,項目名稱:desktop-crm,代碼行數:39,代碼來源:NotificationManager.java

示例3: initMeetingTimer

import ch.swingfx.twinkle.NotificationBuilder; //導入依賴的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);
}
 
開發者ID:tfreier,項目名稱:desktop-crm,代碼行數:39,代碼來源:NotificationManager.java

示例4: initActionTimer

import ch.swingfx.twinkle.NotificationBuilder; //導入依賴的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);
}
 
開發者ID:tfreier,項目名稱:desktop-crm,代碼行數:45,代碼來源:NotificationManager.java


注:本文中的ch.swingfx.twinkle.NotificationBuilder類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。