|
Eclipse Platform Release 3.3 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.ui.menus.UIElement
Allow a command or application to provide feedback to a user through updating a MenuItem or ToolItem. Initially used to update properties for UI elements created by the CommandContributionItem.
This class may be extended by clients.
Constructor Summary | |
---|---|
protected |
UIElement(IServiceLocator serviceLocator)
Construct a new instance of this class keyed off of the provided service locator. |
Method Summary | |
---|---|
IServiceLocator |
getServiceLocator()
Get the service locator scope in which this UI element resides. |
abstract void |
setChecked(boolean checked)
Update the checked state on this UI element. |
abstract void |
setDisabledIcon(ImageDescriptor desc)
Update the disabled icon on this UI element. |
void |
setDropDownId(String id)
Set the menu contribution id to use. |
abstract void |
setHoverIcon(ImageDescriptor desc)
Update the hover icon on this UI element. |
abstract void |
setIcon(ImageDescriptor desc)
Update the icon on this UI element. |
abstract void |
setText(String text)
Update the label on this UI element. |
abstract void |
setTooltip(String text)
Update the tooltip on this UI element. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected UIElement(IServiceLocator serviceLocator) throws IllegalArgumentException
serviceLocator
- the locator. May not be null
.Method Detail |
public abstract void setText(String text)
text
- The new label to display.public abstract void setTooltip(String text)
text
- The new tooltip to display.public abstract void setIcon(ImageDescriptor desc)
desc
- The descriptor for the new icon to display.public abstract void setDisabledIcon(ImageDescriptor desc)
desc
- The descriptor for the new icon to display.public abstract void setHoverIcon(ImageDescriptor desc)
desc
- The descriptor for the new icon to display.public abstract void setChecked(boolean checked)
checked
- true to set toggle onpublic final IServiceLocator getServiceLocator()
null
.
The locator may be used to obtain services that are scoped in the same
way as the UIElement
. Such services include but are not limited
to IWorkbench
, IWorkbenchWindow
, and
IWorkbenchPartSite
. While this method may not return
null
requests for any of these particular services may
return null
.
IServiceLocator.getService(Class)
public void setDropDownId(String id)
Example: element.setDropdownId("org.eclipse.ui.navigate.back.my.menu");
id
- used to populate the dropdown menu. Must not be
null
.
|
Eclipse Platform Release 3.3 |
|||||||||||
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. and others 2000, 2007. All rights reserved.