Class SwtView<VM extends IControlViewModel,​NC extends org.eclipse.swt.widgets.Widget>

    • Constructor Detail

      • SwtView

        public SwtView()
    • Method Detail

      • getContentControl

        public static final org.eclipse.swt.widgets.Composite getContentControl​(org.eclipse.swt.widgets.Control control)
        Obtains the composite control that represents the actual content.
        Parameters:
        control - The control.
        Returns:
        The content control.
      • setContentControl

        public static final void setContentControl​(org.eclipse.swt.widgets.Control control,
                                                   org.eclipse.swt.widgets.Composite content)
        Associates the composite content control with the given control.
        Parameters:
        control - The control.
        content - The content control.
      • createNativeControl

        public abstract NC createNativeControl​(org.eclipse.swt.widgets.Composite parent,
                                               VM viewModel)
        Creates a native control for this view.
        Parameters:
        parent - the parent composite to place a control in.
        viewModel - the view mode to create a control for.
        Returns:
      • isControlDisposed

        protected final boolean isControlDisposed​(NC control)
        Description copied from class: View
        Returns true if native control is disposed.
        Specified by:
        isControlDisposed in class View<SwtRenderingParameters,​VM extends IControlViewModel,​NC extends org.eclipse.swt.widgets.Widget>
        Parameters:
        control - the native control, cannot be null.
        Returns:
        true if native control is disposed, false - otherwise.
      • computeNativeStyle

        protected int computeNativeStyle​(VM viewModel)
        Computes an SWT widget style flags. Override it to customize the flags.
        Parameters:
        viewModel - the view model to compute a style from.
        Returns:
        the computed style.
        See Also:
        Widget.getStyle()
      • uiSyncExec

        protected final void uiSyncExec​(Runnable runnable)
        Executes the given runnable in UI thread only if the control and its display are not disposed. The thread which calls this method is suspended until the runnable completes.
        Parameters:
        runnable - the runnable to execute, cannot be null.
      • uiAsyncExec

        protected final void uiAsyncExec​(Runnable runnable)
        Executes the given runnable in UI thread only if the control and its display are not disposed. The caller of this method continues to run in parallel.
        Parameters:
        runnable - the runnable to execute, cannot be null.