net.refractions.udig.catalog.ui
Class ResolveLabelProviderSimple

java.lang.Object
  extended by LabelProvider
      extended by net.refractions.udig.catalog.ui.ResolveLabelProviderSimple

public class ResolveLabelProviderSimple
extends LabelProvider

Label generation for IResolve (must be non-blocking and quick).

Compare and contrast with ResovleLabelDecorator which is allowed to block.

Since:
0.7.0
Author:
jgarnett

Constructor Summary
ResolveLabelProviderSimple()
           
 
Method Summary
 void changed(IResolveChangeEvent event)
           
 Image getImage(java.lang.Object element)
          Obtain image for the provided element.
 java.lang.String getText(java.lang.Object element)
          Generate text from the resolve.getURI()
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResolveLabelProviderSimple

public ResolveLabelProviderSimple()
Method Detail

changed

public void changed(IResolveChangeEvent event)

getText

public java.lang.String getText(java.lang.Object element)
Generate text from the resolve.getURI()

Note this name is only used as a first try, the ResolveLabelDecorator is expected to provide a label based on Name or Title information.

Parameters:
element -
Returns:
label based on IResolve.getIdentifier

getImage

public Image getImage(java.lang.Object element)
Obtain image for the provided element.

To accomplish this quickly we simply make use of constants from CatalogUIPlugin. We need a second pass that makes use of the real icon from the real resource.

Parameters:
element - is expeced to be IResolve
Returns:
the image used to label the element, or null if there is no image for the given object
See Also:
org.eclipse.jface.viewers.LabelProvider#getImage(java.lang.Object)