VR - The visual root node of the UI toolkit used, e.g.
javafx.scene.Node in case of JavaFX.public abstract class AbstractViewer<VR> extends java.lang.Object implements IViewer<VR>, IAdaptable.Bound<IDomain<VR>>
IAdaptable.Bound<A extends IAdaptable>| Modifier and Type | Field and Description |
|---|---|
protected java.beans.PropertyChangeSupport |
pcs
A
PropertyChangeSupport that is used as a delegate to notify
listeners about changes to this object. |
ADAPTERS_PROPERTYACTIVE_PROPERTY| Constructor and Description |
|---|
AbstractViewer()
Creates a new
AbstractViewer instance, setting the
AdaptableScope for each of its IAdaptable-compliant types
(super classes implementing IAdaptable and super-interfaces
extending IAdaptable) to the newly created instance (see
AdaptableScopes#scopeTo(IAdaptable)). |
| Modifier and Type | Method and Description |
|---|---|
void |
activate() |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener) |
void |
deactivate() |
void |
dispose() |
IDomain<VR> |
getAdaptable() |
<T> T |
getAdapter(AdapterKey<? super T> key) |
<T> T |
getAdapter(java.lang.Class<? super T> classKey) |
<T> T |
getAdapter(com.google.common.reflect.TypeToken<? super T> key) |
<T> java.util.Map<AdapterKey<? extends T>,T> |
getAdapters(java.lang.Class<? super T> classKey) |
<T> java.util.Map<AdapterKey<? extends T>,T> |
getAdapters(com.google.common.reflect.TypeToken<? super T> key) |
java.util.Map<java.lang.Object,IContentPart<VR,? extends VR>> |
getContentPartMap()
Returns the
Map for registering IContentParts by their
content. |
IDomain<VR> |
getDomain()
|
IRootPart<VR,? extends VR> |
getRootPart()
Returns the
IRootPart of this viewer. |
java.util.Map<VR,IVisualPart<VR,? extends VR>> |
getVisualPartMap()
Returns the
Map for registering IVisualParts by their
visual. |
boolean |
isActive() |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener) |
void |
setAdaptable(IDomain<VR> domain) |
<T> void |
setAdapter(AdapterKey<? super T> key,
T adapter) |
<T> void |
setAdapter(java.lang.Class<? super T> key,
T adapter) |
<T> void |
setAdapter(com.google.common.reflect.TypeToken<? super T> key,
T adapter) |
void |
setAdapters(java.util.Map<AdapterKey<?>,java.lang.Object> adaptersWithKeys)
Adds the set of adapters to this
IAdaptable. |
<T> T |
unsetAdapter(AdapterKey<? super T> key) |
protected java.beans.PropertyChangeSupport pcs
PropertyChangeSupport that is used as a delegate to notify
listeners about changes to this object. May be used by subclasses to
trigger the notification of listeners.public AbstractViewer()
AbstractViewer instance, setting the
AdaptableScope for each of its IAdaptable-compliant types
(super classes implementing IAdaptable and super-interfaces
extending IAdaptable) to the newly created instance (see
AdaptableScopes#scopeTo(IAdaptable)).public void activate()
activate in interface IActivatablepublic void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
addPropertyChangeListener in interface IPropertyChangeNotifierpublic void deactivate()
deactivate in interface IActivatablepublic void dispose()
dispose in interface IDisposablepublic IDomain<VR> getAdaptable()
getAdaptable in interface IAdaptable.Bound<IDomain<VR>>public <T> T getAdapter(AdapterKey<? super T> key)
getAdapter in interface IAdaptablepublic <T> T getAdapter(java.lang.Class<? super T> classKey)
getAdapter in interface IAdaptablepublic <T> T getAdapter(com.google.common.reflect.TypeToken<? super T> key)
getAdapter in interface IAdaptablepublic <T> java.util.Map<AdapterKey<? extends T>,T> getAdapters(java.lang.Class<? super T> classKey)
getAdapters in interface IAdaptablepublic <T> java.util.Map<AdapterKey<? extends T>,T> getAdapters(com.google.common.reflect.TypeToken<? super T> key)
getAdapters in interface IAdaptablepublic java.util.Map<java.lang.Object,IContentPart<VR,? extends VR>> getContentPartMap()
IViewerMap for registering IContentParts by their
content.getContentPartMap in interface IViewer<VR>IViewer.getContentPartMap()public IRootPart<VR,? extends VR> getRootPart()
IViewerIRootPart of this viewer. The IRootPart is a
special IVisualPart that serves as the parent to all contained
IContentParts, IHandleParts, and IFeedbackParts.getRootPart in interface IViewer<VR>IRootPart of this viewer.public java.util.Map<VR,IVisualPart<VR,? extends VR>> getVisualPartMap()
IViewerMap for registering IVisualParts by their
visual. This map is used for hit-testing. Hit testing is performed
by first determining which visual is hit, and then mapping that to an
IVisualPart.getVisualPartMap in interface IViewer<VR>IViewer.getVisualPartMap()public boolean isActive()
isActive in interface IActivatablepublic void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
removePropertyChangeListener in interface IPropertyChangeNotifierpublic void setAdaptable(IDomain<VR> domain)
setAdaptable in interface IAdaptable.Bound<IDomain<VR>>public <T> void setAdapter(AdapterKey<? super T> key, T adapter)
setAdapter in interface IAdaptablepublic <T> void setAdapter(java.lang.Class<? super T> key,
T adapter)
setAdapter in interface IAdaptablepublic <T> void setAdapter(com.google.common.reflect.TypeToken<? super T> key,
T adapter)
setAdapter in interface IAdaptable@Inject(optional=true) public void setAdapters(@AdapterMap java.util.Map<AdapterKey<?>,java.lang.Object> adaptersWithKeys)
IAdaptable. This method should
not be used by clients but is intended for injection of adapters by means
of an AdapterMapInjector.
IMPORTANT: If sub-classes override this method, they will have to transfer the inject annotation to the overwritten method to ensure that adapter map injection is still functional.
adaptersWithKeys - The adapters to add to this IAdaptable (by means of
injection)AdapterMappublic <T> T unsetAdapter(AdapterKey<? super T> key)
unsetAdapter in interface IAdaptableCopyright (c) 2014 itemis AG and others. All rights reserved.