Skip to main content
PREV CLASS NEXT CLASS FRAMES NO FRAMES

 

Class IlvMenu

IlvObject
   |
   +--IlvPanel
      |
      +--IlvMenuItem
         |
         +--IlvMenu

Category:
Common component
JavaScript File:
IlvAbstractPopupMenu.js
Description:
This class implements a menu that can be dynamically popped up at a specified position within the window of a browser.

Each item in a menu must belong to the IlvMenuItem class. It can be an instance of IlvMenuItem or a submenu (an instance of IlvMenu).


Constructor Summary
Constructor Attributes Constructor Name and Description
 
IlvMenu(label, isEnabled, image, path)
Method Summary
Method Attributes Method Name and Description
 
add(menuItem)
Adds the specified menu item to this menu.
 
Collapses this menu and every child.
 
Compute and sets the size of the children using the getPreferredSize method.
 
getChild(index)
Returns the child at the specified index or null.
 
Returns a copy of the children array of this menu.
 
Returns the number of children of this menu.
 
Returns the height of the submenu made up of all the children of this menu.
 
Returns the width of the submenu made up of all the children of this menu.
 
Checks whether this menu is expanded (that is, if the submenu is visible).
 
Checks whether this menu is visible.
 
Invoked each time the user moves the mouse over this menu.
 
Prepares this menu to be recycled.
 
setExpanded(isEnabled)
Specifies whether this menu is expanded (that is, if the submenu is visible).
 
setHighlighted(isHighlighted)
Specifies whether this menu is highlighted.
 
Highlights the given child, and lowlights any other.
 
setLocation(left, top)
Sets the location of this menu.
 
setVisible(isVisible)
Specifies whether this menu is visible.
Methods inherited from class IlvMenuItem
createHTMLContent, getAction, getIcon, getIconPreferredSize, getLabel, getParent, getPreferredSize, getRoot, isEnabled, isHighlighted, isRoot, onmouseup, performServerAction, setAction, setEnabled, setIcon, setLabel, setPreferredSize, setSize, update
Methods inherited from class IlvPanel
dispose, getBounds, getClip, getCursor, getHeight, getLeft, getMouseEventSource, getScrollPosition, getTop, getWidth, getZIndex, setBackgroundColor, setBackgroundImage, setBounds, setClip, setCursor, setScrollPosition, setZIndex, translate
Methods inherited from class IlvObject
getClassName, hashCode, instanceOf, invoke, registerDispose, registerDisposeByClientId, removeHTML, setClassName, superConstructor, superInvoke, toString, updateVisibility
Constructor Detail
IlvMenu
IlvMenu(label, isEnabled, image, path)
Parameters:
label
isEnabled
image
path
Method Detail
add
add(menuItem)
Adds the specified menu item to this menu.
Parameters:
menuItem - The menu item to be added.

collapse
collapse()
Collapses this menu and every child.

computeChildrenSize
computeChildrenSize()
Compute and sets the size of the children using the getPreferredSize method.

getChild
getChild(index)
Returns the child at the specified index or null.
Parameters:
index
Since:
JViews 8.0

getChildren
getChildren()
Returns a copy of the children array of this menu.
Since:
JViews 8.0

getChildrenCount
getChildrenCount()
Returns the number of children of this menu.

getChildrenHeight
getChildrenHeight()
Returns the height of the submenu made up of all the children of this menu.

getChildrenWidth
getChildrenWidth()
Returns the width of the submenu made up of all the children of this menu.

isExpanded
isExpanded()
Checks whether this menu is expanded (that is, if the submenu is visible).
Returns:
true if the menu is expanded; otherwise, it returns false.

isVisible
isVisible()
Checks whether this menu is visible.
Returns:
true if the menu item is visible; otherwise, it returns false.

onmouseover
onmouseover()
Invoked each time the user moves the mouse over this menu. This method highlights this menu.

recycle
recycle()
Prepares this menu to be recycled. We do this because we want to reuse the created DIV/LAYER objects rather than creating hundreds of them, which would be useless as soon as the pop-up menu has disappeared.

setExpanded
setExpanded(isEnabled)
Specifies whether this menu is expanded (that is, if the submenu is visible).
Parameters:
isEnabled - If true, this menu is expanded.

setHighlighted
setHighlighted(isHighlighted)
Specifies whether this menu is highlighted. When a menu is highlighted, it is also expanded (the submenu is made visible).
Parameters:
isHighlighted - If true, this menu is highlighted.
See also:
#setExpanded

setHighlightedChild
setHighlightedChild(child)
Highlights the given child, and lowlights any other.
Parameters:
child

setLocation
setLocation(left, top)
Sets the location of this menu. Only the location of the root menu has to be set, the location of any other menu item is computed automatically based on the location of the root menu and the size of the window.
Parameters:
left - The y coordinate of the top-left corner of the menu.
top - The x coordinate of the top-left corner of the menu.

setVisible
setVisible(isVisible)
Specifies whether this menu is visible. Only the root menu has to be made visible, the visibility of any other menu item is modified automatically by the mouse events.
Parameters:
isVisible

©Copyright Rogue Wave Software Inc. 1997, 2018. All Rights Reserved.