Class DefaultTableControlSWTCustomization<T extends org.eclipse.jface.viewers.AbstractTableViewer>
- java.lang.Object
-
- org.eclipse.emfforms.internal.swt.table.DefaultTableControlSWTCustomization<T>
-
- Type Parameters:
T- the concrete table viewer implementation to use
- All Implemented Interfaces:
ActionBarProvider<T>,ActionConfigurationProvider,DNDProvider,TableViewerCompositeBuilder,TableViewerCreator<T>,TableViewerSWTCustomization<T>
public class DefaultTableControlSWTCustomization<T extends org.eclipse.jface.viewers.AbstractTableViewer> extends java.lang.Object implements TableViewerSWTCustomization<T>
The default implementation of theTableViewerSWTCustomization.- Author:
- Alexandra Buzila, Johannes Faltermeier
-
-
Constructor Summary
Constructors Constructor Description DefaultTableControlSWTCustomization()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddColumn(ColumnConfiguration columnConfiguration)Adds a column to the table.voidconfigureTable(TableConfiguration tableConfiguration)Sets the table configuration.voidcreateCompositeLayout(org.eclipse.swt.widgets.Composite parent)Called to create thecomposites.org.eclipse.jface.viewers.IContentProvidercreateContentProvider()Returns the content provider to use.TcreateTableViewer(org.eclipse.swt.widgets.Composite parent)Creates theAbstractTableViewer.Optional<ActionBar<T>>getActionBar()Get the action bar instance (if it exists).Optional<ActionConfiguration>getActionConfiguration()Returns the action configuration which will be used to register defined key bindings on the viewer.Optional<org.eclipse.swt.widgets.Composite>getButtonComposite()java.util.List<ColumnConfiguration>getColumnConfigurations()Returns the column configurations which will be used to configure columns.Optional<org.eclipse.jface.viewers.ViewerComparator>getComparator()Returns the comparator to use.org.eclipse.swt.dnd.DragSourceListenergetDragListener(org.eclipse.jface.viewers.AbstractTableViewer tableViewer)Returns theDragSourceListenerused to setup thedrag supportfor the viewer.intgetDragOperations()Returns the drag operations bits used to setup thedrag supportfor the viewer.org.eclipse.swt.dnd.Transfer[]getDragTransferTypes()Returns the drag transfer types used to setup thedrag supportfor the viewer.org.eclipse.swt.dnd.DropTargetListenergetDropListener(org.eclipse.jface.viewers.AbstractTableViewer tableViewer)Returns theDragSourceListenerused to setup thedrop supportfor the viewer.intgetDropOperations()Returns the drag operations bits used to setup thedrop supportfor the viewer.org.eclipse.swt.dnd.Transfer[]getDropTransferTypes()Returns the drag transfer types used to setup thedrop supportfor the viewer.TableConfigurationgetTableConfiguration()Returns the table configuration which will be used to configure the table instance.Optional<org.eclipse.swt.widgets.Label>getTitleLabel()Optional<java.util.List<org.eclipse.swt.widgets.Control>>getValidationControls()org.eclipse.swt.widgets.CompositegetViewerComposite()booleanhasDND()Whether DND support should be added to the table.voidsetActionBar(ActionBar<T> actionBar)Allows the customize theActionBar.voidsetActionConfiguration(ActionConfiguration actionConfiguration)Allows to customize theActionConfiguration.voidsetContentProvider(org.eclipse.jface.viewers.IContentProvider provider)Allows the exchange the defaultIContentProvider.voidsetDND(DNDProvider provider)Allows the exchange the defaultDNDProvider.voidsetTableViewerCompositeBuilder(TableViewerCompositeBuilder builder)Allows the exchange the defaultTableViewerCompositeBuilder.voidsetTableViewerCreator(TableViewerCreator<T> creator)Allows the exchange the defaultTableViewerCreator.voidsetViewerComparator(org.eclipse.jface.viewers.ViewerComparator comparator)Allows the exchange the defaultViewerComparator.
-
-
-
Method Detail
-
createCompositeLayout
public void createCompositeLayout(org.eclipse.swt.widgets.Composite parent)
Description copied from interface:TableViewerCompositeBuilderCalled to create thecomposites.- Specified by:
createCompositeLayoutin interfaceTableViewerCompositeBuilder- Parameters:
parent- the parent
-
getTitleLabel
public Optional<org.eclipse.swt.widgets.Label> getTitleLabel()
Description copied from interface:TableViewerCompositeBuilder- Specified by:
getTitleLabelin interfaceTableViewerCompositeBuilder- Returns:
- the title
Labelif available
-
getValidationControls
public Optional<java.util.List<org.eclipse.swt.widgets.Control>> getValidationControls()
Description copied from interface:TableViewerCompositeBuilder- Specified by:
getValidationControlsin interfaceTableViewerCompositeBuilder- Returns:
- the list of validation
controls.
-
getButtonComposite
public Optional<org.eclipse.swt.widgets.Composite> getButtonComposite()
Description copied from interface:TableViewerCompositeBuilder- Specified by:
getButtonCompositein interfaceTableViewerCompositeBuilder- Returns:
- the parent
Compositeforcontrol-buttons.
-
getViewerComposite
public org.eclipse.swt.widgets.Composite getViewerComposite()
Description copied from interface:TableViewerCompositeBuilder- Specified by:
getViewerCompositein interfaceTableViewerCompositeBuilder- Returns:
- the parent
Compositefor theTableViewer.
-
createTableViewer
public T createTableViewer(org.eclipse.swt.widgets.Composite parent)
Description copied from interface:TableViewerCreatorCreates theAbstractTableViewer.- Specified by:
createTableViewerin interfaceTableViewerCreator<T extends org.eclipse.jface.viewers.AbstractTableViewer>- Parameters:
parent- the parentComposite- Returns:
- the viewer
-
getComparator
public Optional<org.eclipse.jface.viewers.ViewerComparator> getComparator()
Description copied from interface:TableViewerSWTCustomizationReturns the comparator to use.- Specified by:
getComparatorin interfaceTableViewerSWTCustomization<T extends org.eclipse.jface.viewers.AbstractTableViewer>- Returns:
- the
ViewerComparatorwhich will be set on the viewer, if present
-
createContentProvider
public org.eclipse.jface.viewers.IContentProvider createContentProvider()
Description copied from interface:TableViewerSWTCustomizationReturns the content provider to use.- Specified by:
createContentProviderin interfaceTableViewerSWTCustomization<T extends org.eclipse.jface.viewers.AbstractTableViewer>- Returns:
- the
IContentProviderwhich will be set on the viewer
-
getTableConfiguration
public TableConfiguration getTableConfiguration()
Description copied from interface:TableViewerSWTCustomizationReturns the table configuration which will be used to configure the table instance. May be null as long as the configuration is incomplete.- Specified by:
getTableConfigurationin interfaceTableViewerSWTCustomization<T extends org.eclipse.jface.viewers.AbstractTableViewer>- Returns:
- the
TableConfiguration
-
getColumnConfigurations
public java.util.List<ColumnConfiguration> getColumnConfigurations()
Description copied from interface:TableViewerSWTCustomizationReturns the column configurations which will be used to configure columns.- Specified by:
getColumnConfigurationsin interfaceTableViewerSWTCustomization<T extends org.eclipse.jface.viewers.AbstractTableViewer>- Returns:
- the
ColumnConfiguration
-
setTableViewerCompositeBuilder
public void setTableViewerCompositeBuilder(TableViewerCompositeBuilder builder)
Allows the exchange the defaultTableViewerCompositeBuilder.- Parameters:
builder- theTableViewerCompositeBuilder
-
setTableViewerCreator
public void setTableViewerCreator(TableViewerCreator<T> creator)
Allows the exchange the defaultTableViewerCreator.- Parameters:
creator- theTableViewerCreator
-
setViewerComparator
public void setViewerComparator(org.eclipse.jface.viewers.ViewerComparator comparator)
Allows the exchange the defaultViewerComparator.- Parameters:
comparator- theViewerComparator
-
setContentProvider
public void setContentProvider(org.eclipse.jface.viewers.IContentProvider provider)
Allows the exchange the defaultIContentProvider.- Parameters:
provider- theIContentProvider
-
setActionBar
public void setActionBar(ActionBar<T> actionBar)
Allows the customize theActionBar.- Parameters:
actionBar- theActionBar
-
getActionBar
public Optional<ActionBar<T>> getActionBar()
Get the action bar instance (if it exists).- Specified by:
getActionBarin interfaceActionBarProvider<T extends org.eclipse.jface.viewers.AbstractTableViewer>- Returns:
- the actionBar
-
configureTable
public void configureTable(TableConfiguration tableConfiguration)
Sets the table configuration.- Parameters:
tableConfiguration- theTableConfiguration
-
addColumn
public void addColumn(ColumnConfiguration columnConfiguration)
Adds a column to the table.- Parameters:
columnConfiguration- theColumnDescription
-
getActionConfiguration
public Optional<ActionConfiguration> getActionConfiguration()
Description copied from interface:ActionConfigurationProviderReturns the action configuration which will be used to register defined key bindings on the viewer.- Specified by:
getActionConfigurationin interfaceActionConfigurationProvider- Returns:
- the
ActionConfiguration, if any
-
setActionConfiguration
public void setActionConfiguration(ActionConfiguration actionConfiguration)
Allows to customize theActionConfiguration.- Parameters:
actionConfiguration- TheActionConfiguration- See Also:
getActionConfiguration()
-
setDND
public void setDND(DNDProvider provider)
Allows the exchange the defaultDNDProvider.- Parameters:
provider- theDNDProvider
-
hasDND
public boolean hasDND()
Description copied from interface:DNDProviderWhether DND support should be added to the table.- Specified by:
hasDNDin interfaceDNDProvider- Returns:
trueif DND will be added, based on the other methods of this interface, orfalseif DND should not be added
-
getDragOperations
public int getDragOperations()
Description copied from interface:DNDProviderReturns the drag operations bits used to setup thedrag supportfor the viewer.- Specified by:
getDragOperationsin interfaceDNDProvider- Returns:
- the drag operations
-
getDragTransferTypes
public org.eclipse.swt.dnd.Transfer[] getDragTransferTypes()
Description copied from interface:DNDProviderReturns the drag transfer types used to setup thedrag supportfor the viewer.- Specified by:
getDragTransferTypesin interfaceDNDProvider- Returns:
- the drag
transfer types
-
getDragListener
public org.eclipse.swt.dnd.DragSourceListener getDragListener(org.eclipse.jface.viewers.AbstractTableViewer tableViewer)
Description copied from interface:DNDProviderReturns theDragSourceListenerused to setup thedrag supportfor the viewer.- Specified by:
getDragListenerin interfaceDNDProvider- Parameters:
tableViewer- the AbstractTableViewer- Returns:
- the listener
-
getDropOperations
public int getDropOperations()
Description copied from interface:DNDProviderReturns the drag operations bits used to setup thedrop supportfor the viewer.- Specified by:
getDropOperationsin interfaceDNDProvider- Returns:
- the drop operations
-
getDropTransferTypes
public org.eclipse.swt.dnd.Transfer[] getDropTransferTypes()
Description copied from interface:DNDProviderReturns the drag transfer types used to setup thedrop supportfor the viewer.- Specified by:
getDropTransferTypesin interfaceDNDProvider- Returns:
- the drop
transfer types
-
getDropListener
public org.eclipse.swt.dnd.DropTargetListener getDropListener(org.eclipse.jface.viewers.AbstractTableViewer tableViewer)
Description copied from interface:DNDProviderReturns theDragSourceListenerused to setup thedrop supportfor the viewer.- Specified by:
getDropListenerin interfaceDNDProvider- Parameters:
tableViewer- the AbstractTableViewer- Returns:
- the listener
-
-