org.gswing.gui
Class MenuComponent

java.lang.Object
  extended by org.gswing.gui.MenuComponent
All Implemented Interfaces:
ActionListener, EventListener, IComponent, IDatabaseListener, IMenuComponent
Direct Known Subclasses:
CloseConnection, Exit, Help

public abstract class MenuComponent
extends Object
implements IMenuComponent, IDatabaseListener

Base class for all non GUI menu components.


Constructor Summary
MenuComponent(boolean useDbConnection)
          Constructor.
 
Method Summary
 void actionPerformed(ActionEvent arg0)
           
 void connectionChanged(boolean connected)
          A change in the database connection has occurred.
protected  IDatabaseManagement getDbManager()
          Get the database manager object.
protected  IFramework getFramework()
          Get the framework object.
protected  JMenuItem getMenuItem()
          Get the menu item that this component was created from.
 boolean initialise(IFramework framework)
          Initialise the component.
 boolean initialise(JMenuItem menuItem)
          Initialise the component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MenuComponent

public MenuComponent(boolean useDbConnection)
Constructor.

Parameters:
useDbConnection - Connect to the database manager?
Method Detail

initialise

public boolean initialise(JMenuItem menuItem)
Description copied from interface: IMenuComponent
Initialise the component. Through this method, components will get access to the framework and the menu item it was created from.

Specified by:
initialise in interface IMenuComponent
Parameters:
menuItem - The menu item that this component is invoked from.
Returns:
True if component has been successfully initialised.

initialise

public boolean initialise(IFramework framework)
Description copied from interface: IComponent
Initialise the component. Through this method, components will get access to the framework reference.

Specified by:
initialise in interface IComponent
Parameters:
framework - The GUI framework
Returns:
True if component has been successfully initialised.

actionPerformed

public void actionPerformed(ActionEvent arg0)
Specified by:
actionPerformed in interface ActionListener

connectionChanged

public void connectionChanged(boolean connected)
Description copied from interface: IDatabaseListener
A change in the database connection has occurred.

Specified by:
connectionChanged in interface IDatabaseListener
Parameters:
connected - True if the there is a valid database connection.

getFramework

protected IFramework getFramework()
Get the framework object.

Returns:
A reference to the framework object.

getDbManager

protected IDatabaseManagement getDbManager()
Get the database manager object.

Returns:
A reference to the database manager.

getMenuItem

protected JMenuItem getMenuItem()
Get the menu item that this component was created from.

Returns:
The menu item object.


Copyright © 2008. All Rights Reserved.