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>
AbstractViewer
can be used as a base class for IViewer
implementations.Type | Property and Description |
---|---|
javafx.beans.property.ReadOnlyBooleanProperty |
active |
javafx.beans.property.ReadOnlyObjectProperty<IDomain<VR>> |
adaptable |
javafx.beans.property.ReadOnlyMapProperty<AdapterKey<?>,java.lang.Object> |
adapters |
viewerFocused
IAdaptable.Bound<A extends IAdaptable>
IAdaptable.Bound.Impl<T extends IAdaptable>
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() |
javafx.beans.property.ReadOnlyBooleanProperty |
activeProperty() |
javafx.beans.property.ReadOnlyObjectProperty<IDomain<VR>> |
adaptableProperty() |
javafx.beans.property.ReadOnlyMapProperty<AdapterKey<?>,java.lang.Object> |
adaptersProperty() |
void |
deactivate() |
void |
dispose() |
IDomain<VR> |
getAdaptable()
Gets the value of the property adaptable.
|
<T> T |
getAdapter(AdapterKey<T> key) |
<T> T |
getAdapter(java.lang.Class<T> classKey) |
<T> T |
getAdapter(com.google.common.reflect.TypeToken<T> key) |
<T> AdapterKey<T> |
getAdapterKey(T adapter) |
javafx.collections.ObservableMap<AdapterKey<?>,java.lang.Object> |
getAdapters()
Gets the value of the property adapters.
|
<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()
Gets the value of the property active.
|
void |
setAdaptable(IDomain<VR> domain)
Sets the value of the property adaptable.
|
<T> void |
setAdapter(T adapter) |
<T> void |
setAdapter(T adapter,
java.lang.String role) |
<T> void |
setAdapter(com.google.common.reflect.TypeToken<T> adapterType,
T adapter) |
<T> void |
setAdapter(com.google.common.reflect.TypeToken<T> adapterType,
T adapter,
java.lang.String role) |
<T> void |
unsetAdapter(T adapter) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isViewerFocused, isViewerVisual, reveal, viewerFocusedProperty
public javafx.beans.property.ReadOnlyBooleanProperty activeProperty
activeProperty
in interface IActivatable
isActive()
public javafx.beans.property.ReadOnlyObjectProperty<IDomain<VR>> adaptableProperty
adaptableProperty
in interface IAdaptable.Bound<IDomain<VR>>
getAdaptable()
,
setAdaptable(IDomain)
public javafx.beans.property.ReadOnlyMapProperty<AdapterKey<?>,java.lang.Object> adaptersProperty
adaptersProperty
in interface IAdaptable
getAdapters()
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 javafx.beans.property.ReadOnlyBooleanProperty activeProperty()
activeProperty
in interface IActivatable
isActive()
public javafx.beans.property.ReadOnlyObjectProperty<IDomain<VR>> adaptableProperty()
adaptableProperty
in interface IAdaptable.Bound<IDomain<VR>>
getAdaptable()
,
setAdaptable(IDomain)
public javafx.beans.property.ReadOnlyMapProperty<AdapterKey<?>,java.lang.Object> adaptersProperty()
adaptersProperty
in interface IAdaptable
getAdapters()
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<T> key)
getAdapter
in interface IAdaptable
public <T> T getAdapter(java.lang.Class<T> classKey)
getAdapter
in interface IAdaptable
public <T> T getAdapter(com.google.common.reflect.TypeToken<T> key)
getAdapter
in interface IAdaptable
public <T> AdapterKey<T> getAdapterKey(T adapter)
getAdapterKey
in interface IAdaptable
public javafx.collections.ObservableMap<AdapterKey<?>,java.lang.Object> getAdapters()
getAdapters
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
.
Note, that when looking up an IVisualPart
for a given visual in
the map, it is required to walk up the visual hierarchy until a
registered visual is found, because an IVisualPart
only has to
register its "main" visual (i.e. the one returned by
IVisualPart.getVisual()
) at the visual-part-map, but potential
children visuals do not have to be registered.
getVisualPartMap
in interface IViewer<VR>
IViewer.getVisualPartMap()
public boolean isActive()
isActive
in interface IActivatable
public void setAdaptable(IDomain<VR> domain)
setAdaptable
in interface IAdaptable.Bound<IDomain<VR>>
public <T> void setAdapter(T adapter)
setAdapter
in interface IAdaptable
public <T> void setAdapter(T adapter, java.lang.String role)
setAdapter
in interface IAdaptable
public <T> void setAdapter(com.google.common.reflect.TypeToken<T> adapterType, T adapter)
setAdapter
in interface IAdaptable
@InjectAdapters public <T> void setAdapter(com.google.common.reflect.TypeToken<T> adapterType, T adapter, java.lang.String role)
setAdapter
in interface IAdaptable
public <T> void unsetAdapter(T adapter)
unsetAdapter
in interface IAdaptable
Copyright (c) 2014 itemis AG and others. All rights reserved.