public class ViewModelContextImpl extends Object implements ViewModelContext
| Constructor and Description |
|---|
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)
Deprecated.
As of 1.16, use the
ViewModelContextImpl(VElement, EObject, ViewModelContext, VElement, ViewModelServiceProvider)
API |
ViewModelContextImpl(VElement view,
org.eclipse.emf.ecore.EObject domainObject,
ViewModelContext parent,
VElement parentVElement,
ViewModelServiceProvider modelServiceProvider)
Instantiates a new view model context impl with a parent context.
|
ViewModelContextImpl(VElement view,
org.eclipse.emf.ecore.EObject domainObject,
ViewModelService... modelServices)
Deprecated.
As of 1.16, use the
ViewModelContextImpl(VElement, EObject, ViewModelServiceProvider) API |
ViewModelContextImpl(VElement view,
org.eclipse.emf.ecore.EObject domainObject,
ViewModelServiceProvider modelServiceProvider)
Instantiates a new view model context impl.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addContextUser(Object user)
Inner method for registering context users (not
ViewModelService). |
void |
changeDomainModel(org.eclipse.emf.ecore.EObject newDomainModel)
Changes the domain model of this view context to the given
EObject. |
void |
dispose()
Dispose.
|
ViewModelContext |
getChildContext(org.eclipse.emf.ecore.EObject eObject,
VElement parent,
VView vView,
ViewModelService... viewModelServices)
Deprecated.
|
ViewModelContext |
getChildContext(org.eclipse.emf.ecore.EObject eObject,
VElement parent,
VView vView,
ViewModelServiceProvider viewModelServiceProvider)
This returns a child context for the provided
EObject and 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)
Deprecated.
|
Set<VElement> |
getControlsFor(UniqueSetting setting)
Deprecated.
|
org.eclipse.emf.ecore.EObject |
getDomainModel()
Gets the domain model.
|
ViewModelContext |
getParentContext()
This returns the parent context.
|
VElement |
getParentVElement()
If this context has a
parent context this method will return the parent VElement
which requested the creation of this context. |
<T> T |
getService(Class<T> serviceType)
Retrieve an
ViewModelService of type serviceType. |
protected <T> T |
getServiceWithoutLog(Class<T> serviceType)
Retrieve an
ViewModelService of type serviceType without reporting an error if none is found. |
VElement |
getViewModel()
Gets the view model.
|
protected ViewModelServiceProvider |
getViewModelServiceProvider()
Obtains the provider of local view-model service overrides.
|
<T> boolean |
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 |
registerEMFFormsContextListener(EMFFormsContextListener contextListener)
Register an
EMFFormsContextListener. |
void |
registerRootDomainModelChangeListener(RootDomainModelChangeListener rootDomainModelChangeListener)
Register a
RootDomainModelChangeListener. |
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 |
unregisterEMFFormsContextListener(EMFFormsContextListener contextListener)
Unregister an
EMFFormsContextListener. |
void |
unregisterRootDomainModelChangeListener(RootDomainModelChangeListener rootDomainModelChangeListener)
Unregister a
RootDomainModelChangeListener. |
void |
unregisterViewChangeListener(ModelChangeListener modelChangeListener)
Unregister view change listener.
|
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 objectparent - The parent ViewModelContextparentVElement - the parent VElement@Deprecated public ViewModelContextImpl(VElement view, org.eclipse.emf.ecore.EObject domainObject, ViewModelService... modelServices)
ViewModelContextImpl(VElement, EObject, ViewModelServiceProvider) APIview - the viewdomainObject - the domain objectmodelServices - an array of services to use in the ViewModelContextpublic ViewModelContextImpl(VElement view, org.eclipse.emf.ecore.EObject domainObject, ViewModelServiceProvider modelServiceProvider)
view - the viewdomainObject - the domain objectmodelServiceProvider - a provider of services to use in the ViewModelContext. May be null if
local service overrides are not needed@Deprecated public ViewModelContextImpl(VElement view, org.eclipse.emf.ecore.EObject domainObject, ViewModelContext parent, VElement parentVElement, ViewModelService... modelServices)
ViewModelContextImpl(VElement, EObject, ViewModelContext, VElement, ViewModelServiceProvider)
APIview - the viewdomainObject - the domain objectparent - The parent ViewModelContextparentVElement - The parent VElementmodelServices - an array of services to use in the ViewModelContextpublic ViewModelContextImpl(VElement view, org.eclipse.emf.ecore.EObject domainObject, ViewModelContext parent, VElement parentVElement, ViewModelServiceProvider modelServiceProvider)
view - the viewdomainObject - the domain objectparent - The parent ViewModelContextparentVElement - The parent VElementmodelServiceProvider - a provider of services to use in the ViewModelContext. May be null if
local service overrides are not needed@Deprecated public Set<VControl> getControlsFor(org.eclipse.emf.ecore.EStructuralFeature.Setting setting)
EStructuralFeature.Setting. The EStructuralFeature.Setting is converted to
a UniqueSetting.getControlsFor in interface ViewModelContextsetting - the EStructuralFeature.Setting to search controls forViewModelContext.getControlsFor(org.eclipse.emf.ecore.EStructuralFeature.Setting)@Deprecated public Set<VElement> getControlsFor(UniqueSetting setting)
UniqueSetting.getControlsFor in interface ViewModelContextsetting - the UniqueSetting to search controls forViewModelContext.getControlsFor(org.eclipse.emf.ecp.common.spi.UniqueSetting)public VElement getViewModel()
getViewModel in interface ViewModelContextgetViewModel in interface EMFFormsViewContextViewModelContext.getViewModel()public org.eclipse.emf.ecore.EObject getDomainModel()
getDomainModel in interface ViewModelContextgetDomainModel in interface EMFFormsViewContextViewModelContext.getDomainModel()public void dispose()
dispose in interface ViewModelContextpublic void registerViewChangeListener(ModelChangeListener modelChangeListener)
ViewModelContextregisterViewChangeListener in interface ViewModelContextregisterViewChangeListener in interface EMFFormsViewContextmodelChangeListener - the model change listenerpublic void unregisterViewChangeListener(ModelChangeListener modelChangeListener)
ViewModelContextunregisterViewChangeListener in interface ViewModelContextunregisterViewChangeListener in interface EMFFormsViewContextmodelChangeListener - the model change listenerpublic void registerDomainChangeListener(ModelChangeListener modelChangeListener)
ViewModelContextregisterDomainChangeListener in interface ViewModelContextregisterDomainChangeListener in interface EMFFormsViewContextmodelChangeListener - the model change listenerpublic void unregisterDomainChangeListener(ModelChangeListener modelChangeListener)
ViewModelContextunregisterDomainChangeListener in interface ViewModelContextunregisterDomainChangeListener in interface EMFFormsViewContextmodelChangeListener - the model change listenerpublic <T> boolean hasService(Class<T> serviceType)
serviceType.hasService in interface ViewModelContextT - the type of the desired serviceserviceType - the type of the servicetrue, 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 ViewModelContextgetService in interface EMFFormsViewContextT - the type of the desired serviceserviceType - the type of the service to be retrievedViewModelContext.getService(java.lang.Class)protected <T> T getServiceWithoutLog(Class<T> serviceType)
ViewModelService of type serviceType without reporting an error if none is found.T - the type of the desired serviceserviceType - the type of the service to be retrievedpublic void addContextUser(Object user)
ViewModelService).addContextUser in interface ViewModelContextuser - the user of the contextpublic void removeContextUser(Object user)
removeContextUser in interface ViewModelContextuser - the user of the contextpublic Object getContextValue(String key)
getContextValue in interface ViewModelContextkey - the key of the value to getViewModelContext.getContextValue(java.lang.String)public void putContextValue(String key, Object value)
putContextValue in interface ViewModelContextkey - the key to setvalue - the Object to set into the contextViewModelContext.putContextValue(java.lang.String, java.lang.Object)protected ViewModelServiceProvider getViewModelServiceProvider()
@Deprecated public ViewModelContext getChildContext(org.eclipse.emf.ecore.EObject eObject, VElement parent, VView vView, ViewModelService... viewModelServices)
ViewModelContext
This returns the childContext for the provided EObject and the provided VElement. If a child context
already exists it will be returned otherwise a new ViewModelContext will be created.
Note that the injection of viewModelServices is useful for
services that are not registered externally (via extension point or OSGi). If any of these
services locally override registered implementations of the same interface, then it is better
to use a ViewModelServiceProvider that can propagate the override to child contexts.
getChildContext in interface ViewModelContexteObject - The EObject to get the child context forparent - The VElement which requests the child contextvView - The VView of the EObjectviewModelServices - The list of ViewModelService which should be part of a child contextViewModelContext witch is a child of the current contextViewModelContext.getChildContext(EObject, VElement, VView, ViewModelServiceProvider)public ViewModelContext getChildContext(org.eclipse.emf.ecore.EObject eObject, VElement parent, VView vView, ViewModelServiceProvider viewModelServiceProvider)
ViewModelContextEObject and VElement. If a child context
already exists it will be returned otherwise a new ViewModelContext will be created.getChildContext in interface ViewModelContexteObject - The EObject to get the child context forparent - The VElement which requests the child contextvView - The VView of the EObjectviewModelServiceProvider - a provider of view model services to inject into the child context,
which will only be used in the case that it is necessary to create the context. Thus no services
will be created if not needed. May be null if additional local service overrides are not
neededViewModelContext which is a child of the current contextpublic ViewModelContext getParentContext()
ViewModelContextnull for the topmost context.getParentContext in interface ViewModelContextpublic VElement getParentVElement()
ViewModelContextparent context this method will return the parent VElement
which requested the creation of this context. Otherwise this method will return null.getParentVElement in interface ViewModelContextpublic void registerDisposeListener(ViewModelContextDisposeListener listener)
registerDisposeListener in interface ViewModelContextlistener - The ViewModelContextDisposeListener to registerViewModelContext.registerDisposeListener(org.eclipse.emf.ecp.view.spi.context.ViewModelContextDisposeListener)public void registerEMFFormsContextListener(EMFFormsContextListener contextListener)
EMFFormsViewContextEMFFormsContextListener.registerEMFFormsContextListener in interface EMFFormsViewContextcontextListener - the EMFFormsContextListener to registerpublic void unregisterEMFFormsContextListener(EMFFormsContextListener contextListener)
EMFFormsViewContextEMFFormsContextListener.unregisterEMFFormsContextListener in interface EMFFormsViewContextcontextListener - the EMFFormsContextListener to unregisterpublic void changeDomainModel(org.eclipse.emf.ecore.EObject newDomainModel)
EObject.changeDomainModel in interface EMFFormsViewContextnewDomainModel - The new domain modelEMFFormsViewContext.changeDomainModel(org.eclipse.emf.ecore.EObject)public void registerRootDomainModelChangeListener(RootDomainModelChangeListener rootDomainModelChangeListener)
RootDomainModelChangeListener.registerRootDomainModelChangeListener in interface EMFFormsViewContextrootDomainModelChangeListener - The RootDomainModelChangeListener to registerEMFFormsViewContext.registerRootDomainModelChangeListener(org.eclipse.emfforms.spi.core.services.view.RootDomainModelChangeListener)public void unregisterRootDomainModelChangeListener(RootDomainModelChangeListener rootDomainModelChangeListener)
RootDomainModelChangeListener.unregisterRootDomainModelChangeListener in interface EMFFormsViewContextrootDomainModelChangeListener - The RootDomainModelChangeListener to unregisterEMFFormsViewContext.unregisterRootDomainModelChangeListener(org.eclipse.emfforms.spi.core.services.view.RootDomainModelChangeListener)Copyright © 2018. All rights reserved.