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

java.lang.Object
  extended by org.exoplatform.gwtframework.ui.client.menu.MenuItem
      extended by org.exoplatform.gwtframework.ui.client.menu.MenuBarItem
All Implemented Interfaces:
ItemSelectedHandler, UpdateItemEnablingCallback

public class MenuBarItem
extends MenuItem
implements ItemSelectedHandler, UpdateItemEnablingCallback

Created by The eXo Platform SAS .

Version:
$ Menu bar is implementation of Menu interface and represents a visual component.
Author:
Vitaliy Gulyy

Constructor Summary
MenuBarItem(java.lang.String icon, java.lang.String title, com.google.gwt.user.client.Element element, ItemSelectedHandler callback)
           
 
Method Summary
 MenuItem addItem(java.lang.String title)
          Create new MenuItem with specified parameters and add it to the list of children.
 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.
 MenuItem addItem(java.lang.String icon, java.lang.String title)
          Create new MenuItem with specified parameters and add it to the list of children.
 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.
 void closePopupMenu()
          Close opened Popup Menu.
 com.google.gwt.user.client.Command getCommand()
          Get command
 java.lang.String getHotKey()
          Get Hot Key value
 java.lang.String getIcon()
          Get icon.
 java.util.List<MenuItem> getItems()
          Get list of children.
 java.lang.String getTitle()
          Get menu title
 boolean isEnabled()
          Get is enabled
 boolean isSelected()
          Get is selected
 boolean isVisible()
          Get is visible
 void onMenuItemSelected(MenuItem menuItem)
          Do some actions when menu item will be selected.
 boolean onMouseDown()
          Mouse Down handler
 void onMouseOut()
          Mouse Out Handler
 void onMouseOver()
          Mouse Over Handler
 void onUpdateItemEnabling()
           
 void openPopupMenu(MenuLockLayer menuLockLayer)
          Open sub Popup Menu
 void setCommand(com.google.gwt.user.client.Command command)
          Set command which will be executed when item will be selected.
 void setEnabled(boolean enabled)
          Set is enabled
 void setHotKey(java.lang.String hotKey)
          Set Hot Key
 void setIcon(java.lang.String icon)
          Set icon as HTML image.
 void setNormalState()
          Reset visual state of Menu Bar Item to default.
 void setSelected(boolean selected)
          Set is selected
 void setTitle(java.lang.String title)
          Set title
 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

MenuBarItem

public MenuBarItem(java.lang.String icon,
                   java.lang.String title,
                   com.google.gwt.user.client.Element element,
                   ItemSelectedHandler callback)
Parameters:
icon - - icon as HTML image for new item. Image must be prepared like "" tag
title - - title
element - - working element ( it must be cell of table )
callback - - callBack for notifying Menu when menu item is selected and is need to close all pupups
Method Detail

addItem

public MenuItem addItem(java.lang.String title)
Description copied from class: MenuItem
Create new MenuItem with specified parameters and add it to the list of children.

Specified by:
addItem in class MenuItem
Parameters:
title - - title of menu item
Returns:
new instance of menu item, which is already added to children list

addItem

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

Specified by:
addItem in class MenuItem
Parameters:
title - - title of menu item
command - - associated command
Returns:
new instance of MenuItem

addItem

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

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

addItem

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

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

closePopupMenu

public void closePopupMenu()
Close opened Popup Menu.


getCommand

public com.google.gwt.user.client.Command getCommand()
Description copied from class: MenuItem
Get command

Specified by:
getCommand in class MenuItem
Returns:
command
See Also:
org.exoplatform.gwtframework.ui.client.extension.menu.nn.api.MenuItem#getCommand()

getHotKey

public java.lang.String getHotKey()
Description copied from class: MenuItem
Get Hot Key value

Specified by:
getHotKey in class MenuItem
Returns:
hot key as String
See Also:
org.exoplatform.gwtframework.ui.client.extension.menu.nn.api.MenuItem#getHotKey()

getIcon

public java.lang.String getIcon()
Description copied from class: MenuItem
Get icon.

Specified by:
getIcon in class MenuItem
Returns:
- icon

getItems

public java.util.List<MenuItem> getItems()
Description copied from class: MenuItem
Get list of children.

Specified by:
getItems in class MenuItem
Returns:
list of children
See Also:
org.exoplatform.gwtframework.ui.client.extension.menu.nn.api.MenuItem#getItems()

getTitle

public java.lang.String getTitle()
Description copied from class: MenuItem
Get menu title

