Class WorkbenchAdapter

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static java.lang.Object[] NO_CHILDREN
      The empty list of children.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      RGB getBackground​(java.lang.Object element)
      The default implementation of this IWorkbenchAdapter2 method returns null.
      java.lang.Object[] getChildren​(java.lang.Object object)
      The default implementation of this IWorkbenchAdapter method returns the empty list.
      FontData getFont​(java.lang.Object element)
      The default implementation of this IWorkbenchAdapter2 method returns null.
      RGB getForeground​(java.lang.Object element)
      The default implementation of this IWorkbenchAdapter2 method returns null.
      ImageDescriptor getImageDescriptor​(java.lang.Object object)
      The default implementation of this IWorkbenchAdapter method returns null.
      java.lang.String getLabel​(java.lang.Object object)
      The default implementation of this IWorkbenchAdapter method returns the empty string if the object is null, and the object's toString otherwise.
      java.lang.Object getParent​(java.lang.Object object)
      The default implementation of this IWorkbenchAdapter method returns null.
      StyledString getStyledText​(java.lang.Object object)
      The default implementation of this IWorkbenchAdapter3 method returns the StyledString which wraps the label of the element.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • NO_CHILDREN

        protected static final java.lang.Object[] NO_CHILDREN
        The empty list of children.
    • Constructor Detail

      • WorkbenchAdapter

        public WorkbenchAdapter()
    • Method Detail

      • getChildren

        public java.lang.Object[] getChildren​(java.lang.Object object)
        The default implementation of this IWorkbenchAdapter method returns the empty list. Subclasses may override.
        Specified by:
        getChildren in interface IWorkbenchAdapter
        Parameters:
        object - The object to get the children for.
        Returns:
        Object[]
      • getImageDescriptor

        public ImageDescriptor getImageDescriptor​(java.lang.Object object)
        The default implementation of this IWorkbenchAdapter method returns null. Subclasses may override.
        Specified by:
        getImageDescriptor in interface IWorkbenchAdapter
        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 this IWorkbenchAdapter method returns the empty string if the object is null, and the object's toString otherwise. Subclasses may override.
        Specified by:
        getLabel in interface IWorkbenchAdapter
        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 this IWorkbenchAdapter method returns null. Subclasses may override.
        Specified by:
        getParent in interface IWorkbenchAdapter
        Parameters:
        object - The object to get the parent for.
        Returns:
        Object
      • getBackground

        public RGB getBackground​(java.lang.Object element)
        The default implementation of this IWorkbenchAdapter2 method returns null. Subclasses may override.
        Specified by:
        getBackground in interface IWorkbenchAdapter2
        Parameters:
        element - the element
        Returns:
        the background color for the element, or null to use the default background color
      • getForeground

        public RGB getForeground​(java.lang.Object element)
        The default implementation of this IWorkbenchAdapter2 method returns null. Subclasses may override.
        Specified by:
        getForeground in interface IWorkbenchAdapter2
        Parameters:
        element - the element
        Returns:
        the foreground color for the element, or null to use the default foreground color
      • getFont

        public FontData getFont​(java.lang.Object element)
        The default implementation of this IWorkbenchAdapter2 method returns null. Subclasses may override.
        Specified by:
        getFont in interface IWorkbenchAdapter2
        Parameters:
        element - the element
        Returns:
        the font for the element, or null to use the default font
      • getStyledText

        public StyledString getStyledText​(java.lang.Object object)
        The default implementation of this IWorkbenchAdapter3 method returns the StyledString which wraps the label of the element. Subclasses may override.
        Specified by:
        getStyledText in interface IWorkbenchAdapter3
        Parameters:
        object - the element to evaluate the styled string for.
        Returns:
        Return the StyledString which wraps the label of the element.
        Since:
        3.7