Class AbstractSWTRenderer<VELEMENT extends VElement>

    • Field Detail

      • CUSTOM_VARIANT

        protected static final java.lang.String CUSTOM_VARIANT
        Variant constant for indicating RAP controls.
        See Also:
        Constant Field Values
    • Constructor Detail

      • AbstractSWTRenderer

        public AbstractSWTRenderer​(VELEMENT vElement,
                                   ViewModelContext viewContext,
                                   ReportService reportService)
        Default Constructor.
        Parameters:
        vElement - the view element to be rendered
        viewContext - The view model context
        reportService - the ReportService to use
        Since:
        1.6
    • Method Detail

      • getGridDescription

        public abstract SWTGridDescription getGridDescription​(SWTGridDescription gridDescription)
        Returns the GridDescription for this Renderer.
        Parameters:
        gridDescription - the current SWTGridDescription
        Returns:
        the number of controls per row
        Since:
        1.3
      • getControls

        protected final java.util.Map<SWTGridCell,​org.eclipse.swt.widgets.Control> getControls()
        Returns a copy of the GridCell to Control map.
        Returns:
        a copy of the controls map
        Since:
        1.3
      • preInit

        protected void preInit()
        Use this method to initialize objects which are needed already before rendering.
        Since:
        1.3
      • postInit

        protected void postInit()
        Use this method to initialize objects which are needed during rendering.
        Since:
        1.3
      • dispose

        protected void dispose()
        Disposes all resources used by the renderer. Don't forget to call super.dispose if overwriting this method.
        Overrides:
        dispose in class AbstractRenderer<VELEMENT extends VElement>
        Since:
        1.3
      • finalizeRendering

        public void finalizeRendering​(org.eclipse.swt.widgets.Composite parent)
        Called by the framework to initialize listener.
        Parameters:
        parent - the parent used during render
        Since:
        1.3
      • isRenderingFinished

        protected boolean isRenderingFinished()
        Query whether rendering has completed and I am ready for user interaction.
        Returns:
        whether rendering has finished
        Since:
        1.22
      • ignoreEnableOnReadOnly

        protected boolean ignoreEnableOnReadOnly()
        Returns true when read only will always force control to be disabled.
        Returns:
        true when read only will always force control to be disabled.
      • applyReadOnly

        protected void applyReadOnly()
        Marks a controls as readonly.
        Since:
        1.3
      • applyEnable

        protected void applyEnable()
        Allows implementers to set a control to enabled.
        Since:
        1.3
      • setControlEnabled

        protected void setControlEnabled​(SWTGridCell gridCell,
                                         org.eclipse.swt.widgets.Control control,
                                         boolean enabled)
        Wraps the call to enable/disable a control.
        Parameters:
        gridCell - the SWTGridCell to enable/disable
        control - the Control to enable/disable
        enabled - true if control should be enabled, false otherwise
        Since:
        1.3
      • applyVisible

        protected void applyVisible()
        Allows implementers to check and set the visibility on the whole result row.
        Since:
        1.3
      • applyValidation

        protected void applyValidation()
        Allows implementers to display the validation state of the control. The default implementation does nothing.
        Since:
        1.3
      • applyValidation

        protected void applyValidation​(VDiagnostic oldDiagnostic,
                                       VDiagnostic newDiagnostic)
        Called before the applyValidation(). This method allows to create a diff between the old diagnostic and the new diagnostic and thus improve the performance of the overlay apply by triggering it only on the relevant elements.
        Parameters:
        oldDiagnostic - The previous VDiagnostic
        newDiagnostic - The current VDiagnostic
        Since:
        1.14
      • getDefaultFontName

        protected java.lang.String getDefaultFontName​(org.eclipse.swt.widgets.Control control)
        Parameters:
        control - The control to derive the default font name from
        Returns:
        String the default font name on the system.
        Since:
        1.5
      • scrollToReveal

        public void scrollToReveal()
        If my control is rendered within a scrolled composite, scroll that composite to reveal me.
        Since:
        1.22
      • scrollToReveal

        protected boolean scrollToReveal​(org.eclipse.swt.widgets.Control control)
        Scroll composites as necessary to reveal the given control and then request focus.
        Parameters:
        control - the control to reveal and focus
        Returns:
        whether the focus was successfully set (usually because the control is one that can receive input focus)
        Since:
        1.22
      • canReveal

        protected boolean canReveal​(org.eclipse.swt.widgets.Control control)
        Query whether a given control can plausibly be revealed.
        Parameters:
        control - a control to be revealed
        Returns:
        whether it reasonably can be revealed
        Since:
        1.22