Class AbstractTableViewerColumnBuilder<V extends org.eclipse.jface.viewers.AbstractTableViewer,C extends org.eclipse.jface.viewers.ViewerColumn>
- java.lang.Object
-
- org.eclipse.emfforms.spi.swt.table.AbstractTableViewerColumnBuilder<V,C>
-
- Type Parameters:
V- the TableViewer implementation to useC- theViewerColumnimplementation to use
- Direct Known Subclasses:
DefaultTableViewerColumnBuilder,GridViewerColumnBuilder,GridViewerColumnBuilder
public abstract class AbstractTableViewerColumnBuilder<V extends org.eclipse.jface.viewers.AbstractTableViewer,C extends org.eclipse.jface.viewers.ViewerColumn> extends java.lang.ObjectA table viewer configuration helper class.- Author:
- Mat Hansen
-
-
Constructor Summary
Constructors Constructor Description AbstractTableViewerColumnBuilder(ColumnConfiguration config)The constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidbindValue(org.eclipse.swt.widgets.Widget column, org.eclipse.jface.databinding.swt.IWidgetValueProperty valueProperty, org.eclipse.core.databinding.observable.value.IObservableValue observable)Binds a value to a widget value property.Cbuild(V tableViewer)Creates a new viewer column.protected voidconfigure(V tableViewer, C viewerColumn)Configures a viewer column instance.protected voidconfigureContextMap(org.eclipse.swt.widgets.Widget column)Configures the context map of the given widget.protected voidconfigureDatabinding(org.eclipse.swt.widgets.Widget column)Configures data binding for the given column widget.protected abstract voidconfigureEditingSupport(C viewerColumn, V tableViewer)Configures the EditingSupport for the given table viewer/column.protected voidconfigureImage(org.eclipse.swt.widgets.Item column)Configures a image for the given column item.protected voidconfigureLabelProvider(C column, V tableViewer)Configures the label provider of the given column.protected abstract voidconfigureViewerColumn(C viewerColumn)Configures a viewer column instance.abstract CcreateViewerColumn(V tableViewer)Creates a new ViewerColumn instance.ColumnConfigurationgetConfig()protected abstract org.eclipse.swt.widgets.ItemgetTableColumn(C viewerColumn)Returns the table column control for the given viewer column.AbstractTableViewerColumnBuilder<V,C>withDatabinding(org.eclipse.emf.databinding.EMFDataBindingContext dataBindingContext)Adds databinding support.
-
-
-
Constructor Detail
-
AbstractTableViewerColumnBuilder
public AbstractTableViewerColumnBuilder(ColumnConfiguration config)
The constructor.- Parameters:
config- theColumnConfiguration
-
-
Method Detail
-
build
public C build(V tableViewer)
Creates a new viewer column.- Parameters:
tableViewer- the parent table viewer- Returns:
- the table viewer column
-
createViewerColumn
public abstract C createViewerColumn(V tableViewer)
Creates a new ViewerColumn instance.- Parameters:
tableViewer- the TableViewer- Returns:
- a ViewerColumn instance
-
getTableColumn
protected abstract org.eclipse.swt.widgets.Item getTableColumn(C viewerColumn)
Returns the table column control for the given viewer column.- Parameters:
viewerColumn- the viewer column- Returns:
- a table column control
-
configureViewerColumn
protected abstract void configureViewerColumn(C viewerColumn)
Configures a viewer column instance.- Parameters:
viewerColumn- the viewer column to configure
-
configure
protected void configure(V tableViewer, C viewerColumn)
Configures a viewer column instance.- Parameters:
tableViewer- the table viewer the column belongs toviewerColumn- the viewer column to configure
-
configureEditingSupport
protected abstract void configureEditingSupport(C viewerColumn, V tableViewer)
Configures the EditingSupport for the given table viewer/column.- Parameters:
viewerColumn- the viewer column to configuretableViewer- the table viewer the column belongs to
-
withDatabinding
public AbstractTableViewerColumnBuilder<V,C> withDatabinding(org.eclipse.emf.databinding.EMFDataBindingContext dataBindingContext)
Adds databinding support.- Parameters:
dataBindingContext- theEMFDataBindingContextto use- Returns:
- a new TableViewerColumnBuilder instance
-
bindValue
protected void bindValue(org.eclipse.swt.widgets.Widget column, org.eclipse.jface.databinding.swt.IWidgetValueProperty valueProperty, org.eclipse.core.databinding.observable.value.IObservableValue observable)Binds a value to a widget value property.- Parameters:
column- the widgetvalueProperty- the value property to bind toobservable- the value to bind to
-
configureDatabinding
protected void configureDatabinding(org.eclipse.swt.widgets.Widget column)
Configures data binding for the given column widget.- Parameters:
column- the column widget to configure
-
configureLabelProvider
protected void configureLabelProvider(C column, V tableViewer)
Configures the label provider of the given column.- Parameters:
column- the column to configuretableViewer- the table viewer the column belongs to
-
configureImage
protected void configureImage(org.eclipse.swt.widgets.Item column)
Configures a image for the given column item.- Parameters:
column- the column item to configure an image for
-
configureContextMap
protected void configureContextMap(org.eclipse.swt.widgets.Widget column)
Configures the context map of the given widget.- Parameters:
column- the column widget to configure
-
getConfig
public ColumnConfiguration getConfig()
- Returns:
- the
ColumnConfiguration
-
-