com.lowagie.rups.view

Class RupsMenuBar

public class RupsMenuBar extends JMenuBar implements Observer

Field Summary
static StringABOUT
Caption for "Help about".
static StringCLOSE
Caption for "Close file".
protected FileChooserActionfileChooserAction
The action needed to open a file.
static StringFILE_MENU
Caption for the file menu.
static StringHELP_MENU
Caption for the help menu.
protected HashMap<String,JMenuItem>items
The HashMap with all the actions.
protected Observableobservable
The Observable object.
static StringOPEN
Caption for "Open file".
static longserialVersionUID
A Serial Version UID.
static StringVERSIONS
Caption for "Help versions".
Constructor Summary
RupsMenuBar(Observable observable)
Creates a JMenuBar.
Method Summary
protected voidaddItem(JMenu menu, String caption, ActionListener action)
Create an item with a certain caption and a certain action, then add the item to a menu.
protected voidenableItem(String caption, boolean enabled)
Enables/disables a specific menu item
protected voidenableItems(boolean enabled)
Enables/Disables a series of menu items.
voidupdate(Observable observable, Object obj)

Field Detail

ABOUT

public static final String ABOUT
Caption for "Help about".

CLOSE

public static final String CLOSE
Caption for "Close file".

fileChooserAction

protected FileChooserAction fileChooserAction
The action needed to open a file.

FILE_MENU

public static final String FILE_MENU
Caption for the file menu.

HELP_MENU

public static final String HELP_MENU
Caption for the help menu.

items

protected HashMap<String,JMenuItem> items
The HashMap with all the actions.

observable

protected Observable observable
The Observable object.

OPEN

public static final String OPEN
Caption for "Open file".

serialVersionUID

private static final long serialVersionUID
A Serial Version UID.

VERSIONS

public static final String VERSIONS
Caption for "Help versions".

Constructor Detail

RupsMenuBar

public RupsMenuBar(Observable observable)
Creates a JMenuBar.

Parameters: observable the controller to which this menu bar is added

Method Detail

addItem

protected void addItem(JMenu menu, String caption, ActionListener action)
Create an item with a certain caption and a certain action, then add the item to a menu.

Parameters: menu the menu to which the item has to be added caption the caption of the item action the action corresponding with the caption

enableItem

protected void enableItem(String caption, boolean enabled)
Enables/disables a specific menu item

Parameters: caption the caption of the item that needs to be enabled/disabled enabled true for enabling; false for disabling

enableItems

protected void enableItems(boolean enabled)
Enables/Disables a series of menu items.

Parameters: enabled true for enabling; false for disabling

update

public void update(Observable observable, Object obj)

See Also: java.util.Observer#update(java.util.Observable, java.lang.Object)