Package com._1c.g5.aef2.swt.views
Class SwtView<VM extends IControlViewModel,NC extends org.eclipse.swt.widgets.Widget>
- All Implemented Interfaces:
IView<SwtRenderingParameters,
VM, NC>
- Direct Known Subclasses:
SwtStandardView
public abstract class SwtView<VM extends IControlViewModel,NC extends org.eclipse.swt.widgets.Widget>
extends View<SwtRenderingParameters,VM,NC>
Base class for SWT-based views.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected int
computeNativeStyle
(VM viewModel) Computes an SWT widget style flags.abstract NC
createNativeControl
(org.eclipse.swt.widgets.Composite parent, VM viewModel) Creates a native control for this view.static final org.eclipse.swt.widgets.Composite
getContentControl
(org.eclipse.swt.widgets.Control control) Obtains the composite control that represents the actual content.protected void
handleFocusEvent
(FocusEvent event, VM viewModel, NC control) HandlesFocusEvent
.protected final boolean
isControlDisposed
(NC control) Returnstrue
if native control is disposed.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.protected final void
uiAsyncExec
(Runnable runnable) Executes the givenrunnable
in UI thread only if the control and its display are not disposed.protected final void
uiSyncExec
(Runnable runnable) Executes the givenrunnable
in UI thread only if the control and its display are not disposed.Methods inherited from class com._1c.g5.aef2.views.View
bind, bindListener, bindNativeControl, bindValue, bindValue, bindViewModel, getNativeControl, getParameters, getViewModel, handleEventChannelEvent, initialize, manageObservable, queueAndWaitEvent, queueEvent, registerEventChannelListener, unbind, unbindNativeControl, unbindViewModel, unmanageObservable, unregisterEventChannelListener
-
Constructor Details
-
SwtView
public SwtView()
-
-
Method Details
-
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
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:
-
handleFocusEvent
Description copied from class:View
HandlesFocusEvent
.- Specified by:
handleFocusEvent
in classView<SwtRenderingParameters,
VM extends IControlViewModel, NC extends org.eclipse.swt.widgets.Widget> - Parameters:
event
- the focus event, cannot benull
.viewModel
- the view model, cannot benull
.control
- the native control, cannot benull
.
-
isControlDisposed
Description copied from class:View
Returnstrue
if native control is disposed.- Specified by:
isControlDisposed
in classView<SwtRenderingParameters,
VM extends IControlViewModel, NC extends org.eclipse.swt.widgets.Widget> - Parameters:
control
- the native control, cannot benull
.- Returns:
true
if native control is disposed,false
- otherwise.
-
computeNativeStyle
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
Executes the givenrunnable
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 benull
.
-
uiAsyncExec
Executes the givenrunnable
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 benull
.
-