org.exoplatform.gwtframework.ui.client.menu
Class MenuItem

java.lang.Object
  extended by org.exoplatform.gwtframework.ui.client.menu.MenuItem
Direct Known Subclasses:
MenuBarItem, PopupMenuItem

public abstract class MenuItem
extends java.lang.Object

Created by The eXo Platform SAS .

Version:
$ Menu item interface which represents buttons on Menu Bar and item in the Popup Menu.
Author:
Vitaliy Gulyy

Constructor Summary
MenuItem()
           
 
Method Summary
abstract  MenuItem addItem(java.lang.String title)
          Create new MenuItem with specified parameters and add it to the list of children.
abstract  MenuItem addItem(java.lang.String title, com.google.gwt.user.client.Command command)
          Create new MenuItem with specified parameters and add it to the list of children.
abstract  MenuItem addItem(java.lang.String icon, java.lang.String title)
          Create new MenuItem with specified parameters and add it to the list of children.
abstract  MenuItem addItem(java.lang.String icon, java.lang.String title, com.google.gwt.user.client.Command command)
          Create new MenuItem with specified parameters and add it to the list of children.
abstract  com.google.gwt.user.client.Command getCommand()
          Get command
abstract  java.lang.String getHotKey()
          Get Hot Key value
abstract  java.lang.String getIcon()
          Get icon.
abstract  java.util.List<MenuItem> getItems()
          Get list of children.
abstract  java.lang.String getTitle()
          Get menu title
abstract  boolean isEnabled()
          Get is enabled
abstract  boolean isSelected()
          Get is selected
abstract  boolean isVisible()
          Get is visible
abstract  void setCommand(com.google.gwt.user.client.Command command)
          Set command which will be executed when item will be selected.
abstract  void setEnabled(boolean enabled)
          Set is enabled
abstract  void setHotKey(java.lang.String hotKey)
          Set Hot Key
abstract  void setIcon(java.lang.String icon)
          Set icon as HTML image.
abstract  void setSelected(boolean selected)
          Set is selected
abstract  void setTitle(java.lang.String title)
          Set title
abstract  void setVisible(boolean visible)
          set is visible
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MenuItem

public MenuItem()
Method Detail

addItem

public abstract MenuItem addItem(java.lang.String title)
Create new MenuItem with specified parameters and add it to the list of children.

Parameters:
title - - title of menu item
Returns:
new instance of menu item, which is already added to children list

addItem

public abstract MenuItem addItem(java.lang.String title,
                                 com.google.gwt.user.client.Command command)
Create new MenuItem with specified parameters and add it to the list of children.

Parameters:
title - - title of menu item
command - - associated command
Returns:
new instance of MenuItem

addItem

public abstract MenuItem addItem(java.lang.String icon,
                                 java.lang.String title)
Create new MenuItem with specified parameters and add it to the list of children.

Parameters:
icon - - icon as HTML image. Image must be prepared like "
title - - title of menu item
Returns:
new instance of MenuItem

addItem

public abstract MenuItem addItem(java.lang.String icon,
                                 java.lang.String title,
                                 com.google.gwt.user.client.Command command)
Create new MenuItem with specified parameters and add it to the list of children.

Parameters:
icon - - icon as HTML image. Image must be prepared like "
title - - title of menu item
command - - asociated command
Returns:
new instance of MenuItem

getCommand

public abstract com.google.gwt.user.client.Command getCommand()
Get command

Returns:
command

getHotKey

public abstract java.lang.String getHotKey()
Get Hot Key value

Returns:
hot key as String

getIcon

public abstract java.lang.String getIcon()
Get icon.

Returns:
- icon

getItems

public abstract java.util.List<MenuItem> getItems()
Get list of children.

Returns:
list of children

getTitle

public abstract java.lang.String getTitle()
Get menu title

Returns:
title of menu item

isEnabled

public abstract boolean isEnabled()
Get is enabled

Returns:
enabled state

isSelected

public abstract boolean isSelected()
Get is selected

Returns:
true or false - selected state

isVisible

public abstract boolean isVisible()
Get is visible

Returns:
- true, false

setCommand

public abstract void setCommand(com.google.gwt.user.client.Command command)
Set command which will be executed when item will be selected.

Parameters:
command - - command to execute

setEnabled

public abstract void setEnabled(boolean enabled)
Set is enabled

Parameters:
enabled - - true or false

setHotKey

public abstract void setHotKey(java.lang.String hotKey)
Set Hot Key

Parameters:
hotKey - - Hot Key value

setIcon

public abstract void setIcon(java.lang.String icon)
Set icon as HTML image. HTML must be like below " or ""

Parameters:
icon -

setSelected

public abstract void setSelected(boolean selected)
Set is selected

Parameters:
selected - - selected state (true / false)

setTitle

public abstract void setTitle(java.lang.String title)
Set title

Parameters:
title - - new title of menu item

setVisible

public abstract void setVisible(boolean visible)
set is visible

Parameters:
visible - - true, false


Copyright © 2013 eXo Platform SAS. All Rights Reserved.