|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdsto.dfc.swt.util.UIPropertyListener
public class UIPropertyListener
A DataObject property listener adapter that re-routes property change events that occur outside the UI thread into the UI thread by using Display.asyncExec ().
Threading note: clients should call dispose () (ideally
dispose(IDataObject)
) to remove this listener. This will
ensure that any async property updates in the display pipeline will
be cancelled rather than calling into a disposed UI element.
Field Summary | |
---|---|
protected ClassLoader |
contextClassLoader
|
protected org.eclipse.swt.widgets.Display |
display
Display is used as an interthread variable, so mark as volatile. |
protected PropertyListener |
listener
|
Constructor Summary | |
---|---|
UIPropertyListener(org.eclipse.swt.widgets.Control control)
Shortcut to create a listener for a SWT control that is also the property listener. |
|
UIPropertyListener(org.eclipse.swt.widgets.Display display,
PropertyListener listener)
Create a new instance. |
Method Summary | |
---|---|
static UIPropertyListener |
create(org.eclipse.swt.widgets.Control control,
IDataObject object)
Factory to create a listener for a SWT control that is also the property listener. |
void |
dispose()
Dispose of the object (unregister listeners, close open resources etc). |
void |
dispose(IDataObject object)
Remove this listener and dispose it. |
protected ClassLoader |
installClassLoader(ClassLoader newClassLoader)
Swaps in a specified class loader |
void |
propertyValueChanged(PropertyEvent e)
|
protected void |
restoreClassLoader(ClassLoader origLoader)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected volatile org.eclipse.swt.widgets.Display display
protected PropertyListener listener
protected ClassLoader contextClassLoader
Constructor Detail |
---|
public UIPropertyListener(org.eclipse.swt.widgets.Control control)
control
- The control: must implement PropertyListener
.create(Control, IDataObject)
public UIPropertyListener(org.eclipse.swt.widgets.Display display, PropertyListener listener)
display
- The display.listener
- The listener that will be called by this one,
guaranteed from the UI thread.Method Detail |
---|
public static UIPropertyListener create(org.eclipse.swt.widgets.Control control, IDataObject object)
control
- The control: must implement
PropertyListener
.object
- The object to listen to.public void propertyValueChanged(PropertyEvent e)
propertyValueChanged
in interface PropertyListener
public void dispose()
Disposable
dispose
in interface Disposable
public void dispose(IDataObject object)
object
- The object to remove the listener from. Removing
the listener this way ensures no event can sneak in
while disposing.protected ClassLoader installClassLoader(ClassLoader newClassLoader)
newClassLoader
-
protected void restoreClassLoader(ClassLoader origLoader)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |