|
|||||||||
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.gwtext.client.widgets.menu.Menu
public class Menu
A menu object. This is the container to which you add all other menu items.
Field Summary | |
---|---|
protected com.google.gwt.core.client.JavaScriptObject |
config
|
protected java.lang.String |
id
|
protected com.google.gwt.core.client.JavaScriptObject |
jsObj
|
Constructor Summary | |
---|---|
Menu()
|
|
Menu(com.google.gwt.core.client.JavaScriptObject jsObj)
|
Method Summary | |
---|---|
void |
addElement(com.google.gwt.user.client.Element element)
Adds an Element object to the menu. |
void |
addElement(java.lang.String elemID)
Adds an Ext.Element object to the menu. |
void |
addItem(BaseItem item)
Adds an Item to the menu. |
void |
addListener(MenuListener listener)
Add a menu listener. |
void |
addSeparator()
Adds a separator bar to the menu. |
void |
addText(java.lang.String text)
Creates a new TextItem with the supplied text and adds it to the menu. |
protected com.google.gwt.core.client.JavaScriptObject |
create(com.google.gwt.core.client.JavaScriptObject menuConfig)
|
protected com.google.gwt.core.client.JavaScriptObject |
create(java.lang.String id,
com.google.gwt.core.client.JavaScriptObject config)
|
protected static com.google.gwt.core.client.JavaScriptObject |
getComponent(java.lang.String id)
|
com.google.gwt.user.client.Element |
getElement()
|
protected com.google.gwt.user.client.Element |
getElement(com.google.gwt.core.client.JavaScriptObject jsObj)
|
BaseItem |
getItem(java.lang.String itemId)
Gets an Item. |
BaseItem[] |
getItems()
Gets all of this menu's items |
com.google.gwt.core.client.JavaScriptObject |
getOrCreateJsObj()
|
void |
hide()
Hides this menu. |
void |
hide(boolean deep)
Hides this menu and optionally all parent menus. |
void |
insert(int index,
BaseItem item)
Inserts an e Item to the menu at a specified index. |
boolean |
isVisible()
Returns true if the menu is currently displayed, else false. |
void |
remove(BaseItem item)
Removes an Item from the menu and destroys the object. |
void |
removeAll()
Removes and destroys all items in the menu |
void |
setAllowOtherMenus(boolean allowOtherMenus)
True to allow multiple menus to be displayed at the same time (defaults to false). |
void |
setDefaultAlign(java.lang.String anchorPosition)
The default BaseElement.alignTo(java.lang.String, java.lang.String) anchor position value for this menu relative to its
element of origin (defaults to "tl-bl"). |
protected void |
setElement(com.google.gwt.user.client.Element elem)
|
void |
setId(java.lang.String id)
|
void |
setMinWidth(int minWidth)
The minimum width of the menu in pixels (defaults to 120). |
void |
setShadow(boolean shadow)
True for the default effect. |
void |
setShadow(java.lang.String shadow)
"sides" for the default effect, "frame" for 4-way shadow, and "drop" for bottom-right shadow (defaults to "sides") |
void |
setSubMenuAlign(java.lang.String anchorPosition)
The Ext.Element.alignTo anchor position value to use for submenus of this menu (defaults to "tl-tr?"). |
void |
show(java.lang.String id)
Displays this menu relative to another element. |
void |
showAt(int[] xy)
Displays this menu at a specific xy position. |
void |
showAt(int x,
int y)
Displays this menu at a specific xy position. |
void |
showAt(int x,
int y,
Menu parentMenu)
Displays this menu at a specific xy position. |
Methods inherited from class com.google.gwt.user.client.ui.Widget |
---|
doAttachChildren, doDetachChildren, getParent, isAttached, onAttach, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent |
Methods inherited from class com.google.gwt.user.client.ui.UIObject |
---|
addStyleDependentName, addStyleName, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, removeStyleDependentName, removeStyleName, setHeight, setPixelSize, setSize, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkEvents, toString, unsinkEvents |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.lang.String id
protected com.google.gwt.core.client.JavaScriptObject config
protected com.google.gwt.core.client.JavaScriptObject jsObj
Constructor Detail |
---|
public Menu()
public Menu(com.google.gwt.core.client.JavaScriptObject jsObj)
Method Detail |
---|
public void setId(java.lang.String id)
protected void setElement(com.google.gwt.user.client.Element elem)
setElement
in class com.google.gwt.user.client.ui.Widget
protected com.google.gwt.user.client.Element getElement(com.google.gwt.core.client.JavaScriptObject jsObj)
public com.google.gwt.user.client.Element getElement()
getElement
in class com.google.gwt.user.client.ui.UIObject
public com.google.gwt.core.client.JavaScriptObject getOrCreateJsObj()
protected static com.google.gwt.core.client.JavaScriptObject getComponent(java.lang.String id)
protected com.google.gwt.core.client.JavaScriptObject create(java.lang.String id, com.google.gwt.core.client.JavaScriptObject config)
protected com.google.gwt.core.client.JavaScriptObject create(com.google.gwt.core.client.JavaScriptObject menuConfig)
public void addElement(com.google.gwt.user.client.Element element)
element
- the element to addpublic void addElement(java.lang.String elemID)
elemID
- the element IDpublic void addItem(BaseItem item)
Item
to the menu.
item
- the item to addpublic void addSeparator()
public void addText(java.lang.String text)
TextItem
with the supplied text and adds it to the menu.
text
- the text to addpublic BaseItem getItem(java.lang.String itemId)
itemId
- the item Id
public BaseItem[] getItems()
public void hide()
public void hide(boolean deep)
deep
- true to hide all parent menus recursively, if any (defaults to false)public void insert(int index, BaseItem item)
Item
to the menu at a specified index.
index
- the index to insertitem
- the item to insertpublic boolean isVisible()
isVisible
in class com.google.gwt.user.client.ui.UIObject
public void remove(BaseItem item)
Item
from the menu and destroys the object.
item
- the item to removepublic void removeAll()
public void show(java.lang.String id)
id
- the element ID to align topublic void showAt(int x, int y)
x
- the X positiony
- the Y positionpublic void showAt(int[] xy)
xy
- the xy positionpublic void showAt(int x, int y, Menu parentMenu)
x
- the X positiony
- the Y positionparentMenu
- the menu's parent menu, if applicablepublic void addListener(MenuListener listener)
listener
- the listenerpublic void setAllowOtherMenus(boolean allowOtherMenus)
allowOtherMenus
- true to allow multiple menuspublic void setDefaultAlign(java.lang.String anchorPosition)
BaseElement.alignTo(java.lang.String, java.lang.String)
anchor position value for this menu relative to its
element of origin (defaults to "tl-bl").
anchorPosition
- defaults to t-b?public void setMinWidth(int minWidth)
minWidth
- the min widthpublic void setShadow(boolean shadow)
shadow
- true for shadowpublic void setShadow(java.lang.String shadow)
shadow
- the shadow settingspublic void setSubMenuAlign(java.lang.String anchorPosition)
anchorPosition
- the anchor position
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |