|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.google.gwt.user.client.ui.UIObject com.google.gwt.user.client.ui.Widget com.google.gwt.user.client.ui.FocusWidget com.google.gwt.user.client.ui.ButtonBase com.google.gwt.user.client.ui.Button info.magnolia.templating.editor.client.widget.button.DropdownButton
public class DropdownButton
A button which, when clicking on it, will display a dropdown menu just beneath. The menu can have different mutually exclusive choices.
Each choice corresponds to a MenuItem
. The order in which these options are added in the menu bar is the same in which
they are in the list or array passed in to the object's constructor. A menu item can also accept a further MenuBar
as a parameter, thus enabling sub menus.
Usage sample:
... // commands are defined elsewhere MenuItem one = new MenuItem("Option one", true, optionCommandOne); MenuItem two = new MenuItem("Option two", true, optionCommandTwo); MenuItem three = new MenuItem("Option three", true, optionCommandThree); List<MenuItem> options = new ArrayList<MenuItem>(); options.add(one); options.add(two); options.add(three); DropdownButton dropdown = new DropdownButton("My cool caption", options); ...
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject |
---|
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled |
Field Summary |
---|
Fields inherited from class com.google.gwt.user.client.ui.UIObject |
---|
DEBUG_ID_PREFIX |
Constructor Summary | |
---|---|
DropdownButton(String caption,
List<com.google.gwt.user.client.ui.MenuItem> menuItems)
|
|
DropdownButton(String caption,
com.google.gwt.user.client.ui.MenuItem... menuItems)
|
Method Summary | |
---|---|
protected void |
hideDropdown()
|
protected void |
onClickCallback(com.google.gwt.event.dom.client.ClickEvent event)
Callback method invoked when clicking on the drop-down button. |
protected void |
setDropdownPosition(int left,
int top)
Sets the dropdown's position relative to the browser's client area. |
protected void |
showDropdown()
|
Methods inherited from class com.google.gwt.user.client.ui.Button |
---|
click, getButtonElement, wrap |
Methods inherited from class com.google.gwt.user.client.ui.ButtonBase |
---|
getHTML, getText, setHTML, setHTML, setText |
Methods inherited from class com.google.gwt.user.client.ui.FocusWidget |
---|
addBlurHandler, addClickHandler, addClickListener, addDoubleClickHandler, addDragEndHandler, addDragEnterHandler, addDragHandler, addDragLeaveHandler, addDragOverHandler, addDragStartHandler, addDropHandler, addFocusHandler, addFocusListener, addGestureChangeHandler, addGestureEndHandler, addGestureStartHandler, addKeyboardListener, addKeyDownHandler, addKeyPressHandler, addKeyUpHandler, addMouseDownHandler, addMouseListener, addMouseMoveHandler, addMouseOutHandler, addMouseOverHandler, addMouseUpHandler, addMouseWheelHandler, addMouseWheelListener, addTouchCancelHandler, addTouchEndHandler, addTouchMoveHandler, addTouchStartHandler, getFocusImpl, getTabIndex, isEnabled, onAttach, removeClickListener, removeFocusListener, removeKeyboardListener, removeMouseListener, removeMouseWheelListener, setAccessKey, setEnabled, setFocus, setTabIndex |
Methods inherited from class com.google.gwt.user.client.ui.Widget |
---|
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents |
Methods inherited from class com.google.gwt.user.client.ui.UIObject |
---|
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString, unsinkEvents |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
---|
fireEvent |
Constructor Detail |
---|
public DropdownButton(String caption, List<com.google.gwt.user.client.ui.MenuItem> menuItems)
public DropdownButton(String caption, com.google.gwt.user.client.ui.MenuItem... menuItems)
Method Detail |
---|
protected void setDropdownPosition(int left, int top)
left
- in pxtop
- in pxprotected void showDropdown()
protected void hideDropdown()
protected void onClickCallback(com.google.gwt.event.dom.client.ClickEvent event)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |