org.aspsimon.termcomp.infrastructure
Class MenuTracker

java.lang.Object
  extended by org.aspsimon.termcomp.infrastructure.MenuTracker
All Implemented Interfaces:
MenuInterface

@Name(value="menuTracker")
@Scope(value=SESSION)
public class MenuTracker
extends java.lang.Object
implements MenuInterface

This class implements the state of the drop-down menu for the current session. The drop-down menu currently has three panels. This class uses an AutoHashMap to track the state of the panels. As this bean is marked @Stateful with scope SESSION, it should be destroyed when a session expires.

Version:
$Revision: 104 $
Author:
binabik

Constructor Summary
MenuTracker()
           
 
Method Summary
 void actionPerformed(javax.faces.event.ActionEvent action)
          This method stores the current state of the menu panel passed as parameter.
 void create()
          This is the default create method, initializes the AutoHashMap.
 void destroy()
          Stateful beans require a method marked @Remove.
 java.util.Map<java.lang.String,java.lang.Boolean> getMenuMap()
          Return the Map tracking the state of the panels.
 void setMenuMap(java.util.Map<java.lang.String,java.lang.Boolean> menuMap)
          Set the menu panel map.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MenuTracker

public MenuTracker()
Method Detail

create

@Create
public void create()
This is the default create method, initializes the AutoHashMap.

Specified by:
create in interface MenuInterface

destroy

public void destroy()
Stateful beans require a method marked @Remove.

Specified by:
destroy in interface MenuInterface

getMenuMap

public java.util.Map<java.lang.String,java.lang.Boolean> getMenuMap()
Return the Map tracking the state of the panels.

Specified by:
getMenuMap in interface MenuInterface
Returns:
The menu panel map.

setMenuMap

public void setMenuMap(java.util.Map<java.lang.String,java.lang.Boolean> menuMap)
Set the menu panel map.

Specified by:
setMenuMap in interface MenuInterface
Parameters:
menuMap - The menu panel map to set.

actionPerformed

public void actionPerformed(javax.faces.event.ActionEvent action)
This method stores the current state of the menu panel passed as parameter. It determines which panel was clicked and toggles the corresponding boolean value.

Specified by:
actionPerformed in interface MenuInterface
Parameters:
action - An ActionEvent fired by the click on the panel header.