Class LabelProvider

    • Constructor Detail

      • LabelProvider

        public LabelProvider()
        Creates a new label provider.
    • Method Detail

      • getImage

        public Image getImage​(java.lang.Object element)
        The LabelProvider implementation of this ILabelProvider method returns null. Subclasses may override.
        Specified by:
        getImage in interface ILabelProvider
        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
      • getText

        public java.lang.String getText​(java.lang.Object element)
        The LabelProvider implementation of this ILabelProvider method returns the element's toString string. Subclasses may override.
        Specified by:
        getText in interface ILabelProvider
        Parameters:
        element - the element for which to provide the label text
        Returns:
        the text string used to label the element, or null if there is no text label for the given object
      • createTextProvider

        public static LabelProvider createTextProvider​(java.util.function.Function<java.lang.Object,​java.lang.String> textFunction)
        Creates a LabelProvider which implements the getText(java.lang.Object) method by calling the argument function.
        Parameters:
        textFunction - the function which returns the text
        Returns:
        The new LabelProvider
        Since:
        3.19
      • createImageProvider

        public static LabelProvider createImageProvider​(java.util.function.Function<java.lang.Object,​Image> imageFunction)
        Creates a LabelProvider which implements the getImage(java.lang.Object) method by calling the argument function.
        Parameters:
        imageFunction - the function which returns the image
        Returns:
        The new LabelProvider
        Since:
        3.19
      • createTextImageProvider

        public static LabelProvider createTextImageProvider​(java.util.function.Function<java.lang.Object,​java.lang.String> textFunction,
                                                            java.util.function.Function<java.lang.Object,​Image> imageFunction)
        Creates a LabelProvider which implements both the getText(java.lang.Object) and getImage(java.lang.Object) methods by calling the argument functions.
        Parameters:
        textFunction - the function which returns the text
        imageFunction - the function which returns the image
        Returns:
        The new LabelProvider
        Since:
        3.19