Specified by:
getTitle in class MenuItem
Returns:
title of menu item
See Also:
org.exoplatform.gwtframework.ui.client.extension.menu.nn.api.MenuItem#getTitle()

isEnabled

public boolean isEnabled()
Description copied from class: MenuItem
Get is enabled

Specified by:
isEnabled in class MenuItem
Returns:
enabled state
See Also:
org.exoplatform.gwtframework.ui.client.extension.menu.nn.api.MenuItem#isEnabled()

isSelected

public boolean isSelected()
Description copied from class: MenuItem
Get is selected

Specified by:
isSelected in class MenuItem
Returns:
true or false - selected state
See Also:
org.exoplatform.gwtframework.ui.client.extension.menu.nn.api.MenuItem#isSelected()

isVisible

public boolean isVisible()
Description copied from class: MenuItem
Get is visible

Specified by:
isVisible in class MenuItem
Returns:
- true, false
See Also:
org.exoplatform.gwtframework.ui.client.extension.menu.nn.api.MenuItem#isVisible()

onMenuItemSelected

public void onMenuItemSelected(MenuItem menuItem)
Description copied from interface: ItemSelectedHandler
Do some actions when menu item will be selected.

Specified by:
onMenuItemSelected in interface ItemSelectedHandler
Parameters:
menuItem - selected MenuItem
See Also:
org.exoplatform.gwtframework.ui.client.ItemSelectedHandler.menu.nn.impl.ItemSelectedCallback#onMenuItemSelected(org.exoplatform.gwtframework.ui.client.extension.menu.nn.api.MenuItem)

onMouseDown

public boolean onMouseDown()
Mouse Down handler


onMouseOut

public void onMouseOut()
Mouse Out Handler


onMouseOver

public void onMouseOver()
Mouse Over Handler


onUpdateItemEnabling

public void onUpdateItemEnabling()
Specified by:
onUpdateItemEnabling in interface UpdateItemEnablingCallback

openPopupMenu

public void openPopupMenu(MenuLockLayer menuLockLayer)
Open sub Popup Menu

Parameters:
menuLockLayer - - lock layer which will receive PopupMenu visual component and

setCommand

public void setCommand(com.google.gwt.user.client.Command command)
Description copied from class: MenuItem
Set command which will be executed when item will be selected.

Specified by:
setCommand in class MenuItem
Parameters:
command - - command to execute
See Also:
org.exoplatform.gwtframework.ui.client.extension.menu.nn.api.MenuItem#setCommand(com.google.gwt.user.client.Command)

setEnabled

public void setEnabled(boolean enabled)
Description copied from class: MenuItem
Set is enabled

Specified by:
setEnabled in class MenuItem
Parameters:
enabled - - true or false
See Also:
org.exoplatform.gwtframework.ui.client.extension.menu.nn.api.MenuItem#setEnabled(boolean)

setHotKey

public void setHotKey(java.lang.String hotKey)
Description copied from class: MenuItem
Set Hot Key

Specified by:
setHotKey in class MenuItem
Parameters:
hotKey - - Hot Key value
See Also:
org.exoplatform.gwtframework.ui.client.extension.menu.nn.api.MenuItem#setHotKey(java.lang.String)

setIcon

public void setIcon(java.lang.String icon)
Description copied from class: MenuItem
Set icon as HTML image. HTML must be like below " or ""

Specified by:
setIcon in class MenuItem

setNormalState

public void setNormalState()
Reset visual state of Menu Bar Item to default.


setSelected

public void setSelected(boolean selected)
Description copied from class: MenuItem
Set is selected

Specified by:
setSelected in class MenuItem
Parameters:
selected - - selected state (true / false)
See Also:
org.exoplatform.gwtframework.ui.client.extension.menu.nn.api.MenuItem#setSelected(boolean)

setTitle

public void setTitle(java.lang.String title)
Description copied from class: MenuItem
Set title

Specified by:
setTitle in class MenuItem
Parameters:
title - - new title of menu item
See Also:
org.exoplatform.gwtframework.ui.client.extension.menu.nn.api.MenuItem#setTitle(java.lang.String)

setVisible

public void setVisible(boolean visible)
Description copied from class: MenuItem
set is visible

Specified by:
setVisible in class MenuItem
Parameters:
visible - - true, false
See Also:
org.exoplatform.gwtframework.ui.client.extension.menu.nn.api.MenuItem#setVisible(boolean)


Copyright © 2012 eXo Platform SAS. All Rights Reserved.