public class ViewServiceSupplier extends ContextBasedObjectSupplier<ViewService,Object>
ViewModelContext
available.ViewService
Constructor and Description |
---|
ViewServiceSupplier()
Initializes me.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
checkDependencies(ViewService qualifier,
Class<?> requestedType,
org.eclipse.e4.core.contexts.IEclipseContext context)
Check whether the Eclipse
context has the dependencies required to
compute my result. |
protected Optional<?> |
compute(ViewService qualifier,
Class<?> requestedType,
org.eclipse.e4.core.contexts.IEclipseContext context)
Compute my value from the Eclipse
context . |
get
protected boolean checkDependencies(ViewService qualifier, Class<?> requestedType, org.eclipse.e4.core.contexts.IEclipseContext context)
ContextBasedObjectSupplier
context
has the dependencies required to
compute my result. The default implementation just attempts to compute
the result, which is useful for simple cases where the computation is not
expensive and does not have undesired side-effects if it fails.checkDependencies
in class ContextBasedObjectSupplier<ViewService,Object>
qualifier
- the qualifier annotation, which may have attributes required for the computationrequestedType
- the type requested for injectioncontext
- the Eclipse contexttrue
if I can compute a value from this context
;
false
, otherwise#compute(Annotation, IEclipseContext)
protected Optional<?> compute(ViewService qualifier, Class<?> requestedType, org.eclipse.e4.core.contexts.IEclipseContext context)
ContextBasedObjectSupplier
context
. An empty result
indicates that the value does not exist (the IInjector.NOT_A_VALUE
special result for the object-supplier protocol). Injection of null
values is not supported.compute
in class ContextBasedObjectSupplier<ViewService,Object>
qualifier
- the qualifier annotation, which may have attributes required for the computationrequestedType
- the type requested for injectioncontext
- the Eclipse contextnull
)Copyright © 2019. All rights reserved.