public class SysTrayPlugin extends java.lang.Object implements Plugin, NativeHandler, org.jivesoftware.smack.chat.ChatManagerListener, org.jivesoftware.smackx.chatstates.ChatStateListener
Constructor and Description |
---|
SysTrayPlugin() |
Modifier and Type | Method and Description |
---|---|
void |
addStatusMessages() |
boolean |
canShutDown()
This method is invoked by the
PluginManager before Spark
terminates. |
void |
chatCreated(org.jivesoftware.smack.chat.Chat chat,
boolean isLocal) |
void |
flashWindow(java.awt.Window window)
Flash the window.
|
void |
flashWindowStopWhenFocused(java.awt.Window window)
Start the flashing of the given window, but stop flashing when the window takes focus.
|
boolean |
handleNotification()
Return true if this
Alerter should handle the alert request. |
void |
initialize()
Invoked by the
PluginManager after the instance of the
Plugin is instantiated. |
void |
processMessage(org.jivesoftware.smack.chat.Chat arg0,
org.jivesoftware.smack.packet.Message arg1) |
void |
shutdown()
This method is invoked by the
PluginManager when Spark
wishes you to remove any temporary resources (in memory) such as installed
components, or settings. |
void |
stateChanged(org.jivesoftware.smack.chat.Chat chat,
org.jivesoftware.smackx.chatstates.ChatState state) |
void |
stopFlashing(java.awt.Window window)
Stop the flashing of the given window.
|
void |
uninstall()
This method is invoked by the
PluginManager when a Spark user
asks that this plugin be uninstalled. |
public boolean canShutDown()
Plugin
PluginManager
before Spark
terminates. Plugin
's should NOT use this method to release resources.
They should only use this method to give users the opportunity to
cancel the exit process if there is some process started by this
plugin still running.
Implementations should return false
to cancel the shutdown
process.canShutDown
in interface Plugin
public void initialize()
Plugin
PluginManager
after the instance of the
Plugin
is instantiated. When invoked, The Plugin
should register with whatever listeners they may need to use or are required
for use during this classes lifecycle. Plugin
authors should take
care to ensure that any extraneous initialization is not preformed on this method, and
any startup code that can be delayed until a later time is delayed, as
the Plugin
's are synchronously initialized during the
startup of Spark, and each Plugin
has the potential to
negatively impact the startup time of the product.initialize
in interface Plugin
PluginManager
public void addStatusMessages()
public void shutdown()
Plugin
PluginManager
when Spark
wishes you to remove any temporary resources (in memory) such as installed
components, or settings. Any non java resources (file handles, database connections,
etc) which are still being held by this Plugin
should be
released by this method immediately. This method is not guaranteed to
be called, but on normal terminations of Spark, this method will be
invoked.public void uninstall()
Plugin
PluginManager
when a Spark user
asks that this plugin be uninstalled. Before this method is called, you
will need to release all your in-memory resources in the #shutdown method. This
method should be used to remove on disk resources such as files, images, etc.public void flashWindow(java.awt.Window window)
NativeHandler
flashWindow
in interface NativeHandler
window
- the window to flash.public void flashWindowStopWhenFocused(java.awt.Window window)
NativeHandler
flashWindowStopWhenFocused
in interface NativeHandler
window
- the window to start flashing.public boolean handleNotification()
NativeHandler
Alerter
should handle the alert request.handleNotification
in interface NativeHandler
public void stopFlashing(java.awt.Window window)
NativeHandler
stopFlashing
in interface NativeHandler
window
- the window to stop flashing.public void processMessage(org.jivesoftware.smack.chat.Chat arg0, org.jivesoftware.smack.packet.Message arg1)
processMessage
in interface org.jivesoftware.smack.chat.ChatMessageListener
public void stateChanged(org.jivesoftware.smack.chat.Chat chat, org.jivesoftware.smackx.chatstates.ChatState state)
stateChanged
in interface org.jivesoftware.smackx.chatstates.ChatStateListener
public void chatCreated(org.jivesoftware.smack.chat.Chat chat, boolean isLocal)
chatCreated
in interface org.jivesoftware.smack.chat.ChatManagerListener