|
Runtime | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.eclipse.gmf.runtime.diagram.ui.menus.PopupMenu
A simple pop-up menu with a list from which the user can select one item.
The show() method returns false if the user cancelled the
gesture or clicked outside the popup.
The getResult() method returns the result which is the object
from the content list that the user selected, or in the case of cascading
menus, a list of the results from each popup.
| Nested Class Summary | |
static class |
PopupMenu.CascadingMenu
An instance of this class can be created to add a submenu to a menu item in a PopupMenu. |
| Constructor Summary | |
PopupMenu(java.util.List aContent,
ILabelProvider aLabelProvider)
Creates a new PopupMenu. |
|
| Method Summary | |
protected void |
createMenuItems(Menu parentMenu,
PopupMenu rootMenu,
java.util.List resultThusFar)
Creates the menu items based on the content list. |
protected java.util.List |
getContent()
Gets the content. |
protected ILabelProvider |
getLabelProvider()
Gets the labelProvider. |
java.lang.Object |
getResult()
Gets the result which is the object from the content list that the user selected, or in the case of cascading menus, a list of the results from each popup. |
void |
setContent(java.util.List aContent)
Sets the content. |
void |
setLabelProvider(ILabelProvider aLabelProvider)
Sets the labelProvider. |
protected void |
setResult(java.util.List aResultList)
Sets the resultList. |
boolean |
show(Control parent)
Shows the popup menu and sets the resultList selected by the user. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public PopupMenu(java.util.List aContent,
ILabelProvider aLabelProvider)
PopupMenu.
aContent - the content for the menu, each object in the list represents a
menu itemaLabelProvider - the label provider used to provide the text for each object in
the content list| Method Detail |
public boolean show(Control parent)
parent - menu will be shown in this parent Control
protected void createMenuItems(Menu parentMenu,
PopupMenu rootMenu,
java.util.List resultThusFar)
parentMenu - the parent Menu that the menu items will be created inrootMenu - the root level MenuresultThusFar - List of content objects, e.g. CascadingMenu objectsprotected java.util.List getContent()
public void setContent(java.util.List aContent)
aContent - The content of this menu. Each entry in the list becomes a
menu item.protected ILabelProvider getLabelProvider()
public void setLabelProvider(ILabelProvider aLabelProvider)
aLabelProvider - Provides the text and icon for each menu item.public java.lang.Object getResult()
protected void setResult(java.util.List aResultList)
aResultList - The resultList to set.
|
Runtime | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp., Borland Software Corp., and others 2005,2006. All rights reserved.