public class ContextMenu
extends com.vaadin.server.AbstractExtension
Modifier and Type | Class and Description |
---|---|
static class |
ContextMenu.ContextMenuClosedEvent
ContextMenuClosedEvent is an event fired by the context menu
when it's closed.
|
static interface |
ContextMenu.ContextMenuClosedListener
ContextMenuClosedListener is used to listen for the event that the context menu is closed, either
when a item is clicked or when the popup is canceled.
|
class |
ContextMenu.ContextMenuItem
ContextMenuItem represents one clickable item in the context menu.
|
static class |
ContextMenu.ContextMenuItemClickEvent
ContextMenuItemClickEvent is an event produced by the context menu item
when it is clicked.
|
static interface |
ContextMenu.ContextMenuItemClickListener
ContextMenuItemClickListener is listener for context menu items wanting
to notify listeners about item click
|
static interface |
ContextMenu.ContextMenuOpenedListener
ContextMenuOpenedListener is used to modify the content of context menu
based on what was clicked.
|
static class |
ContextMenu.ContextMenuOpenedOnComponentEvent
ContextMenuOpenedOnComponentEvent is an event fired by the context menu
when it's opened from a component
|
static class |
ContextMenu.ContextMenuOpenedOnTableFooterEvent
ContextMenuOpenedOnTableFooterEvent is an event that is fired by the
context menu when it's opened by clicking on table footer
|
static class |
ContextMenu.ContextMenuOpenedOnTableHeaderEvent
ContextMenuOpenedOnTableHeaderEvent is an event fired by the context menu
when it's opened by clicking on table header row.
|
static class |
ContextMenu.ContextMenuOpenedOnTableRowEvent
ContextMenuOpenedOnTableRowEvent is an event that is fired when context
menu is opened by clicking on table row.
|
static class |
ContextMenu.ContextMenuOpenedOnTreeItemEvent
ContextMenuOpenedOnTreeItemEvent is an event fired by the context menu
when it's opened by clicking on tree item.
|
com.vaadin.server.ClientConnector.AttachEvent, com.vaadin.server.ClientConnector.AttachListener, com.vaadin.server.ClientConnector.ConnectorErrorEvent, com.vaadin.server.ClientConnector.DetachEvent, com.vaadin.server.ClientConnector.DetachListener
Constructor and Description |
---|
ContextMenu() |
Modifier and Type | Method and Description |
---|---|
void |
addContextMenuCloseListener(ContextMenu.ContextMenuClosedListener contextMenuClosedListener)
Adds listener that will be invoked when context menu is closed.
|
void |
addContextMenuComponentListener(ContextMenu.ContextMenuOpenedListener.ComponentListener contextMenuComponentListener)
Adds listener that will be invoked when context menu is opened from the
component to which it's assigned to.
|
void |
addContextMenuTableListener(ContextMenu.ContextMenuOpenedListener.TableListener contextMenuTableListener)
Adds listener that will be invoked when context menu is opened from
com.vaadin.ui.Table component.
|
void |
addContextMenuTreeListener(ContextMenu.ContextMenuOpenedListener.TreeListener contextMenuTreeListener)
Adds listener that will be invoked when context menu is openef from
com.vaadin.ui.Tree component.
|
ContextMenu.ContextMenuItem |
addItem(com.vaadin.server.Resource icon)
Adds new item to context menu root with given icon without caption.
|
ContextMenu.ContextMenuItem |
addItem(String caption)
Adds new item to context menu root with given caption.
|
ContextMenu.ContextMenuItem |
addItem(String caption,
com.vaadin.server.Resource icon)
Adds new item to context menu root with given caption and icon.
|
void |
addItemClickListener(ContextMenu.ContextMenuItemClickListener clickListener)
Adds click listener to context menu.
|
protected String |
getNextId() |
protected ContextMenuState |
getState() |
void |
open(int x,
int y)
Opens the context menu to given coordinates.
|
void |
removeAllItems()
Removes all items from the context menu.
|
void |
removeRootItem(ContextMenu.ContextMenuItem contextMenuItem)
Removes given root item from the context menu
|
void |
setAsContextMenuOf(com.vaadin.server.AbstractClientConnector component)
Assigns this as context menu of given component which will react to right
mouse button click.
|
void |
setAsTableContextMenu(com.vaadin.ui.Table table)
Assigns this as the context menu of given table.
|
void |
setAsTreeContextMenu(com.vaadin.ui.Tree tree)
Assigns this as context menu of given tree.
|
void |
setOpenAutomatically(boolean openAutomatically)
Enables or disables open automatically feature.
|
extend, getParent, getSupportedParentType, remove, setParent
addAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, addMethodInvocationToQueue, attach, beforeClientResponse, createState, detach, encodeState, equals, fireEvent, getAllChildrenIterable, getConnectorId, getErrorHandler, getExtensions, getListeners, getResource, getRpcManager, getRpcProxy, getSession, getState, getStateType, getUI, handleConnectorRequest, hashCode, hasListeners, isAttached, isConnectorEnabled, isThis, markAsDirty, markAsDirtyRecursive, registerRpc, registerRpc, removeAttachListener, removeDetachListener, removeExtension, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResource
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
addAttachListener, addDetachListener, attach, beforeClientResponse, detach, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, getUI, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler
protected String getNextId()
public void setOpenAutomatically(boolean openAutomatically)
openAutomatically
- public ContextMenu.ContextMenuItem addItem(String caption)
caption
- public ContextMenu.ContextMenuItem addItem(com.vaadin.server.Resource icon)
icon
- public ContextMenu.ContextMenuItem addItem(String caption, com.vaadin.server.Resource icon)
caption
- icon
- public void removeRootItem(ContextMenu.ContextMenuItem contextMenuItem)
contextMenuItem
- public void removeAllItems()
public void setAsTableContextMenu(com.vaadin.ui.Table table)
table
- public void setAsTreeContextMenu(com.vaadin.ui.Tree tree)
tree
- public void setAsContextMenuOf(com.vaadin.server.AbstractClientConnector component)
component
- public void open(int x, int y)
x
- y
- protected ContextMenuState getState()
getState
in class com.vaadin.server.AbstractClientConnector
public void addItemClickListener(ContextMenu.ContextMenuItemClickListener clickListener)
clickListener
- public void addContextMenuTableListener(ContextMenu.ContextMenuOpenedListener.TableListener contextMenuTableListener)
contextMenuTableListener
- public void addContextMenuTreeListener(ContextMenu.ContextMenuOpenedListener.TreeListener contextMenuTreeListener)
contextMenuTreeListener
- public void addContextMenuCloseListener(ContextMenu.ContextMenuClosedListener contextMenuClosedListener)
contextMenuClosedListener
- public void addContextMenuComponentListener(ContextMenu.ContextMenuOpenedListener.ComponentListener contextMenuComponentListener)
contextMenuComponentListener
- Copyright © 2016 Magnolia International Ltd.. All rights reserved.