Class DtTableView
- java.lang.Object
-
- com._1c.g5.aef2.views.View<SwtRenderingParameters,VM,NC>
-
- com._1c.g5.aef2.swt.views.SwtView<VM,NC>
-
- com._1c.g5.aef2.standard.swt.views.SwtStandardView<TableViewModel,org.eclipse.swt.widgets.Composite>
-
- com._1c.g5.v8.dt.ui.aef.swt.views.DtTableView
-
- All Implemented Interfaces:
IView<SwtRenderingParameters,TableViewModel,org.eclipse.swt.widgets.Composite>
- Direct Known Subclasses:
DataExchangeSwtTableView
public class DtTableView extends SwtStandardView<TableViewModel,org.eclipse.swt.widgets.Composite>
The DT table view with optional search box. It has multiple displaying and behavior options that is pointed through view model.
-
-
Field Summary
Fields Modifier and Type Field Description protected static int
MIN_SEARCH_PATTERN_LENGTH
protected static String
SEARCH_BOX_KEY
protected static String
TABLE_VIEWER_KEY
-
Constructor Summary
Constructors Constructor Description DtTableView()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
activateContexts(TableViewModel viewModel)
Activates view model contexts.void
bind(TableViewModel viewModel, org.eclipse.swt.widgets.Composite nativeControl)
Binds the view model and native control together to this view.protected void
configureTable(TableViewer tableViewer)
Configure created table.protected void
createColumns(TableViewModel viewModel, TableViewer tableViewer, CellLabelProvider labelProvider)
Create columns for the table.org.eclipse.swt.widgets.Composite
createControl(org.eclipse.swt.widgets.Composite parent, TableViewModel viewModel)
Creates a native control for the view without decorations.protected TableViewer
createTable(org.eclipse.swt.widgets.Composite parent, TableViewModel viewModel)
Create table viewer according to the given AEF table view model.protected DtTableViewProvider
createTableViewProvider(TableViewer tableViewer, TableViewModel viewModel)
Creates table view provider.protected void
deactivateContexts(TableViewModel viewModel)
Deactivates view model contexts.protected Collection<TableItemViewModel>
getChecked(TableViewer viewer, TableViewModel viewModel, TableItemViewModel itemViewModel)
Returns checked elements in the table viewer.protected void
handleEventChannelEvent(IEvent event, TableViewModel viewModel, org.eclipse.swt.widgets.Composite control)
Handles events fromIEventChannel
.protected void
handleTableItemSelection(TableViewer viewer, TableViewModel viewModel, TableItemViewModel itemViewModel)
Handle table item selection.void
unbind(TableViewModel viewModel, org.eclipse.swt.widgets.Composite nativeControl)
Unbinds the view model and the native control from this view.-
Methods inherited from class com._1c.g5.aef2.standard.swt.views.SwtStandardView
createNativeControl, setEnabledApperance
-
Methods inherited from class com._1c.g5.aef2.swt.views.SwtView
computeNativeStyle, getContentControl, handleFocusEvent, isControlDisposed, setContentControl, uiAsyncExec, uiSyncExec
-
Methods inherited from class com._1c.g5.aef2.views.View
bindListener, bindNativeControl, bindValue, bindValue, bindViewModel, getNativeControl, getParameters, getViewModel, initialize, manageObservable, queueAndWaitEvent, queueEvent, registerEventChannelListener, unbindNativeControl, unbindViewModel, unmanageObservable, unregisterEventChannelListener
-
-
-
-
Field Detail
-
TABLE_VIEWER_KEY
protected static final String TABLE_VIEWER_KEY
-
SEARCH_BOX_KEY
protected static final String SEARCH_BOX_KEY
-
MIN_SEARCH_PATTERN_LENGTH
protected static final int MIN_SEARCH_PATTERN_LENGTH
- See Also:
- Constant Field Values
-
-
Method Detail
-
bind
public void bind(TableViewModel viewModel, org.eclipse.swt.widgets.Composite nativeControl)
Description copied from class:View
Binds the view model and native control together to this view. Override this method to customize the binding.- Overrides:
bind
in classSwtStandardView<TableViewModel,org.eclipse.swt.widgets.Composite>
- Parameters:
viewModel
- the view model to bind.nativeControl
- the native control to bind.
-
createControl
public org.eclipse.swt.widgets.Composite createControl(org.eclipse.swt.widgets.Composite parent, TableViewModel viewModel)
Description copied from class:SwtStandardView
Creates a native control for the view without decorations.- Specified by:
createControl
in classSwtStandardView<TableViewModel,org.eclipse.swt.widgets.Composite>
- Parameters:
parent
- the parent composite to place a control in.viewModel
- the view mode to create a control for.- Returns:
- the newly created control
-
unbind
public void unbind(TableViewModel viewModel, org.eclipse.swt.widgets.Composite nativeControl)
Description copied from class:View
Unbinds the view model and the native control from this view. Override this method to customize the unbinding.- Overrides:
unbind
in classView<SwtRenderingParameters,TableViewModel,org.eclipse.swt.widgets.Composite>
- Parameters:
viewModel
- the view mode to unbind.nativeControl
- the native control to unbind.
-
handleEventChannelEvent
protected void handleEventChannelEvent(IEvent event, TableViewModel viewModel, org.eclipse.swt.widgets.Composite control)
Description copied from class:View
Handles events fromIEventChannel
. By default handles only focus events.- Overrides:
handleEventChannelEvent
in classView<SwtRenderingParameters,TableViewModel,org.eclipse.swt.widgets.Composite>
- Parameters:
event
- the event, cannot benull
.viewModel
- the view model, cannot benull
.control
- the control, cannot benull
.
-
activateContexts
protected void activateContexts(TableViewModel viewModel)
Activates view model contexts.- Parameters:
viewModel
- the view model, cannot benull
-
createTable
protected TableViewer createTable(org.eclipse.swt.widgets.Composite parent, TableViewModel viewModel)
Create table viewer according to the given AEF table view model.- Parameters:
parent
- the parent composite to create table on, cannot benull
viewModel
- the AEF table view model, cannot benull
- Returns:
- a creted table viewer, never
null
-
createTableViewProvider
protected DtTableViewProvider createTableViewProvider(TableViewer tableViewer, TableViewModel viewModel)
Creates table view provider.- Parameters:
tableViewer
- the tabl viewer, cannot benull
viewModel
- the view model, cannot benull
- Returns:
- the table view provider, cannot be {@code null
-
configureTable
protected void configureTable(TableViewer tableViewer)
Configure created table.- Parameters:
tableViewer
- the table viewer, cannot benull
-
createColumns
protected void createColumns(TableViewModel viewModel, TableViewer tableViewer, CellLabelProvider labelProvider)
Create columns for the table. Default implementation creates single column with configured label provider.- Parameters:
viewModel
- the view model, cannot benull
tableViewer
- the table viewer, cannot benull
provider
- the label provider, cannot benull
-
deactivateContexts
protected void deactivateContexts(TableViewModel viewModel)
Deactivates view model contexts.- Parameters:
viewModel
- the view model, cannot benull
-
getChecked
protected Collection<TableItemViewModel> getChecked(TableViewer viewer, TableViewModel viewModel, TableItemViewModel itemViewModel)
Returns checked elements in the table viewer.- Parameters:
viewer
- the table viewer, cannot benull
viewModel
- the view model, cannot benull
itemViewModel
- the item with changed check state, cannot benull
- Returns:
- a collection of checked view model items, never
null
-
handleTableItemSelection
protected void handleTableItemSelection(TableViewer viewer, TableViewModel viewModel, TableItemViewModel itemViewModel)
Handle table item selection.- Parameters:
viewer
- the table viewer, cannot benull
viewModel
- the view model, cannot benull
itemViewModel
- the item with changed check state, cannot benull
-
-