public abstract class UIElement extends Object
This class may be extended by clients.
Modifier | Constructor and Description |
---|---|
protected |
UIElement(IServiceLocator serviceLocator)
Construct a new instance of this class keyed off of the provided service
locator.
|
Modifier and Type | Method and Description |
---|---|
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.
|
protected UIElement(IServiceLocator serviceLocator) throws IllegalArgumentException
serviceLocator
- the locator. May not be null
.IllegalArgumentException
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
.
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.