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 intcomputeNativeStyle(VM viewModel) Computes an SWT widget style flags.abstract NCcreateNativeControl(org.eclipse.swt.widgets.Composite parent, VM viewModel) Creates a native control for this view.static final org.eclipse.swt.widgets.CompositegetContentControl(org.eclipse.swt.widgets.Control control) Obtains the composite control that represents the actual content.protected voidhandleFocusEvent(FocusEvent event, VM viewModel, NC control) HandlesFocusEvent.protected final booleanisControlDisposed(NC control) Returnstrueif native control is disposed.static final voidsetContentControl(org.eclipse.swt.widgets.Control control, org.eclipse.swt.widgets.Composite content) Associates the composite content control with the given control.protected final voiduiAsyncExec(Runnable runnable) Executes the givenrunnablein UI thread only if the control and its display are not disposed.protected final voiduiSyncExec(Runnable runnable) Executes the givenrunnablein 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:ViewHandlesFocusEvent.- Specified by:
handleFocusEventin 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:ViewReturnstrueif native control is disposed.- Specified by:
isControlDisposedin classView<SwtRenderingParameters,VM extends IControlViewModel, NC extends org.eclipse.swt.widgets.Widget> - Parameters:
control- the native control, cannot benull.- Returns:
trueif 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 givenrunnablein 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 givenrunnablein 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.
-