Class TableViewerSWTBuilder
- java.lang.Object
-
- org.eclipse.emfforms.spi.swt.table.AbstractFeatureAwareBuilder<TableViewerSWTBuilder>
-
- org.eclipse.emfforms.spi.swt.table.TableViewerSWTBuilder
-
- Direct Known Subclasses:
GridTableViewerSWTBuilder
,GridTableViewerSWTBuilder
public class TableViewerSWTBuilder extends AbstractFeatureAwareBuilder<TableViewerSWTBuilder>
Builder class for creating aTableViewerComposite
.- Author:
- Alexandra Buzila, Johannes Faltermeier, Mat Hansen
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
TableViewerSWTBuilder(org.eclipse.swt.widgets.Composite composite, int swtStyleBits, java.lang.Object input, org.eclipse.core.databinding.observable.value.IObservableValue title, org.eclipse.core.databinding.observable.value.IObservableValue tooltip)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description TableViewerSWTBuilder
addColumn(ColumnConfiguration columnConfiguration)
Adds a new column.AbstractTableViewerComposite<? extends org.eclipse.jface.viewers.AbstractTableViewer>
build()
Call this method after all desired customizations have been passed to the builder.TableViewerSWTBuilder
columnRegexFilter(boolean columnRegexFilter)
Set whether support for users to show a regular expression filter on columns is installed.TableViewerSWTBuilder
columnSubstringFilter(boolean columnSubstringFilter)
Set whether support for users to show a simple substring-matching filter on columns is installed.TableViewerSWTBuilder
configureTable(TableConfiguration tableConfiguration)
Configures the current table instance using the given configuration.TableViewerSWTBuilder
customizeActionBar(ActionBar<? extends org.eclipse.jface.viewers.Viewer> actionBar)
Use this method to customize the way the button bar is filled.TableViewerSWTBuilder
customizeActionConfiguration(ActionConfiguration actionConfiguration)
Use this method to customize the key bindings for the table viewer.TableViewerSWTBuilder
customizeComparator(org.eclipse.jface.viewers.ViewerComparator comparator)
Use this method to set aViewerComparator
on the table.TableViewerSWTBuilder
customizeCompositeStructure(TableViewerCompositeBuilder builder)
Use this method to customize the way title, validation, buttons and the tableviewer are arranged.TableViewerSWTBuilder
customizeContentProvider(org.eclipse.jface.viewers.IContentProvider provider)
Use this method to set a different content provider on the viewer.TableViewerSWTBuilder
customizeDragAndDrop(DNDProvider provider)
Use this method to customize drag&drop.TableViewerSWTBuilder
customizeTableViewerCreation(TableViewerCreator<? extends org.eclipse.jface.viewers.AbstractTableViewer> creator)
Use this method to create the actual TableViewer.protected org.eclipse.swt.widgets.Composite
getComposite()
TableViewerSWTCustomization<?>
getCustomization()
java.util.Set<Feature>
getEnabledFeatures()
Deprecated.Since 1.21, use theshowHideColumns(boolean)
and similar builder methods, insteadprotected java.lang.Object
getInput()
java.util.Set<Feature>
getSupportedFeatures()
Deprecated.Since 1.21, use theshowHideColumns(boolean)
and similar builder methods, insteadprotected int
getSwtStyleBits()
protected org.eclipse.core.databinding.observable.value.IObservableValue
getTitle()
protected org.eclipse.core.databinding.observable.value.IObservableValue
getTooltip()
TableViewerSWTBuilder
showHideColumns(boolean showHideColumns)
Set whether support for users to show and hide columns is installed.-
Methods inherited from class org.eclipse.emfforms.spi.swt.table.AbstractFeatureAwareBuilder
disableFeature, enableFeature, getBuilder, inheritFeatures, isFeatureEnabled, isFeatureSupported
-
-
-
-
Constructor Detail
-
TableViewerSWTBuilder
protected TableViewerSWTBuilder(org.eclipse.swt.widgets.Composite composite, int swtStyleBits, java.lang.Object input, org.eclipse.core.databinding.observable.value.IObservableValue title, org.eclipse.core.databinding.observable.value.IObservableValue tooltip)
- Parameters:
composite
- the parentComposite
swtStyleBits
- the swt style bitsinput
- the input objecttitle
- the titletooltip
- the tooltip
-
-
Method Detail
-
getComposite
protected org.eclipse.swt.widgets.Composite getComposite()
- Returns:
- the composite
-
getSwtStyleBits
protected int getSwtStyleBits()
- Returns:
- the swtStyleBits
-
getInput
protected java.lang.Object getInput()
- Returns:
- the input
-
getCustomization
public TableViewerSWTCustomization<?> getCustomization()
- Returns:
- the customization
-
getTitle
protected org.eclipse.core.databinding.observable.value.IObservableValue getTitle()
- Returns:
- the title
-
getTooltip
protected org.eclipse.core.databinding.observable.value.IObservableValue getTooltip()
- Returns:
- the tooltip
-
customizeCompositeStructure
public TableViewerSWTBuilder customizeCompositeStructure(TableViewerCompositeBuilder builder)
Use this method to customize the way title, validation, buttons and the tableviewer are arranged.
The default implementation will create a title bar with title to left, a validation label in the middle and a button bar on the right. Below the title bar the viewer will be created
- Parameters:
builder
- theTableViewerCompositeBuilder
- Returns:
- self
-
customizeTableViewerCreation
public TableViewerSWTBuilder customizeTableViewerCreation(TableViewerCreator<? extends org.eclipse.jface.viewers.AbstractTableViewer> creator)
Use this method to create the actual TableViewer.
The default implementation will create a viewer with the SWT#MULTI, SWT#V_SCROLL, FULL_SELECTION and SWT#BORDER style bits. The table will show the
header
and will showlines
.- Parameters:
creator
- theTableViewerCreator
- Returns:
- self
-
customizeComparator
public TableViewerSWTBuilder customizeComparator(org.eclipse.jface.viewers.ViewerComparator comparator)
Use this method to set a
ViewerComparator
on the table.The default implementation does not add a comparator.
- Parameters:
comparator
- theViewerComparator
- Returns:
- self
-
customizeContentProvider
public TableViewerSWTBuilder customizeContentProvider(org.eclipse.jface.viewers.IContentProvider provider)
Use this method to set a different content provider on the viewer.
The default implementation uses a
ObservableListContentProvider
.- Parameters:
provider
- theIContentProvider
to use- Returns:
- self
-
customizeActionBar
public TableViewerSWTBuilder customizeActionBar(ActionBar<? extends org.eclipse.jface.viewers.Viewer> actionBar)
Use this method to customize the way the button bar is filled.
The default behavior will not add any buttons.
- Parameters:
actionBar
- theActionBar
- Returns:
- self
-
customizeActionConfiguration
public TableViewerSWTBuilder customizeActionConfiguration(ActionConfiguration actionConfiguration)
Use this method to customize the key bindings for the table viewer.
The default behavior will not register any bindings.
- Parameters:
actionConfiguration
- theActionConfiguration
- Returns:
- self
-
customizeDragAndDrop
public TableViewerSWTBuilder customizeDragAndDrop(DNDProvider provider)
Use this method to customize drag&drop.
The default behaviour disables drag&drop.
- Parameters:
provider
- the provider- Returns:
- self
-
configureTable
public TableViewerSWTBuilder configureTable(TableConfiguration tableConfiguration)
Configures the current table instance using the given configuration.- Parameters:
tableConfiguration
- theTableConfiguration
to add- Returns:
- self
-
addColumn
public TableViewerSWTBuilder addColumn(ColumnConfiguration columnConfiguration)
Adds a new column.- Parameters:
columnConfiguration
- theColumnConfiguration
to add- Returns:
- self
-
getSupportedFeatures
@Deprecated public java.util.Set<Feature> getSupportedFeatures()
Deprecated.Since 1.21, use theshowHideColumns(boolean)
and similar builder methods, insteadDescription copied from class:AbstractFeatureAwareBuilder
Returns the list of supported features.- Specified by:
getSupportedFeatures
in classAbstractFeatureAwareBuilder<TableViewerSWTBuilder>
- Returns:
- array of supported features
- See Also:
showHideColumns(boolean)
,columnSubstringFilter(boolean)
,columnRegexFilter(boolean)
-
getEnabledFeatures
@Deprecated public java.util.Set<Feature> getEnabledFeatures()
Deprecated.Since 1.21, use theshowHideColumns(boolean)
and similar builder methods, insteadDescription copied from class:AbstractFeatureAwareBuilder
Return the list of enabled features.- Specified by:
getEnabledFeatures
in classAbstractFeatureAwareBuilder<TableViewerSWTBuilder>
- Returns:
- list of enabled features
- See Also:
showHideColumns(boolean)
,columnSubstringFilter(boolean)
,columnRegexFilter(boolean)
-
showHideColumns
public TableViewerSWTBuilder showHideColumns(boolean showHideColumns)
Set whether support for users to show and hide columns is installed.- Parameters:
showHideColumns
-true
to enable showing and hiding of columns;false
to disable it- Returns:
- this builder, for fluent chaining
- Since:
- 1.21
-
columnSubstringFilter
public TableViewerSWTBuilder columnSubstringFilter(boolean columnSubstringFilter)
Set whether support for users to show a simple substring-matching filter on columns is installed.- Parameters:
columnSubstringFilter
-true
to enable the substring filter;false
to disable it- Returns:
- this builder, for fluent chaining
- Since:
- 1.21
-
columnRegexFilter
public TableViewerSWTBuilder columnRegexFilter(boolean columnRegexFilter)
Set whether support for users to show a regular expression filter on columns is installed.- Parameters:
columnRegexFilter
-true
to enable the regex filter;false
to disable it- Returns:
- this builder, for fluent chaining
- Since:
- 1.21
-
build
public AbstractTableViewerComposite<? extends org.eclipse.jface.viewers.AbstractTableViewer> build()
Call this method after all desired customizations have been passed to the builder. The will create a newTableViewerComposite
with the desired customizations.- Returns:
- the
TableViewerComposite
-
-