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_PROPERTY
ACTIVE_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 IContentPart s 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 IVisualPart s 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 IActivatable
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
addPropertyChangeListener
in interface IPropertyChangeNotifier
public void deactivate()
deactivate
in interface IActivatable
public void dispose()
dispose
in interface IDisposable
public IDomain<VR> getAdaptable()
getAdaptable
in interface IAdaptable.Bound<IDomain<VR>>
public <T> T getAdapter(AdapterKey<? super T> key)
getAdapter
in interface IAdaptable
public <T> T getAdapter(java.lang.Class<? super T> classKey)
getAdapter
in interface IAdaptable
public <T> T getAdapter(com.google.common.reflect.TypeToken<? super T> key)
getAdapter
in interface IAdaptable
public <T> java.util.Map<AdapterKey<? extends T>,T> getAdapters(java.lang.Class<? super T> classKey)
getAdapters
in interface IAdaptable
public <T> java.util.Map<AdapterKey<? extends T>,T> getAdapters(com.google.common.reflect.TypeToken<? super T> key)
getAdapters
in interface IAdaptable
public java.util.Map<java.lang.Object,IContentPart<VR,? extends VR>> getContentPartMap()
IViewer
Map
for registering IContentPart
s by their
content.getContentPartMap
in interface IViewer<VR>
IViewer.getContentPartMap()
public IRootPart<VR,? extends VR> getRootPart()
IViewer
IRootPart
of this viewer. The IRootPart
is a
special IVisualPart
that serves as the parent to all contained
IContentPart
s, IHandlePart
s, and IFeedbackPart
s.getRootPart
in interface IViewer<VR>
IRootPart
of this viewer.public java.util.Map<VR,IVisualPart<VR,? extends VR>> getVisualPartMap()
IViewer
Map
for registering IVisualPart
s 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 IActivatable
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
removePropertyChangeListener
in interface IPropertyChangeNotifier
public 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 IAdaptable
public <T> void setAdapter(java.lang.Class<? super T> key, T adapter)
setAdapter
in interface IAdaptable
public <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)AdapterMap
public <T> T unsetAdapter(AdapterKey<? super T> key)
unsetAdapter
in interface IAdaptable
Copyright (c) 2014 itemis AG and others. All rights reserved.