Eclipse Platform
Release 3.3

org.eclipse.jface.viewers
Class OwnerDrawLabelProvider

java.lang.Object
  extended byorg.eclipse.core.commands.common.EventManager
      extended byorg.eclipse.jface.viewers.BaseLabelProvider
          extended byorg.eclipse.jface.viewers.CellLabelProvider
              extended byorg.eclipse.jface.viewers.OwnerDrawLabelProvider
All Implemented Interfaces:
IBaseLabelProvider

public abstract class OwnerDrawLabelProvider
extends CellLabelProvider

OwnerDrawLabelProvider is an abstract implementation of a label provider that handles custom draw.

This class is intended to be subclassed by implementors.

Since:
3.3

Constructor Summary
OwnerDrawLabelProvider()
          Create a new instance of the receiver based on a column viewer.
 
Method Summary
protected  void erase(Event event, Object element)
          Handle the erase event.
protected abstract  void measure(Event event, Object element)
          Handle the measure event.
protected abstract  void paint(Event event, Object element)
          Handle the paint event.
static void setUpOwnerDraw(ColumnViewer viewer)
          Set up the owner draw callbacks for the viewer.
 void update(ViewerCell cell)
          Update the label for cell.
 
Methods inherited from class org.eclipse.jface.viewers.CellLabelProvider
getToolTipBackgroundColor, getToolTipDisplayDelayTime, getToolTipFont, getToolTipForegroundColor, getToolTipImage, getToolTipShift, getToolTipStyle, getToolTipText, getToolTipTimeDisplayed, useNativeToolTip
 
Methods inherited from class org.eclipse.jface.viewers.BaseLabelProvider
addListener, dispose, fireLabelProviderChanged, isLabelProperty, removeListener
 
Methods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OwnerDrawLabelProvider

public OwnerDrawLabelProvider()
Create a new instance of the receiver based on a column viewer.

Method Detail

setUpOwnerDraw

public static void setUpOwnerDraw(ColumnViewer viewer)
Set up the owner draw callbacks for the viewer.

Parameters:
viewer - the viewer the owner draw is set up

erase

protected void erase(Event event,
                     Object element)
Handle the erase event. The default implementation colors the background of selected areas with SWT.COLOR_LIST_SELECTION and foregrounds with SWT.COLOR_LIST_SELECTION_TEXT

Parameters:
event - the erase event
element - the model object
See Also:
SWT.EraseItem, SWT.COLOR_LIST_SELECTION, SWT.COLOR_LIST_SELECTION_TEXT

paint

protected abstract void paint(Event event,
                              Object element)
Handle the paint event.

Parameters:
event - the paint event
element - the model element
See Also:
SWT.PaintItem

measure

protected abstract void measure(Event event,
                                Object element)
Handle the measure event.

Parameters:
event - the measure event
element - the model element
See Also:
SWT.MeasureItem

update

public void update(ViewerCell cell)
Description copied from class: CellLabelProvider
Update the label for cell.

Specified by:
update in class CellLabelProvider
Parameters:
cell - ViewerCell

Eclipse Platform
Release 3.3

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2007. All rights reserved.