Class DecoratingStyledCellLabelProvider

    • Method Detail

      • getDecorationContext

        public IDecorationContext getDecorationContext()
        Returns the decoration context associated with this label provider. It will be passed to the decorator if the decorator is an instance of LabelDecorator.
        Returns:
        the decoration context associated with this label provider
      • setDecorationContext

        public void setDecorationContext​(IDecorationContext decorationContext)
        Set the decoration context that will be based to the decorator for this label provider if that decorator implements LabelDecorator.
        Parameters:
        decorationContext - the decoration context.
      • getImage

        public Image getImage​(Object element)
        Description copied from class: DelegatingStyledCellLabelProvider
        Returns the image for the label of the given element. The image is owned by the label provider and must not be disposed directly. Instead, dispose the label provider when no longer needed.
        Overrides:
        getImage in class DelegatingStyledCellLabelProvider
        Parameters:
        element - the element for which to provide the label image
        Returns:
        the image used to label the element, or null if there is no image for the given object
      • getStyledText

        protected StyledString getStyledText​(Object element)
        Returns the styled text for the label of the given element.
        Overrides:
        getStyledText in class DelegatingStyledCellLabelProvider
        Parameters:
        element - the element for which to provide the styled label text
        Returns:
        the styled text string used to label the element
      • getDecorationStyle

        protected StyledString.Styler getDecorationStyle​(Object element)
        Sets the StyledString.Styler to be used for string decorations. By default the decoration style. Clients can override. Note that it is the client's responsibility to react on color changes of the decoration color by refreshing the view
        Parameters:
        element - the element that has been decorated
        Returns:
        return the decoration style
      • getLabelDecorator

        public ILabelDecorator getLabelDecorator()
        Returns the decorator or null if no decorator is installed
        Returns:
        the decorator or null if no decorator is installed
      • setLabelDecorator

        public void setLabelDecorator​(ILabelDecorator newDecorator)
        Sets the label decorator. Removes all known listeners from the old decorator, and adds all known listeners to the new decorator. The old decorator is not disposed. Fires a label provider changed event indicating that all labels should be updated. Has no effect if the given decorator is identical to the current one.
        Parameters:
        newDecorator - the label decorator, or null if no decorations are to be applied