|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.eclipse.core.commands.common.EventManager
org.eclipse.jface.viewers.LabelProvider
net.sourceforge.java.feednread.frontend.components.favoritestree.NewsFeedFavoritesTreeLabelProvider
LabelProvider implementation used to convert
Favorite and Category objects to gui
representations that are displayable in the NewsFeedFavoriteTree
component.
| Nested Class Summary | |
private class |
NewsFeedFavoritesTreeLabelProvider.ImageLoader
Thread to load the icon Image of a
Favorite in the background. |
| Field Summary | |
private ImageRegistry |
decoratedImages
ImageRegistry to cache decorated Images
|
private Hashtable |
favoriteIconLoaders
The Hashtable that maps Favorites to their
corresponding icon Image loading Thread.
|
private TreeViewer |
viewer
The TreeViewer that this label provider converts domain to
gui representations for.
|
| Fields inherited from class org.eclipse.core.commands.common.EventManager |
|
| Constructor Summary | |
NewsFeedFavoritesTreeLabelProvider(TreeViewer viewer)
Creates a new NewsFeedFavoritesTreeLabelProvider for the
specified TreeViewer.
|
|
| Method Summary | |
Image |
decorateImage(Image image,
Object element)
Returns an image that is based on the given image, but decorated with additional information relating to the state of the provided element. |
String |
decorateText(String text,
Object element)
Returns a text label that is based on the given text label, but decorated with additional information relating to the state of the provided element. |
void |
dispose()
Disposes all resources claimed by this NewsFeedFavoritesTreeLabelProvider.
|
private Image |
getDefaultImage(Favorite favorite)
Gets a default Image for the specified
Favorite depending on its status.
|
Font |
getFont(Object element)
Return the Font for element or null if
there is none set. |
Image |
getImage(Object element)
Gets the Image to display for the specified domain object.
|
String |
getText(Object element)
Gets the textual representation to display for the specified domain object. |
private boolean |
isDefaultFavoriteImage(Image img)
Returns true if the specified Image is the
default Favorite Image.
|
| Methods inherited from class org.eclipse.jface.viewers.LabelProvider |
addListener, 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 |
| Methods inherited from interface org.eclipse.jface.viewers.IBaseLabelProvider |
addListener, isLabelProperty, removeListener |
| Field Detail |
private TreeViewer viewer
The TreeViewer that this label provider converts domain to
gui representations for.
private Hashtable favoriteIconLoaders
The Hashtable that maps Favorites to their
corresponding icon Image loading Thread.
We use the synchronized Hashtable in here since thread safe
access has to be guaranteed.
private ImageRegistry decoratedImages
ImageRegistry to cache decorated Images
| Constructor Detail |
public NewsFeedFavoritesTreeLabelProvider(TreeViewer viewer)
Creates a new NewsFeedFavoritesTreeLabelProvider for the
specified TreeViewer.
viewer - the TreeViewer for which to create the
NewsFeedFavoritesTreeLabelProvider| Method Detail |
public Image getImage(Object element)
Gets the Image to display for the specified domain object.
getImage in interface ILabelProviderelement - the domain object to get the for
- Returns:
- the
for the specified domain object- See Also:
ILabelProvider.getImage(Object) public String getText(Object element)
Gets the textual representation to display for the specified domain object.
getText in interface ILabelProviderelement - the domain object to get the textual representation for
ILabelProvider.getText(Object)public Font getFont(Object element)
Font for element or null if
there is none set.
getFont in interface IFontProviderelement - gets the Font for the specified element
nullpublic void dispose()
Disposes all resources claimed by this
NewsFeedFavoritesTreeLabelProvider.
dispose in interface IBaseLabelProvider
public Image decorateImage(Image image,
Object element)
Returns an image that is based on the given image, but decorated with additional information relating to the state of the provided element. Text and image decoration updates can occur as a result of other updates within the workbench including deferred decoration by background processes. Clients should handle labelProviderChangedEvents for the given element to get the complete decoration.
decorateImage in interface ILabelDecoratorimage - the input image to decorate, or null if the
element has no imageelement - the element whose image is being decorated
null if no decoration is
to be appliedLabelProviderChangedEvent,
IBaseLabelProvider.addListener(org.eclipse.jface.viewers.ILabelProviderListener),
CompositeImageDescriptor
public String decorateText(String text,
Object element)
Returns a text label that is based on the given text label, but decorated with additional information relating to the state of the provided element. Text and image decoration updates can occur as a result of other updates within the workbench including deferred decoration by background processes. Clients should handle labelProviderChangedEvents for the given element to get the complete decoration.
decorateText in interface ILabelDecoratortext - the input text label to decorateelement - the element whose image is being decorated
null if no decoration
is to be appliedLabelProviderChangedEvent,
IBaseLabelProvider.addListener(org.eclipse.jface.viewers.ILabelProviderListener)private Image getDefaultImage(Favorite favorite)
Gets a default Image for the specified
Favorite depending on its status.
favorite - the Favorite to get a default
Image for
Image for the specified
Favoriteprivate boolean isDefaultFavoriteImage(Image img)
Returns true if the specified Image is the
default Favorite Image.
img - the Image to test
true if the specified Image is the
default Favorite Image; false
otherwise
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||