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 java.lang.Object implements IWorkbenchAdapter, IWorkbenchAdapter2, IWorkbenchAdapter3
Abstract base class with basic implementations of the IWorkbenchAdapter interface. Intended to be subclassed.- Since:
- 3.0
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.Object[]NO_CHILDRENThe empty list of children.
-
Constructor Summary
Constructors Constructor Description WorkbenchAdapter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RGBgetBackground(java.lang.Object element)The default implementation of thisIWorkbenchAdapter2method returnsnull.java.lang.Object[]getChildren(java.lang.Object object)The default implementation of thisIWorkbenchAdaptermethod returns the empty list.FontDatagetFont(java.lang.Object element)The default implementation of thisIWorkbenchAdapter2method returnsnull.RGBgetForeground(java.lang.Object element)The default implementation of thisIWorkbenchAdapter2method returnsnull.ImageDescriptorgetImageDescriptor(java.lang.Object object)The default implementation of thisIWorkbenchAdaptermethod returnsnull.java.lang.StringgetLabel(java.lang.Object object)The default implementation of thisIWorkbenchAdaptermethod returns the empty string if the object isnull, and the object'stoStringotherwise.java.lang.ObjectgetParent(java.lang.Object object)The default implementation of thisIWorkbenchAdaptermethod returnsnull.StyledStringgetStyledText(java.lang.Object object)The default implementation of thisIWorkbenchAdapter3method returns theStyledStringwhich wraps the label of the element.
-
-
-
Method Detail
-
getChildren
public java.lang.Object[] getChildren(java.lang.Object object)
The default implementation of thisIWorkbenchAdaptermethod returns the empty list. Subclasses may override.- Specified by:
getChildrenin interfaceIWorkbenchAdapter- Parameters:
object- The object to get the children for.- Returns:
- Object[]
-
getImageDescriptor
public ImageDescriptor getImageDescriptor(java.lang.Object object)
The default implementation of thisIWorkbenchAdaptermethod returnsnull. Subclasses may override.- Specified by:
getImageDescriptorin interfaceIWorkbenchAdapter- Parameters:
object- The object to get an image descriptor for.- Returns:
- ImageDescriptor
-
getLabel
public java.lang.String getLabel(java.lang.Object object)
The default implementation of thisIWorkbenchAdaptermethod returns the empty string if the object isnull, and the object'stoStringotherwise. Subclasses may override.- Specified by:
getLabelin interfaceIWorkbenchAdapter- Parameters:
object- The object to get a label for.- Returns:
- String
-
getParent
public java.lang.Object getParent(java.lang.Object object)
The default implementation of thisIWorkbenchAdaptermethod returnsnull. Subclasses may override.- Specified by:
getParentin interfaceIWorkbenchAdapter- Parameters:
object- The object to get the parent for.- Returns:
- Object
-
getBackground
public RGB getBackground(java.lang.Object element)
The default implementation of thisIWorkbenchAdapter2method returnsnull. Subclasses may override.- Specified by:
getBackgroundin interfaceIWorkbenchAdapter2- Parameters:
element- the element- Returns:
- the background color for the element, or
nullto use the default background color
-
getForeground
public RGB getForeground(java.lang.Object element)
The default implementation of thisIWorkbenchAdapter2method returnsnull. Subclasses may override.- Specified by:
getForegroundin interfaceIWorkbenchAdapter2- Parameters:
element- the element- Returns:
- the foreground color for the element, or
nullto use the default foreground color
-
getFont
public FontData getFont(java.lang.Object element)
The default implementation of thisIWorkbenchAdapter2method returnsnull. Subclasses may override.- Specified by:
getFontin interfaceIWorkbenchAdapter2- Parameters:
element- the element- Returns:
- the font for the element, or
nullto use the default font
-
getStyledText
public StyledString getStyledText(java.lang.Object object)
The default implementation of thisIWorkbenchAdapter3method returns theStyledStringwhich wraps the label of the element. Subclasses may override.- Specified by:
getStyledTextin interfaceIWorkbenchAdapter3- Parameters:
object- the element to evaluate the styled string for.- Returns:
- Return the
StyledStringwhich wraps the label of the element. - Since:
- 3.7
-
-