public class CmsContextMenu extends com.google.gwt.user.client.ui.Composite implements com.google.gwt.event.logical.shared.ResizeHandler, I_CmsAutoHider
构造器和说明 |
---|
CmsContextMenu(java.util.List<I_CmsContextMenuEntry> menuData,
boolean isFixed,
I_CmsAutoHider autoHideParent)
Constructor.
|
限定符和类型 | 方法和说明 |
---|---|
void |
addAutoHidePartner(com.google.gwt.dom.client.Element partner)
Mouse events that occur within an autoHide partner will not hide a panel set to autoHide.
|
void |
addItem(A_CmsContextMenuItem item)
Adds a menu item to this menu.
|
void |
addSeparator()
Adds a separator to this menu.
|
protected A_CmsContextMenuItem |
getSelectedItem()
Returns the selected item of this menu.
|
void |
hide()
Hides the widget.
|
void |
hideAll()
Hides this menu and all its parent menus.
|
boolean |
isAutoHideEnabled()
Returns if the auto hide feature is enabled.
|
boolean |
isAutoHideOnHistoryEventsEnabled()
Returns if the auto hide on history event feature is enabled.
|
protected void |
onClose()
Action on close.
|
void |
onResize(com.google.gwt.event.logical.shared.ResizeEvent event)
If the browser's window is resized this method rearranges the sub menus of the selected item.
|
protected void |
openPopup(A_CmsContextMenuItem item)
Opens a sub menu and sets its position.
|
void |
removeAutoHidePartner(com.google.gwt.dom.client.Element partner)
Removes an auto-hide partner.
|
void |
setAutoHideEnabled(boolean autoHide)
Enable or disable the autoHide feature.
|
void |
setAutoHideOnHistoryEventsEnabled(boolean enabled)
Enable or disable autoHide on history change events.
|
void |
setParentItem(A_CmsContextMenuItem parentItem)
Sets the parent item.
|
protected void |
setSelectedItem(A_CmsContextMenuItem selectedItem)
Sets the selected item of this menu.
|
protected void |
setSubMenuPosition(A_CmsContextMenuItem item)
Sets the position of the sub menu popup.
|
claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, render, render, resolvePotentialElement, setWidget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString, unsinkEvents
public CmsContextMenu(java.util.List<I_CmsContextMenuEntry> menuData, boolean isFixed, I_CmsAutoHider autoHideParent)
menuData
- the data structure for the context menuisFixed
- indicating if the position of the menu should be fixed.autoHideParent
- the menu auto hide parentpublic void addAutoHidePartner(com.google.gwt.dom.client.Element partner)
I_CmsAutoHider
addAutoHidePartner
在接口中 I_CmsAutoHider
partner
- the auto hide partner to addI_CmsAutoHider.addAutoHidePartner(com.google.gwt.dom.client.Element)
public void addItem(A_CmsContextMenuItem item)
item
- the item to be addedpublic void addSeparator()
public void hide()
I_CmsAutoHider
hide
在接口中 I_CmsAutoHider
I_CmsAutoHider.hide()
public void hideAll()
public boolean isAutoHideEnabled()
I_CmsAutoHider
isAutoHideEnabled
在接口中 I_CmsAutoHider
I_CmsAutoHider.isAutoHideEnabled()
public boolean isAutoHideOnHistoryEventsEnabled()
I_CmsAutoHider
isAutoHideOnHistoryEventsEnabled
在接口中 I_CmsAutoHider
I_CmsAutoHider.isAutoHideOnHistoryEventsEnabled()
public void onResize(com.google.gwt.event.logical.shared.ResizeEvent event)
onResize
在接口中 com.google.gwt.event.logical.shared.ResizeHandler
ResizeHandler.onResize(com.google.gwt.event.logical.shared.ResizeEvent)
public void removeAutoHidePartner(com.google.gwt.dom.client.Element partner)
I_CmsAutoHider
removeAutoHidePartner
在接口中 I_CmsAutoHider
partner
- the auto-hide partner to removeI_CmsAutoHider.removeAutoHidePartner(com.google.gwt.dom.client.Element)
public void setAutoHideEnabled(boolean autoHide)
I_CmsAutoHider
setAutoHideEnabled
在接口中 I_CmsAutoHider
autoHide
- enable true to enable, false to disableI_CmsAutoHider.setAutoHideEnabled(boolean)
public void setAutoHideOnHistoryEventsEnabled(boolean enabled)
I_CmsAutoHider
setAutoHideOnHistoryEventsEnabled
在接口中 I_CmsAutoHider
enabled
- enable true to enable, false to disableI_CmsAutoHider.setAutoHideOnHistoryEventsEnabled(boolean)
public void setParentItem(A_CmsContextMenuItem parentItem)
parentItem
- the parent itemprotected A_CmsContextMenuItem getSelectedItem()
protected void onClose()
On close all sub menus should be hidden, the currently selected item should be deselected and the popup will be closed.
protected void openPopup(A_CmsContextMenuItem item)
item
- the item to show the sub menu ofprotected void setSelectedItem(A_CmsContextMenuItem selectedItem)
selectedItem
- the item to selectprotected void setSubMenuPosition(A_CmsContextMenuItem item)
First calculates the best space where to show the popup.
The following list shows the possibilities, beginning with the best and ending with the worst.
Finally the position of the sub menu popup is set to the calculated values.
item
- the item to show the sub menu of