|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.emf.ecp.view.internal.context.ViewModelContextImpl
public class ViewModelContextImpl
The Class ViewModelContextImpl.
Constructor Summary | |
---|---|
ViewModelContextImpl(VElement view,
org.eclipse.emf.ecore.EObject domainObject)
Instantiates a new view model context impl. |
|
ViewModelContextImpl(VElement view,
org.eclipse.emf.ecore.EObject domainObject,
ViewModelContext parent,
VElement parentVElement)
Instantiates a new view model context impl. |
|
ViewModelContextImpl(VElement view,
org.eclipse.emf.ecore.EObject domainObject,
ViewModelContext parent,
VElement parentVElement,
ViewModelService... modelServices)
Instantiates a new view model context impl. |
|
ViewModelContextImpl(VElement view,
org.eclipse.emf.ecore.EObject domainObject,
ViewModelService... modelServices)
Instantiates a new view model context impl. |
Method Summary | ||
---|---|---|
void |
addContextUser(Object user)
Inner method for registering context users (not ViewModelService ). |
|
void |
dispose()
Dispose. |
|
ViewModelContext |
getChildContext(org.eclipse.emf.ecore.EObject eObject,
VElement parent,
VView vView,
ViewModelService... viewModelServices)
This returns the childContext for the provided EObject and the provided VElement . |
|
Object |
getContextValue(String key)
Returns the value of the context for the passed key. |
|
Set<VControl> |
getControlsFor(org.eclipse.emf.ecore.EStructuralFeature.Setting setting)
Returns all controls which are associated with the provided EStructuralFeature.Setting . |
|
Set<VElement> |
getControlsFor(UniqueSetting setting)
Returns all controls which are associated with the provided UniqueSetting . |
|
org.eclipse.emf.ecore.EObject |
getDomainModel()
Gets the domain model. |
|
|
getService(Class<T> serviceType)
Retrieve an ViewModelService of type serviceType . |
|
VElement |
getViewModel()
Gets the view model. |
|
|
hasService(Class<T> serviceType)
Whether the context has a service of the given type serviceType . |
|
void |
putContextValue(String key,
Object value)
Puts the value for the provided key into the context. |
|
void |
registerDisposeListener(ViewModelContextDisposeListener listener)
Allows to register a dispose listener. |
|
void |
registerDomainChangeListener(ModelChangeListener modelChangeListener)
Register domain change listener. |
|
void |
registerViewChangeListener(ModelChangeListener modelChangeListener)
Register view change listener. |
|
void |
removeContextUser(Object user)
Inner method for unregistering the context user. |
|
void |
unregisterDomainChangeListener(ModelChangeListener modelChangeListener)
Unregister domain change listener. |
|
void |
unregisterViewChangeListener(ModelChangeListener modelChangeListener)
Unregister view change listener. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ViewModelContextImpl(VElement view, org.eclipse.emf.ecore.EObject domainObject)
view
- the viewdomainObject
- the domain objectpublic ViewModelContextImpl(VElement view, org.eclipse.emf.ecore.EObject domainObject, ViewModelContext parent, VElement parentVElement)
view
- the viewdomainObject
- the domain objectpublic ViewModelContextImpl(VElement view, org.eclipse.emf.ecore.EObject domainObject, ViewModelService... modelServices)
view
- the viewdomainObject
- the domain objectmodelServices
- an array of services to use in the ViewModelContext
public ViewModelContextImpl(VElement view, org.eclipse.emf.ecore.EObject domainObject, ViewModelContext parent, VElement parentVElement, ViewModelService... modelServices)
view
- the viewdomainObject
- the domain objectmodelServices
- an array of services to use in the ViewModelContext
Method Detail |
---|
public Set<VControl> getControlsFor(org.eclipse.emf.ecore.EStructuralFeature.Setting setting)
EStructuralFeature.Setting
. The EStructuralFeature.Setting
is converted to
a UniqueSetting
.
getControlsFor
in interface ViewModelContext
setting
- the EStructuralFeature.Setting
to search controls for
ViewModelContext.getControlsFor(org.eclipse.emf.ecore.EStructuralFeature.Setting)
public Set<VElement> getControlsFor(UniqueSetting setting)
UniqueSetting
.
getControlsFor
in interface ViewModelContext
setting
- the UniqueSetting
to search controls for
ViewModelContext.getControlsFor(org.eclipse.emf.ecp.common.spi.UniqueSetting)
public VElement getViewModel()
getViewModel
in interface ViewModelContext
ViewModelContext.getViewModel()
public org.eclipse.emf.ecore.EObject getDomainModel()
getDomainModel
in interface ViewModelContext
ViewModelContext.getDomainModel()
public void dispose()
dispose
in interface ViewModelContext
public void registerViewChangeListener(ModelChangeListener modelChangeListener)
ViewModelContext
registerViewChangeListener
in interface ViewModelContext
modelChangeListener
- the model change listenerpublic void unregisterViewChangeListener(ModelChangeListener modelChangeListener)
ViewModelContext
unregisterViewChangeListener
in interface ViewModelContext
modelChangeListener
- the model change listenerpublic void registerDomainChangeListener(ModelChangeListener modelChangeListener)
ViewModelContext
registerDomainChangeListener
in interface ViewModelContext
modelChangeListener
- the model change listenerpublic void unregisterDomainChangeListener(ModelChangeListener modelChangeListener)
ViewModelContext
unregisterDomainChangeListener
in interface ViewModelContext
modelChangeListener
- the model change listenerpublic <T> boolean hasService(Class<T> serviceType)
serviceType
.
hasService
in interface ViewModelContext
T
- the type of the desired serviceserviceType
- the type of the service
true
, if the context has a service of the given type, false
otherwiseViewModelContext.hasService(java.lang.Class)
public <T> T getService(Class<T> serviceType)
ViewModelService
of type serviceType
.
getService
in interface ViewModelContext
T
- the type of the desired serviceserviceType
- the type of the service to be retrieved
ViewModelContext.getService(java.lang.Class)
public void addContextUser(Object user)
ViewModelService
).
addContextUser
in interface ViewModelContext
user
- the user of the contextpublic void removeContextUser(Object user)
removeContextUser
in interface ViewModelContext
user
- the user of the contextpublic Object getContextValue(String key)
getContextValue
in interface ViewModelContext
key
- the key of the value to get
ViewModelContext.getContextValue(java.lang.String)
public void putContextValue(String key, Object value)
putContextValue
in interface ViewModelContext
key
- the key to setvalue
- the Object to set into the contextViewModelContext.putContextValue(java.lang.String, java.lang.Object)
public ViewModelContext getChildContext(org.eclipse.emf.ecore.EObject eObject, VElement parent, VView vView, ViewModelService... viewModelServices)
ViewModelContext
VElement
. If a child context
already exists it will be returned otherwise a new ViewModelContext
will be created.
getChildContext
in interface ViewModelContext
eObject
- The EObject
to get the child context forparent
- The VElement
which requests the child contextvView
- The VView
of the EObject
viewModelServices
- The list of ViewModelService
which should be part of a child context
ViewModelContext
witch is a child of the current contextpublic void registerDisposeListener(ViewModelContextDisposeListener listener)
registerDisposeListener
in interface ViewModelContext
listener
- The ViewModelContextDisposeListener
to registerViewModelContext.registerDisposeListener(org.eclipse.emf.ecp.view.spi.context.ViewModelContextDisposeListener)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |