Class RendererSupplier

    • Field Summary

      • Fields inherited from class org.eclipse.e4.core.di.suppliers.ExtendedObjectSupplier

        SERVICE_CONTEXT_KEY, SERVICE_NAME
    • Constructor Summary

      Constructors 
      Constructor Description
      RendererSupplier()
      Initializes me.
    • Constructor Detail

      • RendererSupplier

        public RendererSupplier()
        Initializes me.
    • Method Detail

      • checkDependencies

        protected boolean checkDependencies​(Renderer qualifier,
                                            java.lang.Class<? extends AbstractSWTRenderer<? extends VElement>> requestedType,
                                            org.eclipse.e4.core.contexts.IEclipseContext context)
        Description copied from class: ContextBasedObjectSupplier
        Check whether the Eclipse 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.
        Overrides:
        checkDependencies in class ContextBasedObjectSupplier<Renderer,​AbstractSWTRenderer<? extends VElement>>
        Parameters:
        qualifier - the qualifier annotation, which may have attributes required for the computation
        requestedType - the type requested for injection
        context - the Eclipse context
        Returns:
        true if I can compute a value from this context; false, otherwise
        See Also:
        #compute(Annotation, IEclipseContext)
      • compute

        protected java.util.Optional<? extends AbstractSWTRenderer<? extends VElement>> compute​(Renderer qualifier,
                                                                                                java.lang.Class<? extends AbstractSWTRenderer<? extends VElement>> requestedType,
                                                                                                org.eclipse.e4.core.contexts.IEclipseContext context)
        Description copied from class: ContextBasedObjectSupplier
        Compute my value from the Eclipse 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.
        Specified by:
        compute in class ContextBasedObjectSupplier<Renderer,​AbstractSWTRenderer<? extends VElement>>
        Parameters:
        qualifier - the qualifier annotation, which may have attributes required for the computation
        requestedType - the type requested for injection
        context - the Eclipse context
        Returns:
        the result of the computation (possibly empty, but not null)