Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 


Eclipse Platform
Release 3.5

org.eclipse.jface.viewers
Class DelegatingStyledCellLabelProvider


java.lang.Object
  extended by 

org.eclipse.core.commands.common.EventManager
      extended by 

org.eclipse.jface.viewers.BaseLabelProvider
          extended by 

org.eclipse.jface.viewers.CellLabelProvider
              extended by 

org.eclipse.jface.viewers.OwnerDrawLabelProvider
                  extended by 

org.eclipse.jface.viewers.StyledCellLabelProvider
                      extended by 
org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider
All Implemented Interfaces:
IBaseLabelProvider
Direct Known Subclasses:
DecoratingStyledCellLabelProvider

public class DelegatingStyledCellLabelProvider
extends StyledCellLabelProvider

A DelegatingStyledCellLabelProvider is a StyledCellLabelProvider that delegates requests for the styled string and the image to a DelegatingStyledCellLabelProvider.IStyledLabelProvider.

Existing label providers can be enhanced by implementing DelegatingStyledCellLabelProvider.IStyledLabelProvider so they can be used in viewers with styled labels.

The DelegatingStyledCellLabelProvider.IStyledLabelProvider can optionally implement IColorProvider and IFontProvider to provide foreground and background color and a default font.

Since:
3.4

Nested Class Summary
static interface DelegatingStyledCellLabelProvider.IStyledLabelProvider
          Interface marking a label provider that provides styled text labels and images.
 
Field Summary
 
Fields inherited from class org.eclipse.jface.viewers. StyledCellLabelProvider
COLORS_ON_SELECTION, NO_FOCUS
 
Constructor Summary
DelegatingStyledCellLabelProvider ( DelegatingStyledCellLabelProvider.IStyledLabelProvider labelProvider)
          Creates a DelegatingStyledCellLabelProvider that delegates the requests for the styled labels and the images to a DelegatingStyledCellLabelProvider.IStyledLabelProvider.
 
Method Summary
 void addListener ( ILabelProviderListener listener)
          Adds a listener to this label provider.
 void dispose ()
          The BaseLabelProvider implementation of this IBaseLabelProvider method clears its internal listener list.
  Color getBackground ( Object element)
          Provides a background color for the given element.
  Font getFont ( Object element)
          Provides a font for the given element.
  Color getForeground ( Object element)
          Provides a foreground color for the given element.
  Image getImage ( Object element)
          Returns the image for the label of the given element.
  DelegatingStyledCellLabelProvider.IStyledLabelProvider getStyledStringProvider ()
          Returns the styled string provider.
protected   StyledString getStyledText ( Object element)
          Returns the styled text for the label of the given element.
 boolean isLabelProperty ( Object element, String property)
          The BaseLabelProvider implementation of this IBaseLabelProvider method returns true.
 void removeListener ( ILabelProviderListener listener)
          Removes a listener to this label provider.
 void update ( ViewerCell cell)
          Update the label for cell.
 
Methods inherited from class org.eclipse.jface.viewers. StyledCellLabelProvider
erase, getColumn, getViewer, initialize, isOwnerDrawEnabled, measure, paint, prepareStyleRange, setOwnerDrawEnabled, styleDecoratedString
 
Methods inherited from class org.eclipse.jface.viewers. OwnerDrawLabelProvider
dispose, initialize, setOwnerDrawEnabled, setUpOwnerDraw
 
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
fireLabelProviderChanged
 
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

DelegatingStyledCellLabelProvider

public DelegatingStyledCellLabelProvider(
DelegatingStyledCellLabelProvider.IStyledLabelProvider labelProvider)
Creates a DelegatingStyledCellLabelProvider that delegates the requests for the styled labels and the images to a DelegatingStyledCellLabelProvider.IStyledLabelProvider.

Parameters:
labelProvider - the label provider that provides the styled labels and the images
Method Detail

update

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

Overrides:
update in class StyledCellLabelProvider
Parameters:
cell - ViewerCell

getForeground

public 
Color getForeground(
Object element)
Provides a foreground color for the given element.

Parameters:
element - the element
Returns:
the foreground color for the element, or null to use the default foreground color

getBackground

public 
Color getBackground(
Object element)
Provides a background color for the given element.

Parameters:
element - the element
Returns:
the background color for the element, or null to use the default background color

getFont

public 
Font getFont(
Object element)
Provides a font for the given element.

Parameters:
element - the element
Returns:
the font for the element, or null to use the default font

getImage

public 
Image getImage(
Object element)
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.

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.

Parameters:
element - the element for which to provide the styled label text
Returns:
the styled text string used to label the element

getStyledStringProvider

public 
DelegatingStyledCellLabelProvider.IStyledLabelProvider getStyledStringProvider()
Returns the styled string provider.

Returns:
the wrapped label provider

addListener

public void addListener(
ILabelProviderListener listener)
Description copied from interface: IBaseLabelProvider
Adds a listener to this label provider. Has no effect if an identical listener is already registered.

Label provider listeners are informed about state changes that affect the rendering of the viewer that uses this label provider.

Specified by:
addListener in interface IBaseLabelProvider
Overrides:
addListener in class BaseLabelProvider
Parameters:
listener - a label provider listener

removeListener

public void removeListener(
ILabelProviderListener listener)
Description copied from interface: IBaseLabelProvider
Removes a listener to this label provider. Has no affect if an identical listener is not registered.

Specified by:
removeListener in interface IBaseLabelProvider
Overrides:
removeListener in class BaseLabelProvider
Parameters:
listener - a label provider listener

isLabelProperty

public boolean isLabelProperty(
Object element,
                               
String property)
Description copied from class: BaseLabelProvider
The BaseLabelProvider implementation of this IBaseLabelProvider method returns true. Subclasses may override.

Specified by:
isLabelProperty in interface IBaseLabelProvider
Overrides:
isLabelProperty in class BaseLabelProvider
Parameters:
element - the element
property - the property
Returns:
true if the label would be affected, and false if it would be unaffected

dispose

public void dispose()
Description copied from class: BaseLabelProvider
The BaseLabelProvider implementation of this IBaseLabelProvider method clears its internal listener list. Subclasses may extend but should call the super implementation.

Specified by:
dispose in interface IBaseLabelProvider
Overrides:
dispose in class StyledCellLabelProvider

Eclipse Platform
Release 3.5

Guidelines for using Eclipse APIs.

Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire