net.refractions.udig.catalog.ui
Class AbstractResolveContentProvider

java.lang.Object
  extended by net.refractions.udig.catalog.ui.AbstractResolveContentProvider
Direct Known Subclasses:
ResolveContentProvider

public class AbstractResolveContentProvider
extends java.lang.Object

Provides a threaded Tree content provider for IResolve.

Responsibilities:

Since:
0.6.0
Author:
jgarnett

Field Summary
protected  ICatalog catalog
          Root of this tree, often a ICatalog.
protected  java.util.List<IResolve> list
           
protected  java.util.Map<IResolve,java.util.List<IResolve>> structure
          Captures parent child relationships.
protected  Viewer viewer
           
 
Constructor Summary
AbstractResolveContentProvider()
           
 
Method Summary
 void changed(IResolveChangeEvent event)
          Catalog has changed!
 void dispose()
           
 void inputChanged(Viewer newViewer, java.lang.Object oldInput, java.lang.Object newInput)
          Notifies this content provider that the given viewer's input has been switched to a different element.
 void refresh(IResolve resolve)
          Called by thread to client code to get the content refreshed.
 void update(IResolve resolve)
          Update appearance and structure.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

structure

protected java.util.Map<IResolve,java.util.List<IResolve>> structure
Captures parent child relationships.

Here an IdentityHashMap is used because the containsKey otherwise doesn't look deep enough in the object to correctly deal with multilevel services.


catalog

protected ICatalog catalog
Root of this tree, often a ICatalog.


list

protected java.util.List<IResolve> list

viewer

protected Viewer viewer
Constructor Detail

AbstractResolveContentProvider

public AbstractResolveContentProvider()
Method Detail

changed

public void changed(IResolveChangeEvent event)
Catalog has changed!

Will only start up a thread to update the structure if:

This will allow us to "ignore" events generated by the process up inspecting the resolve being updated.

Parameters:
event -

refresh

public void refresh(IResolve resolve)
Called by thread to client code to get the content refreshed.

This call will not update structure, just appearance.

Parameters:
resolve -

update

public void update(IResolve resolve)
Update appearance and structure.

Note: this will spawn a thread to fetch the required information.

Parameters:
resolve -

inputChanged

public void inputChanged(Viewer newViewer,
                         java.lang.Object oldInput,
                         java.lang.Object newInput)
Notifies this content provider that the given viewer's input has been switched to a different element.

A typical use for this method is registering the content provider as a listener to changes on the new input (using model-specific means), and deregistering the viewer from the old input. In response to these change notifications, the content provider should update the viewer (see the add, remove, update and refresh methods on the viewers).

The viewer should not be updated during this call, as it might be in the process of being disposed.

Parameters:
viewer - the viewer
oldInput - the old input element, or null if the viewer did not previously have an input
newInput - the new input element, or null if the viewer does not have an input

dispose

public void dispose()