public class NotificationBuilder
extends java.lang.Object
NotificationBuilder builder = new NotificationBuilder();
builder.setTitle("My title").setMessage("Random message").setIcon(myIcon);
build()
.DesktopNotify notification = builder.build();
DesktopNotify.show()
.notification.show();
builder.build().show();
reset()
to begin from scratch if you need
to.builder.reset();
buildAndReset()
, if you want to fetch your
new notification and erase all the contents set in the builder.DesktopNotify notification = builder.buildAndReset();
build()
, you can even chain calls with this.
builder.buildAndReset().show();
Constructor and Description |
---|
NotificationBuilder()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
DesktopNotify |
build()
Builds a new
DesktopNotify object. |
DesktopNotify |
buildAndReset()
Builds a new
DesktopNotify object, and then resets this
builder for you to begin bilding the next one from scratch. |
void |
reset()
Clears all saved data and sets this builder in blank, so you can start
from scratch again.
|
NotificationBuilder |
setAction(java.awt.event.ActionListener action)
Sets the ActionListener to use in the notification to build.
|
NotificationBuilder |
setIcon(java.awt.Image icon)
Sets the icon for the notification to build.
|
NotificationBuilder |
setMessage(java.lang.String message)
Sets the message for the notification to build.
|
NotificationBuilder |
setTextOrientation(int orientation)
Sets the prefered orientation of the text to be displayed, this
determines the default text alignment.
|
NotificationBuilder |
setTheme(NotifyTheme theme)
Sets the theme to use in the notification to build.
|
NotificationBuilder |
setTimeOut(long timeOut)
Sets the timeout for the notification to build.
|
NotificationBuilder |
setTitle(java.lang.String title)
Sets the title for the notification to build.
|
NotificationBuilder |
setType(int type)
Sets the type of notification to build.
|
public NotificationBuilder setTitle(java.lang.String title)
title
- The title.public NotificationBuilder setMessage(java.lang.String message)
message
- The message.public NotificationBuilder setIcon(java.awt.Image icon)
icon
- The icon.public NotificationBuilder setType(int type)
type
- The type of notification.public NotificationBuilder setTextOrientation(int orientation)
orientation
- The text orientation, either
DesktopNotify.LEFT_TO_RIGHT
or
DesktopNotify.RIGHT_TO_LEFT
.public NotificationBuilder setTimeOut(long timeOut)
timeOut
- The maximum time in milliseconds this notification will
stay on screen.public NotificationBuilder setAction(java.awt.event.ActionListener action)
action
- The ActionListener to use in the notification.public NotificationBuilder setTheme(NotifyTheme theme)
theme
- The theme to use in the notification.public DesktopNotify build()
DesktopNotify
object. Once you've got to this
point, apend a call to DesktopNotify.show()
to make it appear
inmmediately or just hold onto it until you need to show it.
You may continue from the current state in order to customize and build
a new notification.DesktopNotify
object for it to be used in any of your evil interests.public void reset()
public DesktopNotify buildAndReset()
DesktopNotify
object, and then resets this
builder for you to begin bilding the next one from scratch. Once you've
got to this point, apend a call to DesktopNotify.show()
to make it
appear inmmediately or just hold onto it until you need to show it.DesktopNotify
object for it to be used in any of your evil interests.