当前位置: 首页>>代码示例>>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;未经允许,请勿转载。