2.17.2: 2011-06-17

net.sf.basedb.clients.web.extensions.menu
Class MenuItemBean

java.lang.Object
  extended by net.sf.basedb.clients.web.extensions.menu.MenuItemBean
All Implemented Interfaces:
MenuItemAction, Action

public class MenuItemBean
extends Object
implements MenuItemAction

A simple bean-like implementation of the MenuItemAction interface.

Version:
2.7
Author:
nicklas
Last modified
$Date: 2008-09-11 22:05:50 +0200 (Thu, 11 Sep 2008) $

Nested Class Summary
 
Nested classes/interfaces inherited from interface net.sf.basedb.clients.web.extensions.menu.MenuItemAction
MenuItemAction.MenuType
 
Field Summary
private  boolean enabled
           
private  String icon
           
private  String menuId
           
private  String onClick
           
private  String style
           
private  String submenuId
           
private  String title
           
private  String tooltip
           
private  MenuItemAction.MenuType type
           
private  boolean visible
           
 
Constructor Summary
MenuItemBean()
          Create a new empty menu item action.
MenuItemBean(MenuItemAction.MenuType type, String menuId, String submenuId, String title, String onClick, String tooltip, String icon, String style, boolean enabled, boolean visible)
          Create a new initialised menu item action
 
Method Summary
 String getIcon()
          Get an absolute reference to an image that will be displayed in the menu.
 String getMenuId()
          The ID of the menu where this menu item belongs, or null if it belongs to the top-level menu.
 String getOnClick()
          A javascript action that is executed when the user clicks the menu.
 String getStyle()
          Extra CSS style attributes that will be added to the style attribute of the menu item div.
 String getSubmenuId()
          The ID of a new submenu.
 String getTitle()
          Get the title of the menu.
 String getTooltip()
          A tooltip that is shown as a yellow popup when the user points the mouse at the menu item.
 MenuItemAction.MenuType getType()
          The type of menu item.
 boolean isEnabled()
          If the menu item should be enabled or disabled.
 boolean isVisible()
          If the menu item should be visible or not.
 void setEnabled(boolean enabled)
           
 void setIcon(String icon)
           
 void setMenuId(String menuId)
           
 void setOnClick(String onClick)
           
 void setStyle(String style)
           
 void setSubmenuId(String submenuId)
           
 void setTitle(String title)
           
 void setTooltip(String tooltip)
           
 void setType(MenuItemAction.MenuType type)
           
 void setVisible(boolean visible)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

menuId

private String menuId

submenuId

private String submenuId

icon

private String icon

onClick

private String onClick

style

private String style

title

private String title

tooltip

private String tooltip

enabled

private boolean enabled

visible

private boolean visible

type

private MenuItemAction.MenuType type
Constructor Detail

MenuItemBean

public MenuItemBean()
Create a new empty menu item action.


MenuItemBean

public MenuItemBean(MenuItemAction.MenuType type,
                    String menuId,
                    String submenuId,
                    String title,
                    String onClick,
                    String tooltip,
                    String icon,
                    String style,
                    boolean enabled,
                    boolean visible)
Create a new initialised menu item action

Method Detail

getIcon

public String getIcon()
Description copied from interface: MenuItemAction
Get an absolute reference to an image that will be displayed in the menu. It is recommended that the image is 9 pixels wide and 12 pixels high to line up with the icons used by the BASE core menus.

Specified by:
getIcon in interface MenuItemAction
Returns:
A reference to an image, or null if no image should be used

getMenuId

public String getMenuId()
Description copied from interface: MenuItemAction
The ID of the menu where this menu item belongs, or null if it belongs to the top-level menu.

Specified by:
getMenuId in interface MenuItemAction

getOnClick

public String getOnClick()
Description copied from interface: MenuItemAction
A javascript action that is executed when the user clicks the menu. BASE has builtin scripts for opening a page in a popup window or opening a page in the main window:

Specified by:
getOnClick in interface MenuItemAction
Returns:
The javascript action

getStyle

public String getStyle()
Description copied from interface: MenuItemAction
Extra CSS style attributes that will be added to the style attribute of the menu item div.

Specified by:
getStyle in interface MenuItemAction
Returns:
Style attributes, or null

getSubmenuId

public String getSubmenuId()
Description copied from interface: MenuItemAction
The ID of a new submenu. This value is required when the menu item is a MenuItemAction.MenuType.SUBMENU, and is ignored otherwise.

Specified by:
getSubmenuId in interface MenuItemAction

getTitle

public String getTitle()
Description copied from interface: MenuItemAction
Get the title of the menu.

Specified by:
getTitle in interface MenuItemAction

getTooltip

public String getTooltip()
Description copied from interface: MenuItemAction
A tooltip that is shown as a yellow popup when the user points the mouse at the menu item.

Specified by:
getTooltip in interface MenuItemAction
Returns:
The tooltip or null to not display any tooltip

getType

public MenuItemAction.MenuType getType()
Description copied from interface: MenuItemAction
The type of menu item.

Specified by:
getType in interface MenuItemAction

isEnabled

public boolean isEnabled()
Description copied from interface: MenuItemAction
If the menu item should be enabled or disabled.

Specified by:
isEnabled in interface MenuItemAction

isVisible

public boolean isVisible()
Description copied from interface: MenuItemAction
If the menu item should be visible or not.

Specified by:
isVisible in interface MenuItemAction

setIcon

public void setIcon(String icon)

setMenuId

public void setMenuId(String menuId)

setOnClick

public void setOnClick(String onClick)

setStyle

public void setStyle(String style)

setSubmenuId

public void setSubmenuId(String submenuId)

setTitle

public void setTitle(String title)

setTooltip

public void setTooltip(String tooltip)

setEnabled

public void setEnabled(boolean enabled)

setVisible

public void setVisible(boolean visible)

setType

public void setType(MenuItemAction.MenuType type)

2.17.2: 2011-06-17