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 protectedTableViewerSWTBuilder(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 TableViewerSWTBuilderaddColumn(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.TableViewerSWTBuildercolumnRegexFilter(boolean columnRegexFilter)Set whether support for users to show a regular expression filter on columns is installed.TableViewerSWTBuildercolumnSubstringFilter(boolean columnSubstringFilter)Set whether support for users to show a simple substring-matching filter on columns is installed.TableViewerSWTBuilderconfigureTable(TableConfiguration tableConfiguration)Configures the current table instance using the given configuration.TableViewerSWTBuildercustomizeActionBar(ActionBar<? extends org.eclipse.jface.viewers.Viewer> actionBar)Use this method to customize the way the button bar is filled.TableViewerSWTBuildercustomizeActionConfiguration(ActionConfiguration actionConfiguration)Use this method to customize the key bindings for the table viewer.TableViewerSWTBuildercustomizeComparator(org.eclipse.jface.viewers.ViewerComparator comparator)Use this method to set aViewerComparatoron the table.TableViewerSWTBuildercustomizeCompositeStructure(TableViewerCompositeBuilder builder)Use this method to customize the way title, validation, buttons and the tableviewer are arranged.TableViewerSWTBuildercustomizeContentProvider(org.eclipse.jface.viewers.IContentProvider provider)Use this method to set a different content provider on the viewer.TableViewerSWTBuildercustomizeDragAndDrop(DNDProvider provider)Use this method to customize drag&drop.TableViewerSWTBuildercustomizeTableViewerCreation(TableViewerCreator<? extends org.eclipse.jface.viewers.AbstractTableViewer> creator)Use this method to create the actual TableViewer.protected org.eclipse.swt.widgets.CompositegetComposite()TableViewerSWTCustomization<?>getCustomization()java.util.Set<Feature>getEnabledFeatures()Deprecated.Since 1.21, use theshowHideColumns(boolean)and similar builder methods, insteadprotected java.lang.ObjectgetInput()java.util.Set<Feature>getSupportedFeatures()Deprecated.Since 1.21, use theshowHideColumns(boolean)and similar builder methods, insteadprotected intgetSwtStyleBits()protected org.eclipse.core.databinding.observable.value.IObservableValuegetTitle()protected org.eclipse.core.databinding.observable.value.IObservableValuegetTooltip()TableViewerSWTBuildershowHideColumns(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 parentCompositeswtStyleBits- 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
headerand will showlines.- Parameters:
creator- theTableViewerCreator- Returns:
- self
-
customizeComparator
public TableViewerSWTBuilder customizeComparator(org.eclipse.jface.viewers.ViewerComparator comparator)
Use this method to set a
ViewerComparatoron 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- theIContentProviderto 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- theTableConfigurationto add- Returns:
- self
-
addColumn
public TableViewerSWTBuilder addColumn(ColumnConfiguration columnConfiguration)
Adds a new column.- Parameters:
columnConfiguration- theColumnConfigurationto 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:AbstractFeatureAwareBuilderReturns the list of supported features.- Specified by:
getSupportedFeaturesin 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:AbstractFeatureAwareBuilderReturn the list of enabled features.- Specified by:
getEnabledFeaturesin 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-trueto enable showing and hiding of columns;falseto 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-trueto enable the substring filter;falseto 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-trueto enable the regex filter;falseto 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 newTableViewerCompositewith the desired customizations.- Returns:
- the
TableViewerComposite
-
-