|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.emfforms.internal.spreadsheet.core.EMFFormsSpreadsheetViewModelContext
public class EMFFormsSpreadsheetViewModelContext
Spreadsheet specific implementation of the ViewModelContext
.
This implementation doesn't do anything, it serves only as a container for a VView
and the EObject
.
Constructor Summary | |
---|---|
EMFFormsSpreadsheetViewModelContext(VView view,
org.eclipse.emf.ecore.EObject domainModel)
Default Constructor. |
Method Summary | ||
---|---|---|
void |
addContextUser(Object user)
Adds a user of the context. |
|
void |
dispose()
Disposes the context. |
|
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)
Removes a 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 EMFFormsSpreadsheetViewModelContext(VView view, org.eclipse.emf.ecore.EObject domainModel)
view
- The VView
domainModel
- The EObject
Method Detail |
---|
public void registerDomainChangeListener(ModelChangeListener modelChangeListener)
registerDomainChangeListener
in interface ViewModelContext
modelChangeListener
- the model change listenerViewModelContext.registerDomainChangeListener(org.eclipse.emf.ecp.view.spi.model.ModelChangeListener)
public void unregisterDomainChangeListener(ModelChangeListener modelChangeListener)
unregisterDomainChangeListener
in interface ViewModelContext
modelChangeListener
- the model change listenerViewModelContext.unregisterDomainChangeListener(org.eclipse.emf.ecp.view.spi.model.ModelChangeListener)
public VElement getViewModel()
getViewModel
in interface ViewModelContext
ViewModelContext.getViewModel()
public org.eclipse.emf.ecore.EObject getDomainModel()
getDomainModel
in interface ViewModelContext
ViewModelContext.getDomainModel()
public void registerViewChangeListener(ModelChangeListener modelChangeListener)
registerViewChangeListener
in interface ViewModelContext
modelChangeListener
- the model change listenerViewModelContext.registerViewChangeListener(org.eclipse.emf.ecp.view.spi.model.ModelChangeListener)
public void unregisterViewChangeListener(ModelChangeListener modelChangeListener)
unregisterViewChangeListener
in interface ViewModelContext
modelChangeListener
- the model change listenerViewModelContext.unregisterViewChangeListener(org.eclipse.emf.ecp.view.spi.model.ModelChangeListener)
public void dispose()
dispose
in interface ViewModelContext
ViewModelContext.dispose()
public <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 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 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)
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 contextViewModelContext.getChildContext(org.eclipse.emf.ecore.EObject,
org.eclipse.emf.ecp.view.spi.model.VElement, org.eclipse.emf.ecp.view.spi.model.VView,
org.eclipse.emf.ecp.view.spi.context.ViewModelService[])
public void registerDisposeListener(ViewModelContextDisposeListener listener)
registerDisposeListener
in interface ViewModelContext
listener
- The ViewModelContextDisposeListener
to registerViewModelContext.registerDisposeListener(org.eclipse.emf.ecp.view.spi.context.ViewModelContextDisposeListener)
public void addContextUser(Object user)
addContextUser
in interface ViewModelContext
user
- The context user to addViewModelContext.addContextUser(java.lang.Object)
public void removeContextUser(Object user)
removeContextUser
in interface ViewModelContext
user
- The context user to removeViewModelContext.removeContextUser(java.lang.Object)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |