|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.refractions.udig.catalog.util.HandleListener
public abstract class HandleListener
Easy example that listens to a specific IResolve.
Will do its best to reduce the IResolveChangeEvent to:
Note 1: The IResolveDelta does not always include information about *your* handle. If your parent is being replaced - your direct replacement may not be available until you ask for it.
Translation repalce with a null newResolve = reset. This indicates you need to find your handle again from first principles.
Note 2: HandleListener only holds onto a IResolve with a weak reference. Although this protects you a little bit, you still need to remove zombie listeners from the catalog (they cannot do it themselves).
However when the weak reference is cleaned up, we will notice and call dispose for you.
Constructor Summary | |
---|---|
HandleListener(IResolve handle)
|
Method Summary | |
---|---|
void |
changed(IResolveChangeEvent event)
Actual listener implemtnation |
abstract void |
dispose()
Called after remove while handle is invalid |
IResolve |
getHandle()
Resolve the handle - will call dispose if handle has passed out of scope. |
abstract void |
refresh(IResolve handle)
Called when handle has changed |
abstract void |
replace(IResolve handle,
IResolve newHandle)
Handle is being replaced with newHandle. |
abstract void |
reset(IResolve handle,
IResolveChangeEvent event)
This is a replace where the replacement is unknown. |
void |
setHandle(IResolve newHandle)
Can be called during a repalce, or reset to switch this listener over to the new handle. |
abstract void |
start(IResolve handle)
Called after create with valid handle |
abstract void |
stop(IResolve handle)
Called before remove while handle is still valid |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HandleListener(IResolve handle)
Method Detail |
---|
public IResolve getHandle()
public void setHandle(IResolve newHandle)
handle
- public abstract void start(IResolve handle)
public abstract void stop(IResolve handle)
public abstract void dispose()
public abstract void refresh(IResolve handle)
public abstract void replace(IResolve handle, IResolve newHandle)
Note: This method is called post change, the newHandle already exists in the catalog.
You have two options:
public abstract void reset(IResolve handle, IResolveChangeEvent event)
This occurs when:
In both cases you have two options:
handle
- public final void changed(IResolveChangeEvent event)
changed
in interface IResolveChangeListener
event
- the resource change eventIResourceDelta
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |