Class CellLabelProvider

    • Constructor Detail

      • CellLabelProvider

        public CellLabelProvider()
        Create a new instance of the receiver.
    • Method Detail

      • getToolTipImage

        public Image getToolTipImage​(Object object)
        Get the image displayed in the tool tip for object.

        If getToolTipText(Object) and getToolTipImage(Object) both return null the control is set back to standard behavior

        Parameters:
        object - the element for which the tool tip is shown
        Returns:
        Image or null if there is not image.
      • getToolTipFont

        public Font getToolTipFont​(Object object)
        Get the Font used to display the tool tip
        Parameters:
        object - the element for which the tool tip is shown
        Returns:
        Font or null if the default font is to be used.
      • getToolTipShift

        public Point getToolTipShift​(Object object)
        Return the amount of pixels in x and y direction you want the tool tip to pop up from the mouse pointer. The default shift is 10px right and 0px below your mouse cursor. Be aware of the fact that you should at least position the tool tip 1px right to your mouse cursor else click events may not get propagated properly.
        Parameters:
        object - the element for which the tool tip is shown
        Returns:
        Point to shift of the tool tip or null if the default shift should be used.
      • useNativeToolTip

        public boolean useNativeToolTip​(Object object)
        Return whether or not to use the native tool tip. If you switch to native tool tips only the value from getToolTipText(Object) is used all other features from custom tool tips are not supported.

        To reset the control to native behavior you should return true from this method and null from getToolTipText(Object) or null from getToolTipText(Object) and getToolTipImage(Object) at the same time

        Parameters:
        object - the Object for which the tool tip is shown
        Returns:
        true if native tool tips should be used
      • getToolTipTimeDisplayed

        public int getToolTipTimeDisplayed​(Object object)
        The time in milliseconds the tool tip is shown for.
        Parameters:
        object - the Object for which the tool tip is shown
        Returns:
        time in milliseconds the tool tip is shown for
      • getToolTipDisplayDelayTime

        public int getToolTipDisplayDelayTime​(Object object)
        The time in milliseconds until the tool tip is displayed.
        Parameters:
        object - the Object for which the tool tip is shown
        Returns:
        time in milliseconds until the tool tip is displayed
      • getToolTipStyle

        public int getToolTipStyle​(Object object)
        The SWT style used to create the CLabel (see there for supported styles). By default SWT.SHADOW_NONE is used.
        Parameters:
        object - the element for which the tool tip is shown
        Returns:
        the style used to create the label
        See Also:
        CLabel
      • update

        public abstract void update​(ViewerCell cell)
        Update the label for cell.
        Parameters:
        cell - ViewerCell
      • initialize

        protected void initialize​(ColumnViewer viewer,
                                  ViewerColumn column)
        Initialize this label provider for use with the given column viewer for the given column. Subclasses may extend but should call the super implementation (which at this time is empty but may be changed in the future).
        Parameters:
        viewer - the viewer
        column - the column, or null if a column is not available.
        Since:
        3.4
      • dispose

        public void dispose​(ColumnViewer viewer,
                            ViewerColumn column)
        Dispose of this label provider which was used with the given column viewer and column. Subclasses may extend but should call the super implementation (which calls BaseLabelProvider.dispose()).
        Parameters:
        viewer - the viewer
        column - the column, or null if a column is not available.
        Since:
        3.4