net.sourceforge.java.feednread.frontend.tray
Class TrayHandler

java.lang.Object
  extended bynet.sourceforge.java.feednread.frontend.tray.TrayHandler

public class TrayHandler
extends Object

Controls the Tray and TrayItem of the application.

Author:
Sebastian Machhausen

Nested Class Summary
private  class TrayHandler.TrayItemHandler
           Internal Event Handler class to make the application's system tray popup menu visible.
private  class TrayHandler.TraySelectionHandler
           Internal Event Handler class to restore the application window after is has been minimized to tray.
 
Field Summary
private  TrayItem appTrayItem
           The application's TrayItem
private  Menu appTrayItemMenu
           The application's tray item context Menu
private  MenuManager appTrayItemMenuManager
           The MenuManager used to construct the context Menu
private  TrayHandler.TrayItemHandler itemHandler
           Handles clicks to the TrayItem
private  MainApplicationWindow mainWindow
           The Feed'n Read main window
private  TrayHandler.TraySelectionHandler selectionHandler
           Handles selections with the TrayItem's context Menu
private  Tray tray
           The system Tray to handle
 
Constructor Summary
TrayHandler(MainApplicationWindow mainWindow)
           Creates a new TrayHandler if the system the application is running on supports a system tray area.
 
Method Summary
private  void createMenuManager()
           Creates the internal MenuManager used to manage the system tray menu of this application.
private  void createTrayItem()
           Creates the TrayItem for this application.
 void dispose()
           Disposes the TrayItem of this application if the system it is running on supports a system tray area.
private  void registerEventHandler()
           Creates and registers all event handler used in the context of this TrayHandler.
private  void unregisterEventHandler()
           Unregisters all event handler used in the context of this TrayHandler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mainWindow

private MainApplicationWindow mainWindow

The Feed'n Read main window


tray

private Tray tray

The system Tray to handle


appTrayItem

private TrayItem appTrayItem

The application's TrayItem


appTrayItemMenu

private Menu appTrayItemMenu

The application's tray item context Menu


appTrayItemMenuManager

private MenuManager appTrayItemMenuManager

The MenuManager used to construct the context Menu


selectionHandler

private TrayHandler.TraySelectionHandler selectionHandler

Handles selections with the TrayItem's context Menu


itemHandler

private TrayHandler.TrayItemHandler itemHandler

Handles clicks to the TrayItem

Constructor Detail

TrayHandler

public TrayHandler(MainApplicationWindow mainWindow)

Creates a new TrayHandler if the system the application is running on supports a system tray area.

Parameters:
mainWindow - the Feed'n Read main window
Method Detail

dispose

public void dispose()

Disposes the TrayItem of this application if the system it is running on supports a system tray area.


createTrayItem

private void createTrayItem()

Creates the TrayItem for this application.


createMenuManager

private void createMenuManager()

Creates the internal MenuManager used to manage the system tray menu of this application.


registerEventHandler

private void registerEventHandler()

Creates and registers all event handler used in the context of this TrayHandler.


unregisterEventHandler

private void unregisterEventHandler()

Unregisters all event handler used in the context of this TrayHandler.