public class Menu extends Widget<HTMLDivElement,Menu> implements HasMenuShownHandlers<Menu>, HasMenuCloseHandlers<Menu>
Modifier and Type | Class and Description |
---|---|
static class |
Menu.Direction
Direction is an enumeration that indicate in which way should the child
menu open: to the right or to the left
|
Modifier and Type | Field and Description |
---|---|
protected ScrollablePanel |
scrollablePanel |
contextMenu, contextMenuHandlerRegistration, currentHeight, currentWidth, enabled, NATIVE_CONTEXT_MENU_HANDLER
Constructor and Description |
---|
Menu() |
Modifier and Type | Method and Description |
---|---|
void |
add(AbstractMenuItem<?,?> menuItem) |
Menu |
add(Widget<?,?> widget) |
HandlerRegistration |
addMenuCloseHandler(MenuCloseHandler<Menu> menuCloseHandler) |
HandlerRegistration |
addMenuShownHandler(MenuShownHandler<Menu> menuShownHandler) |
protected double |
adjustScreenHeight(double screenHeight) |
void |
close()
This method closes the menu shown and all children menus.
|
void |
close(boolean cascade)
This method allow to close all parent and child menu if the cascade
parameter is true.
|
List<Widget<?,?>> |
getChildren() |
Menu.Direction |
getDirection()
Get the direction to which the child menu should open.
|
boolean |
isDisplayed()
Get the visiblity status of this menu, is it or not displayed?
|
Menu |
remove(Widget<?,?> widget) |
void |
setDirection(Menu.Direction direction) |
void |
setPosition(Holder<Integer> x,
Holder<Integer> top) |
void |
setPosition(int x,
int top) |
void |
show() |
protected void |
updateBoundingBoxMeasure(double left,
double top,
double width,
double height,
double screenWidth,
double screenHeight) |
protected void |
updateBoundingBoxMutation(double left,
double top,
double width,
double height,
double screenWidth,
double screenHeight) |
addActionHandler, addClassName, addDoubleActionHandler, addDoubleTapHandler, addDropTarget, addEventHandler, addEventHandler, addResizeHandler, addStyleName, addTapHandler, addTouchHoldHandler, canDropTargetAccept, cast, clear, clearBackgroundColor, clearDropTargets, clearTextColor, ensureHandlers, fireEvent, fireEvent, fireResizeEvent, getAbsoluteLeft, getAbsoluteTop, getAncestor, getChildrenCount, getComputedStyle, getContextMenu, getContextMenuHandler, getDeepestWidget, getDragSource, getDropTargetList, getElement, getFirstChild, getId, getLastChild, getNextSibling, getNextSibling, getOffsetHeight, getOffsetWidth, getParent, getScrollLeft, getScrollTop, getStyle, hasClassName, hasFocus, insert, isAttached, isDropTarget, isEnabled, isInEventThread, onAttach, onDetach, removeClassName, removeDropTarget, removeStyleName, setBackgroundColor, setClassName, setContextMenu, setDragSource, setDropTarget, setEnabled, setHeight, setHeight, setHeight, setId, setLeft, setLeftAndTop, setMaxHeight, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setMinWidth, setParent, setPixelSize, setScrollLeft, setScrollTop, setSize, setTextAlign, setTextColor, setTop, setWidth, setWidth, setWidth
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addEventHandler, addEventHandler
cancelMeasure, cancelMutation, measureAsSoonAsPossible, mutateAsSoonAsPossible, mutateAsSoonAsPossible, scheduleMeasure, scheduleMutation
addAttachHandler
addDetachHandler
addTransitionEndHandler, addTransitionEndHandler
addMouseDownHandler, addMouseDownHandler
addMouseMoveHandler, addMouseMoveHandler
addMouseOutHandler, addMouseOutHandler
addMouseOverHandler, addMouseOverHandler
addMouseUpHandler, addMouseUpHandler
addWheelHandler, addWheelHandler
addClickHandler, addClickHandler
addDoubleClickHandler, addDoubleClickHandler
addContextMenuHandler, addContextMenuHandler
addTouchStartHandler, addTouchStartHandler
addTouchMoveHandler, addTouchMoveHandler
addTouchForceChangeHandler, addTouchForceChangeHandler
addTouchEndHandler, addTouchEndHandler
addTouchCancelHandler, addTouchCancelHandler
addTouchHoldHandler
addTapHandler
addDoubleTapHandler
addKeyDownHandler, addKeyDownHandler
addKeyUpHandler, addKeyUpHandler
addKeyPressHandler, addKeyPressHandler
addScrollHandler, addScrollHandler
addAnimationStartHandler, addAnimationStartHandler
addAnimationIterationHandler, addAnimationIterationHandler
addAnimationEndHandler, addAnimationEndHandler
addActionHandler
addDoubleActionHandler
protected ScrollablePanel scrollablePanel
public void add(AbstractMenuItem<?,?> menuItem)
public List<Widget<?,?>> getChildren()
getChildren
in class Widget<HTMLDivElement,Menu>
public Menu remove(Widget<?,?> widget)
remove
in class Widget<HTMLDivElement,Menu>
public void setPosition(int x, int top)
public Menu.Direction getDirection()
public void setDirection(Menu.Direction direction)
direction
- the direction to setpublic void show()
@WillMeasure protected void updateBoundingBoxMeasure(double left, double top, double width, double height, double screenWidth, double screenHeight)
left
- top
- width
- height
- screenWidth
- screenHeight
- @WillMutate protected void updateBoundingBoxMutation(double left, double top, double width, double height, double screenWidth, double screenHeight)
left
- top
- width
- height
- screenWidth
- screenHeight
- public void close(boolean cascade)
cascade
- true if all the parent menu should be closedpublic void close()
public boolean isDisplayed()
public HandlerRegistration addMenuCloseHandler(MenuCloseHandler<Menu> menuCloseHandler)
addMenuCloseHandler
in interface HasMenuCloseHandlers<Menu>
public HandlerRegistration addMenuShownHandler(MenuShownHandler<Menu> menuShownHandler)
addMenuShownHandler
in interface HasMenuShownHandlers<Menu>
protected double adjustScreenHeight(double screenHeight)
screenHeight
- Copyright © 2018 Xalys. All rights reserved.