net.sourceforge.java.feednread.frontend.components.notificationbar
Class NotificationBar

java.lang.Object
  extended bynet.sourceforge.java.feednread.frontend.components.notificationbar.NotificationBar
All Implemented Interfaces:
EventListener, IJobListener, ILanguageResourceChangeListener

public class NotificationBar
extends Object
implements IJobListener, ILanguageResourceChangeListener

Component to display user notifications about the application status. On the one hand it displays the status of all currently active IJobs where on the other hand it displays log messages produced by application components.

Author:
Sebastian Machhausen

Field Summary
private  TableColumn durationColumn
           Job table: duration column
private  TableColumn jobNameColumn
           Job table: job name column
private  CTabItem jobStatusTabItem
           The CTabItem to hold the jobStatusTable
private  Table jobStatusTable
           The Table to display the currently active IJobs
private  JobStatusTableContentProvider jobStatusTableContentProvider
           The content provider to hold all JobStatus domain objects for the currently active IJobs
private  JobStatusTableLabelProvider jobStatusTableLabelProvider
           The label provider which converts the JobStatus objects to gui displayable objects
private  TableViewer jobStatusTableViewer
           The TableViewer to act as controller for the jobStatusTable
private  CTabItem logTabItem
           The CTabItem item to hold the logTable
private  Table logTable
           The Table to display the log
private  MainApplicationWindow mainWindow
           The Feed'n Read main window
private  TableColumn messageColumn
           Log table: Message column
private  Composite notificationBarContainer
           The container to hold all components
private  CTabFolder notificationTabFolder
           The CTabFolder to hold the notification tabs
private  TableColumn originColumn
           Log table: Origin column
private  TableColumn priorityColumn
           Job table: Priority column
private  TableColumn progressColumn
           Job table: progress column
private  TableColumn startTimeColumn
           Job table: Start time column
private  TableColumn statusColumn
           Job table: status column
private  TableColumn typeColumn
           Log table: Type column
 
Constructor Summary
NotificationBar(Composite parent, MainApplicationWindow mainWindow)
           Creates a new NotificationBar instance.
 
Method Summary
private  void createComponents(Composite parent)
           Creates the components used in the context of this NotificationBar.
private  void createJobStatusTable(Composite parent)
           Creates and sets up the Job table by creating the required view and model.
private  void createJobTableColumns()
           Creates the TableColumn objects for the JobStatus table and adjusts their settings.
private  void createLogTable(Composite parent)
           Creates and sets up the log table by creating the required view and model.
private  void createLogTableColumns()
           Creates the TableColumn objects for the logs table and adjusts their settings.
 void defaultLanguageChanged(LanguageResourceChangeEvent lrce)
           Called whenever the default language changes.
 void dispose()
           Disposes all resources claimed by this NotificationBar.
 boolean isVisible()
           Gets the visibility status of this NotificationBar component.
 void jobDone(JobEvent event)
           Indicates that an IJob is done.
 void jobStarted(JobEvent event)
           Indicates that an IJob was started.
 void jobStatusChanged(JobEvent event)
           Indicates that the status of an IJob changed.
private  void registerEventHandler()
           Creates and registers all event handlers required in this NotificationBar context.
 void setVisible(boolean visible)
           Sets the visibility status of this NotificationBar component.
private  void unregisterEventHandler()
           Unregisters all event handlers required in this NotificationBar context.
 
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


notificationBarContainer

private Composite notificationBarContainer

The container to hold all components


notificationTabFolder

private CTabFolder notificationTabFolder

The CTabFolder to hold the notification tabs


jobStatusTabItem

private CTabItem jobStatusTabItem

The CTabItem to hold the jobStatusTable


logTabItem

private CTabItem logTabItem

The CTabItem item to hold the logTable


jobStatusTable

private Table jobStatusTable

The Table to display the currently active IJobs


jobStatusTableViewer

private TableViewer jobStatusTableViewer

The TableViewer to act as controller for the jobStatusTable


jobStatusTableLabelProvider

private JobStatusTableLabelProvider jobStatusTableLabelProvider

The label provider which converts the JobStatus objects to gui displayable objects


priorityColumn

private TableColumn priorityColumn

Job table: Priority column


startTimeColumn

private TableColumn startTimeColumn

Job table: Start time column


jobNameColumn

private TableColumn jobNameColumn

Job table: job name column


progressColumn

private TableColumn progressColumn

Job table: progress column


durationColumn

private TableColumn durationColumn

Job table: duration column


statusColumn

private TableColumn statusColumn

Job table: status column


logTable

private Table logTable

The Table to display the log


typeColumn

private TableColumn typeColumn

Log table: Type column


messageColumn

private TableColumn messageColumn

Log table: Message column


originColumn

private TableColumn originColumn

Log table: Origin column


jobStatusTableContentProvider

private JobStatusTableContentProvider jobStatusTableContentProvider

The content provider to hold all JobStatus domain objects for the currently active IJobs

Constructor Detail

NotificationBar

public NotificationBar(Composite parent,
                       MainApplicationWindow mainWindow)

Creates a new NotificationBar instance.

Parameters:
parent - the Component to place this NotificationBar in
mainWindow - the Feed'n Read main window
Method Detail

dispose

public void dispose()

Disposes all resources claimed by this NotificationBar.


defaultLanguageChanged

public void defaultLanguageChanged(LanguageResourceChangeEvent lrce)

Called whenever the default language changes.

Specified by:
defaultLanguageChanged in interface ILanguageResourceChangeListener
Parameters:
lrce - the triggered LanguageResourceChangeEvent

setVisible

public void setVisible(boolean visible)

Sets the visibility status of this NotificationBar component.

Parameters:
visible - true for visible; false for invisible

isVisible

public boolean isVisible()

Gets the visibility status of this NotificationBar component.

Returns:
visible true if visible; false if invisible

jobStarted

public void jobStarted(JobEvent event)

Indicates that an IJob was started.

Specified by:
jobStarted in interface IJobListener
Parameters:
event - the triggered JobEvent

jobDone

public void jobDone(JobEvent event)

Indicates that an IJob is done.

Specified by:
jobDone in interface IJobListener
Parameters:
event - the triggered JobEvent

jobStatusChanged

public void jobStatusChanged(JobEvent event)

Indicates that the status of an IJob changed.

Specified by:
jobStatusChanged in interface IJobListener
Parameters:
event - the triggered JobEvent

createComponents

private void createComponents(Composite parent)

Creates the components used in the context of this NotificationBar.

Parameters:
parent - the component that this NotificationBar and its children should be placed in

createJobStatusTable

private void createJobStatusTable(Composite parent)

Creates and sets up the Job table by creating the required view and model.

Parameters:
parent - the parent container to embed the created Job table into

createJobTableColumns

private void createJobTableColumns()

Creates the TableColumn objects for the JobStatus table and adjusts their settings.


createLogTable

private void createLogTable(Composite parent)

Creates and sets up the log table by creating the required view and model.

Parameters:
parent - the parent container to embed the created log table into

createLogTableColumns

private void createLogTableColumns()

Creates the TableColumn objects for the logs table and adjusts their settings.


registerEventHandler

private void registerEventHandler()

Creates and registers all event handlers required in this NotificationBar context.


unregisterEventHandler

private void unregisterEventHandler()

Unregisters all event handlers required in this NotificationBar context.