Class Renderer<NC,​P extends IRenderingParameters>

    • Constructor Detail

      • Renderer

        public Renderer()
    • Method Detail

      • initialize

        public void initialize​(P parameters)
        Initialized the renderer with the given parameters.

        To load view model to view mappings from the extension point, call loadMappings(String).

        Specified by:
        initialize in interface IRenderer<NC>
        Parameters:
        parameters - the renderer parameters.
      • findViewClass

        protected <VM extends IControlViewModelClass<? extends IView> findViewClass​(VM viewModel)
        Finds the view class for the given view model.
        Parameters:
        viewModel - the view model.
        Returns:
        the found view class or null if not found.
      • createView

        protected <VM extends IControlViewModelIView<?,​VM,​NC> createView​(VM viewModel)
        Creates a view for a given view model consulting the view model class to view class mapping.
        Parameters:
        viewModel - the view model to create view for.
        Returns:
        the created view model.
        Throws:
        IllegalStateException - if view can't be created.
        See Also:
        setMapping(Class, Class)
      • applyLayout

        protected abstract void applyLayout​(IControlViewModel viewModel,
                                            NC nativeControl)
        Applies a layout to the given native control.
        Parameters:
        viewModel - the associated view model.
        nativeControl - the native control to apply layout to.
      • convertLayout

        protected abstract Object convertLayout​(IAefLayout layout,
                                                NC nativeControl)
        Converts the AEF layout to layout for the given native control.
        Parameters:
        layout - the AEF layout.
        Returns:
        the converted layout object.
      • convertLayoutData

        protected abstract Object convertLayoutData​(IAefLayoutData layoutData,
                                                    NC nativeControl)
        Converts the AEF layout data to layout data for the given native control.
        Parameters:
        layoutData - the AEF layout data.
        Returns:
        the converted layout data object.
      • getParameters

        protected final P getParameters()
        Returns:
        this renderer rendering parameters.
      • getTreeTransformation

        protected ITreeTransformation getTreeTransformation()
        Returns the TreeTransformation instance.
        Returns:
        the TreeTransformation instance.
      • getTargetId

        protected abstract String getTargetId()
        Returns the target identifier of the renderer.

        This identifier will be used to obtain view model to view mappings from the extension point in loadMappings(String).

        Examples:

        • swt
        • lwt
        Returns:
        the target id
      • loadMappings

        protected final void loadMappings​(String rendererId)
        Loads view model to view mappings from the com._1c.g5.aef2.Aef2Plugin.renderer extension point.

        This method should be called from initialize(IRenderingParameters).

        Parameters:
        rendererId - the renderer identifier to load mappings for