Package org.eclipse.ui.model
Class WorkbenchAdapter
java.lang.Object
org.eclipse.ui.model.WorkbenchAdapter
- All Implemented Interfaces:
IWorkbenchAdapter
,IWorkbenchAdapter2
,IWorkbenchAdapter3
- Direct Known Subclasses:
AdaptableList
public abstract class WorkbenchAdapter
extends Object
implements IWorkbenchAdapter, IWorkbenchAdapter2, IWorkbenchAdapter3
Abstract base class with basic implementations of the IWorkbenchAdapter
interface. Intended to be subclassed.
- Since:
- 3.0
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetBackground
(Object element) The default implementation of thisIWorkbenchAdapter2
method returnsnull
.Object[]
getChildren
(Object object) The default implementation of thisIWorkbenchAdapter
method returns the empty list.The default implementation of thisIWorkbenchAdapter2
method returnsnull
.getForeground
(Object element) The default implementation of thisIWorkbenchAdapter2
method returnsnull
.getImageDescriptor
(Object object) The default implementation of thisIWorkbenchAdapter
method returnsnull
.The default implementation of thisIWorkbenchAdapter
method returns the empty string if the object isnull
, and the object'stoString
otherwise.The default implementation of thisIWorkbenchAdapter
method returnsnull
.getStyledText
(Object object) The default implementation of thisIWorkbenchAdapter3
method returns theStyledString
which wraps the label of the element.
-
Field Details
-
NO_CHILDREN
The empty list of children.
-
-
Constructor Details
-
WorkbenchAdapter
public WorkbenchAdapter()
-
-
Method Details
-
getChildren
The default implementation of thisIWorkbenchAdapter
method returns the empty list. Subclasses may override.- Specified by:
getChildren
in interfaceIWorkbenchAdapter
- Parameters:
object
- The object to get the children for.- Returns:
- Object[]
-
getImageDescriptor
The default implementation of thisIWorkbenchAdapter
method returnsnull
. Subclasses may override.- Specified by:
getImageDescriptor
in interfaceIWorkbenchAdapter
- Parameters:
object
- The object to get an image descriptor for.- Returns:
- ImageDescriptor
-
getLabel
The default implementation of thisIWorkbenchAdapter
method returns the empty string if the object isnull
, and the object'stoString
otherwise. Subclasses may override.- Specified by:
getLabel
in interfaceIWorkbenchAdapter
- Parameters:
object
- The object to get a label for.- Returns:
- String
-
getParent
The default implementation of thisIWorkbenchAdapter
method returnsnull
. Subclasses may override.- Specified by:
getParent
in interfaceIWorkbenchAdapter
- Parameters:
object
- The object to get the parent for.- Returns:
- Object
-
getBackground
The default implementation of thisIWorkbenchAdapter2
method returnsnull
. Subclasses may override.- Specified by:
getBackground
in interfaceIWorkbenchAdapter2
- Parameters:
element
- the element- Returns:
- the background color for the element, or
null
to use the default background color
-
getForeground
The default implementation of thisIWorkbenchAdapter2
method returnsnull
. Subclasses may override.- Specified by:
getForeground
in interfaceIWorkbenchAdapter2
- Parameters:
element
- the element- Returns:
- the foreground color for the element, or
null
to use the default foreground color
-
getFont
The default implementation of thisIWorkbenchAdapter2
method returnsnull
. Subclasses may override.- Specified by:
getFont
in interfaceIWorkbenchAdapter2
- Parameters:
element
- the element- Returns:
- the font for the element, or
null
to use the default font
-
getStyledText
The default implementation of thisIWorkbenchAdapter3
method returns theStyledString
which wraps the label of the element. Subclasses may override.- Specified by:
getStyledText
in interfaceIWorkbenchAdapter3
- Parameters:
object
- the element to evaluate the styled string for.- Returns:
- Return the
StyledString
which wraps the label of the element. - Since:
- 3.7
-