public class TableControlSWTRenderer extends AbstractControlSWTRenderer<VTableControl>
| Modifier and Type | Class and Description |
|---|---|
class |
TableControlSWTRenderer.ECPCellLabelProvider
ECP specific cell label provider that does also implement
IColorProvider in
order to correctly. |
protected class |
TableControlSWTRenderer.ECPTableViewerComparator
The
ViewerComparator for this table which allows 3 states for sort order:
none, up and down. |
protected class |
TableControlSWTRenderer.TableControlSWTRendererButtonBarBuilder
ButtonBarBuilder for the table control swt renderer. |
protected class |
TableControlSWTRenderer.TableControlSWTRendererTableViewerCreator
TableViewerCreator for the table control swt renderer. |
| Modifier and Type | Field and Description |
|---|---|
protected static String |
FIXED_COLUMNS |
protected static String |
TABLE_CUSTOM_VARIANT |
CUSTOM_VARIANT| Constructor and Description |
|---|
TableControlSWTRenderer(VTableControl vElement,
ViewModelContext viewContext,
ReportService reportService,
EMFFormsDatabindingEMF emfFormsDatabinding,
EMFFormsLabelProvider emfFormsLabelProvider,
VTViewTemplateProvider vtViewTemplateProvider,
ImageRegistryService imageRegistryService,
EMFFormsEditSupport emfFormsEditSupport)
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected int |
addAdditionalColumns(TableViewerSWTBuilder tableViewerSWTBuilder)
Override this method to add additional static columns at the beginning of the table.
|
protected int |
addButtonsToButtonBar(org.eclipse.swt.widgets.Composite buttonComposite)
Allows to add additional buttons to the button bar of the table control.
|
protected void |
addRow(org.eclipse.emf.ecore.EClass clazz,
org.eclipse.emf.ecore.EObject eObject,
org.eclipse.emf.ecore.EStructuralFeature structuralFeature)
This method is called to add a new entry in the domain model and thus to create a new row in the table.
|
protected void |
applyEnable()
Allows implementers to set a control to enabled.
|
protected void |
applyReadOnly()
Marks a controls as readonly.
|
protected void |
applyValidation()
Allows implementers to display the validation state of the control.
|
protected int |
compare(org.eclipse.jface.viewers.Viewer viewer,
Object e1,
Object e2,
int direction,
int propertyIndex)
Get called by the
TableControlSWTRenderer.ECPTableViewerComparator in order to compare the given objects. |
protected org.eclipse.jface.viewers.CellEditor |
createCellEditor(org.eclipse.emf.ecore.EObject tempInstance,
org.eclipse.emf.ecore.EStructuralFeature feature,
org.eclipse.swt.widgets.Composite table)
This is called in order to setup the editing support for a table column.
|
protected org.eclipse.swt.widgets.Composite |
createControlComposite(org.eclipse.swt.widgets.Composite composite)
Creates and returns the composite which will be the parent for the table viewer.
|
protected void |
deleteRows(List<org.eclipse.emf.ecore.EObject> deletionList,
org.eclipse.emf.ecore.EObject eObject,
org.eclipse.emf.ecore.EStructuralFeature structuralFeature)
This is called by
#deleteRowUserConfirmDialog(List) after the user confirmed to delete the selected
elements. |
protected void |
deleteRowUserConfirmDialog(List<org.eclipse.emf.ecore.EObject> deletionList,
org.eclipse.emf.ecore.EObject eObject,
org.eclipse.emf.ecore.EStructuralFeature structuralFeature,
org.eclipse.swt.widgets.Button addButton,
org.eclipse.swt.widgets.Button removeButton)
This method shows a user confirmation dialog when the user attempts to delete a row in the table.
|
protected void |
dispose()
Disposes all resources used by the renderer.
|
protected org.eclipse.swt.widgets.Button |
getAddButton()
Returns the add button created by the framework.
|
protected VTBackgroundStyleProperty |
getBackgroundStyleProperty()
Returns the
VTBackgroundStyleProperty. |
protected org.eclipse.swt.widgets.Item[] |
getColumns()
Returns an array of
items which are the columns in the table. |
protected VDomainModelReference |
getDMRToMultiReference() |
protected EMFFormsDatabindingEMF |
getEMFFormsDatabinding()
The
EMFFormsDatabinding to use. |
protected VTFontPropertiesStyleProperty |
getFontPropertiesStyleProperty()
Returns the
VTFontPropertiesStyleProperty. |
SWTGridDescription |
getGridDescription(SWTGridDescription gridDescription)
Returns the GridDescription for this Renderer.
|
protected org.eclipse.swt.widgets.ScrollBar |
getHorizontalBar()
Returns the receiver's horizontal scroll bar if it has one, and null if it does not.
|
protected org.eclipse.swt.graphics.Image |
getImage(String path)
Retrieve images from the
ImageRegistryService using a bundle relative path. |
protected org.eclipse.swt.graphics.Image |
getImage(URL url)
Retrieve images from the
ImageRegistryService using an URL. |
protected org.eclipse.swt.widgets.Button |
getRemoveButton()
Returns the remove button created by the framework.
|
protected int |
getSelectionIndex()
Returns the zero-relative index of the item which is currently selected in the receiver, or -1 if no item is
selected.
|
protected org.eclipse.swt.graphics.Color |
getSWTColor(String colorHex)
Returns the
Color specified by the provided String. |
protected int |
getTableHeightHint()
Returns the preferred height for the table.
|
protected org.eclipse.jface.viewers.AbstractTableViewer |
getTableViewer()
Returns the table viewer.
|
protected TableViewerCreator<? extends org.eclipse.jface.viewers.AbstractTableViewer> |
getTableViewerCreator()
Creates a new instance of the
TableViewerCreator to be used. |
protected TableViewerSWTBuilder |
getTableViewerSWTBuilder(org.eclipse.swt.widgets.Composite parent,
org.eclipse.core.databinding.observable.list.IObservableList list,
org.eclipse.core.databinding.observable.value.IObservableValue labelText,
org.eclipse.core.databinding.observable.value.IObservableValue labelTooltipText,
TableViewerCompositeBuilder compositeBuilder,
org.eclipse.jface.databinding.viewers.ObservableListContentProvider cp,
TableControlSWTRenderer.ECPTableViewerComparator comparator,
TableControlSWTRenderer.TableControlSWTRendererButtonBarBuilder tableControlSWTRendererButtonBarBuilder2)
Creates a new
TableViewerSWTBuilder. |
protected org.eclipse.swt.widgets.ScrollBar |
getVerticalBar()
Returns the receiver's vertical scroll bar if it has one, and null if it does not.
|
protected org.eclipse.swt.widgets.Control |
renderControl(SWTGridCell gridCell,
org.eclipse.swt.widgets.Composite parent)
Renders the passed
VElement. |
protected void |
rootDomainModelChanged()
This method is called in
AbstractControlSWTRenderer.notifyChange() when the root domain model of the view model context changes. |
protected void |
setTableViewer(org.eclipse.jface.viewers.AbstractTableViewer tableViewer)
Sets the table viewer.
|
protected void |
viewerSelectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent event)
This method gets called when the selection on the
TableViewer (see getTableViewer()) has
changed. |
canHandleControlProcessor, createLabel, createValidationIcon, defaultHandleControlProcessor, defaultHandleControlProcessorForCell, getDataBindingContext, getEditingDomain, getEMFFormsLabelProvider, getModelValue, getValidationBackgroundColor, getValidationForegroundColor, getValidationIcon, getVTViewTemplateProvider, hasLeftLabelAlignment, notifyChange, postInit, renderapplyVisible, finalizeRendering, getControls, getDefaultFontName, init, preInit, setControlEnabledcheckRenderer, getReportService, getVElement, getViewModelContextprotected static final String FIXED_COLUMNS
protected static final String TABLE_CUSTOM_VARIANT
@Inject public TableControlSWTRenderer(VTableControl vElement, ViewModelContext viewContext, ReportService reportService, EMFFormsDatabindingEMF emfFormsDatabinding, EMFFormsLabelProvider emfFormsLabelProvider, VTViewTemplateProvider vtViewTemplateProvider, ImageRegistryService imageRegistryService, EMFFormsEditSupport emfFormsEditSupport)
vElement - the view model element to be renderedviewContext - the view contextemfFormsDatabinding - The EMFFormsDatabindingemfFormsLabelProvider - The EMFFormsLabelProviderreportService - The ReportServicevtViewTemplateProvider - The VTViewTemplateProviderimageRegistryService - The ImageRegistryServiceemfFormsEditSupport - The EMFFormsEditSupportpublic SWTGridDescription getGridDescription(SWTGridDescription gridDescription)
AbstractSWTRenderergetGridDescription in class AbstractSWTRenderer<VTableControl>gridDescription - the current SWTGridDescriptionprotected EMFFormsDatabindingEMF getEMFFormsDatabinding()
AbstractControlSWTRendererEMFFormsDatabinding to use.getEMFFormsDatabinding in class AbstractControlSWTRenderer<VTableControl>protected org.eclipse.swt.widgets.Control renderControl(SWTGridCell gridCell, org.eclipse.swt.widgets.Composite parent) throws NoRendererFoundException, NoPropertyDescriptorFoundExeption
AbstractSWTRendererVElement.renderControl in class AbstractSWTRenderer<VTableControl>gridCell - the GridCell of the control to renderparent - the Composite to render onControlNoRendererFoundException - this is thrown when a renderer cannot be foundNoPropertyDescriptorFoundExeption - this is thrown when no property descriptor can be foundprotected TableViewerSWTBuilder getTableViewerSWTBuilder(org.eclipse.swt.widgets.Composite parent, org.eclipse.core.databinding.observable.list.IObservableList list, org.eclipse.core.databinding.observable.value.IObservableValue labelText, org.eclipse.core.databinding.observable.value.IObservableValue labelTooltipText, TableViewerCompositeBuilder compositeBuilder, org.eclipse.jface.databinding.viewers.ObservableListContentProvider cp, TableControlSWTRenderer.ECPTableViewerComparator comparator, TableControlSWTRenderer.TableControlSWTRendererButtonBarBuilder tableControlSWTRendererButtonBarBuilder2)
TableViewerSWTBuilder.parent - the parent Compositelist - the input objectlabelText - the titlelabelTooltipText - the tooltipcompositeBuilder - the TableViewerCompositeBuildercp - the content providercomparator - the ViewerComparatortableControlSWTRendererButtonBarBuilder2 - the ButtonBarBuilderTableViewerSWTBuilderprotected TableViewerCreator<? extends org.eclipse.jface.viewers.AbstractTableViewer> getTableViewerCreator()
TableViewerCreator to be used.TableViewerCreatorprotected int addAdditionalColumns(TableViewerSWTBuilder tableViewerSWTBuilder)
tableViewerSWTBuilder - the builderprotected int getSelectionIndex()
protected org.eclipse.swt.widgets.Item[] getColumns()
items which are the columns in the table.protected org.eclipse.swt.widgets.ScrollBar getHorizontalBar()
protected org.eclipse.swt.widgets.ScrollBar getVerticalBar()
protected final VDomainModelReference getDMRToMultiReference()
VDomainModelReference which ends at the table settingprotected int addButtonsToButtonBar(org.eclipse.swt.widgets.Composite buttonComposite)
The default implementation does not add additional buttons.
buttonComposite - the composite where the buttons are addedprotected org.eclipse.swt.widgets.Composite createControlComposite(org.eclipse.swt.widgets.Composite composite)
composite - the parent composite including the title/button barprotected int getTableHeightHint()
protected org.eclipse.jface.viewers.AbstractTableViewer getTableViewer()
protected void setTableViewer(org.eclipse.jface.viewers.AbstractTableViewer tableViewer)
tableViewer - the viewerprotected void viewerSelectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent event)
TableViewer (see getTableViewer()) has
changed.
If you override this method make sure to call super.
event - the SelectionChangedEventprotected org.eclipse.swt.graphics.Image getImage(URL url)
ImageRegistryService using an URL.url - The URL pointing to the imageprotected org.eclipse.swt.graphics.Image getImage(String path)
ImageRegistryService using a bundle relative path.path - The bundle relative path pointing to the imageprotected VTBackgroundStyleProperty getBackgroundStyleProperty()
VTBackgroundStyleProperty.VTBackgroundStylePropertyprotected VTFontPropertiesStyleProperty getFontPropertiesStyleProperty()
VTFontPropertiesStyleProperty.VTFontPropertiesStylePropertyprotected org.eclipse.swt.graphics.Color getSWTColor(String colorHex)
Color specified by the provided String.colorHex - the Hex String describing the colorColorprotected org.eclipse.jface.viewers.CellEditor createCellEditor(org.eclipse.emf.ecore.EObject tempInstance,
org.eclipse.emf.ecore.EStructuralFeature feature,
org.eclipse.swt.widgets.Composite table)
tempInstance - the temporary input instance of the tablefeature - the feature of the columntable - the table/parentprotected void deleteRowUserConfirmDialog(List<org.eclipse.emf.ecore.EObject> deletionList, org.eclipse.emf.ecore.EObject eObject, org.eclipse.emf.ecore.EStructuralFeature structuralFeature, org.eclipse.swt.widgets.Button addButton, org.eclipse.swt.widgets.Button removeButton)
deletionList - the list of selected EObjects to deleteeObject - The containment reference EObjectstructuralFeature - The containment reference EStructuralFeatureaddButton - the add buttonremoveButton - the remove buttonprotected void deleteRows(List<org.eclipse.emf.ecore.EObject> deletionList, org.eclipse.emf.ecore.EObject eObject, org.eclipse.emf.ecore.EStructuralFeature structuralFeature)
#deleteRowUserConfirmDialog(List) after the user confirmed to delete the selected
elements.deletionList - the list of EObjects to deleteeObject - The containment reference EObjectstructuralFeature - The containment reference EStructuralFeatureprotected void addRow(org.eclipse.emf.ecore.EClass clazz,
org.eclipse.emf.ecore.EObject eObject,
org.eclipse.emf.ecore.EStructuralFeature structuralFeature)
clazz - the EClass defining the EObject to createeObject - The containment reference EObjectstructuralFeature - The containment reference EStructuralFeatureprotected void applyValidation()
AbstractSWTRendererapplyValidation in class AbstractSWTRenderer<VTableControl>protected org.eclipse.swt.widgets.Button getAddButton()
protected org.eclipse.swt.widgets.Button getRemoveButton()
protected void applyEnable()
applyEnable in class AbstractControlSWTRenderer<VTableControl>AbstractSWTRenderer.applyEnable()protected void applyReadOnly()
applyReadOnly in class AbstractSWTRenderer<VTableControl>AbstractSWTRenderer.applyReadOnly()protected void dispose()
dispose in class AbstractControlSWTRenderer<VTableControl>AbstractSWTRenderer.dispose()protected int compare(org.eclipse.jface.viewers.Viewer viewer,
Object e1,
Object e2,
int direction,
int propertyIndex)
TableControlSWTRenderer.ECPTableViewerComparator in order to compare the given objects.viewer - the tavle viewere1 - the first object of the comparisone2 - the second object of the comparisonpropertyIndex - index of the selection column. the index is aligned with the index of the associated column
domain model referencedirection - SWT.NONE, SWT.UP or SWT.DOWN according to the indication displayed at
the table column.0 if the first element is
equal to the second element; and a positive number if the first
element is greater than the second elementprotected void rootDomainModelChanged()
throws DatabindingFailedException
AbstractControlSWTRendererAbstractControlSWTRenderer.notifyChange() when the root domain model of the view model context changes.rootDomainModelChanged in class AbstractControlSWTRenderer<VTableControl>DatabindingFailedException - If the databinding failedCopyright © 2016. All rights reserved.