Class ColumnConfigurationImpl
- java.lang.Object
-
- org.eclipse.emfforms.spi.swt.table.ColumnConfigurationImpl
-
- All Implemented Interfaces:
ColumnConfiguration
public final class ColumnConfigurationImpl extends java.lang.Object implements ColumnConfiguration
Implementation of theColumnConfiguration
.- Author:
- Johannes Faltermeier, Mat Hansen
-
-
Field Summary
-
Fields inherited from interface org.eclipse.emfforms.spi.swt.table.ColumnConfiguration
ALL_FEATURES, COLUMN_ID, DMR, FEATURE_COLUMN_FILTER, FEATURE_COLUMN_HIDE_SHOW, FEATURE_COLUMN_REGEX_FILTER, FEATURES, ID, MIN_WIDTH, NO_WEIGHT, RESIZABLE, WEIGHT
-
-
Constructor Summary
Constructors Constructor Description ColumnConfigurationImpl(java.util.Set<Feature> enabledFeatures, boolean resizeable, boolean moveable, int styleBits, int weight, int minWidth, org.eclipse.core.databinding.observable.value.IObservableValue columnText, org.eclipse.core.databinding.observable.value.IObservableValue tooltipText, CellLabelProviderFactory labelProviderFactory, EditingSupportCreator editingSupport, org.eclipse.swt.graphics.Image image, java.util.Map<java.lang.String,java.lang.Object> data, java.util.List<ConfigurationCallback<org.eclipse.jface.viewers.AbstractTableViewer,org.eclipse.jface.viewers.ViewerColumn>> configurationCallbacks)
Constructs a newColumnConfiguration
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<org.eclipse.jface.viewers.EditingSupport>
createEditingSupport(org.eclipse.jface.viewers.AbstractTableViewer columnViewer)
Called to setup theEditingSupport
for the viewer.org.eclipse.jface.viewers.CellLabelProvider
createLabelProvider(org.eclipse.jface.viewers.AbstractTableViewer columnViewer)
The cell label provider which will be set on the column.void
dispose()
Dispose this configuration and all its properties.Optional<org.eclipse.swt.graphics.Image>
getColumnImage()
The image of the column.org.eclipse.core.databinding.observable.value.IObservableValue
getColumnText()
The header text for the column.org.eclipse.core.databinding.observable.value.IObservableValue
getColumnTooltip()
The column header tooltip text.java.util.List<ConfigurationCallback<org.eclipse.jface.viewers.AbstractTableViewer,org.eclipse.jface.viewers.ViewerColumn>>
getConfigurationCallbacks()
Get the list of additional ConfigurationCallbacks.java.util.Map<java.lang.String,java.lang.Object>
getData()
Get the underlying data map.java.lang.Object
getData(java.lang.String key)
Get an arbitrary element from the data map.java.util.Set<Feature>
getEnabledFeatures()
Returns a static array of enabled features.int
getMinWidth()
The minimal width of the column.int
getStyleBits()
The SWT style bits which will be used to create the column.int
getWeight()
The weight of the column.boolean
isMoveable()
true
if moveable,false
otherwise.boolean
isResizeable()
true
if resizeable,false
otherwise.Property<java.lang.Object>
matchFilter()
Set a filter on the current column.void
setData(java.util.Map<java.lang.String,java.lang.Object> data)
Add the contents of the given map to the data map.Property<java.lang.Boolean>
showFilterControl()
Toggle the visible state of the filter control.Property<java.lang.Boolean>
visible()
Toggle the visible state of the column.
-
-
-
Constructor Detail
-
ColumnConfigurationImpl
public ColumnConfigurationImpl(java.util.Set<Feature> enabledFeatures, boolean resizeable, boolean moveable, int styleBits, int weight, int minWidth, org.eclipse.core.databinding.observable.value.IObservableValue columnText, org.eclipse.core.databinding.observable.value.IObservableValue tooltipText, CellLabelProviderFactory labelProviderFactory, EditingSupportCreator editingSupport, org.eclipse.swt.graphics.Image image, java.util.Map<java.lang.String,java.lang.Object> data, java.util.List<ConfigurationCallback<org.eclipse.jface.viewers.AbstractTableViewer,org.eclipse.jface.viewers.ViewerColumn>> configurationCallbacks)
Constructs a newColumnConfiguration
.- Parameters:
enabledFeatures
- list of enabled featuresresizeable
- resizeablemoveable
- moveablestyleBits
- styleBitsweight
- weightminWidth
- minWidthcolumnText
- columnTexttooltipText
- tooltipTextlabelProviderFactory
- labelProvidereditingSupport
- editingSupport. May benull
to indicate that there is no editing support
-
-
Method Detail
-
getEnabledFeatures
public java.util.Set<Feature> getEnabledFeatures()
Description copied from interface:ColumnConfiguration
Returns a static array of enabled features.- Specified by:
getEnabledFeatures
in interfaceColumnConfiguration
- Returns:
- array of enabled features.
-
isResizeable
public boolean isResizeable()
Description copied from interface:ColumnConfiguration
true
if resizeable,false
otherwise.- Specified by:
isResizeable
in interfaceColumnConfiguration
- Returns:
- whether the column is resizeable
-
isMoveable
public boolean isMoveable()
Description copied from interface:ColumnConfiguration
true
if moveable,false
otherwise.- Specified by:
isMoveable
in interfaceColumnConfiguration
- Returns:
- whether the column is moveable
-
getStyleBits
public int getStyleBits()
Description copied from interface:ColumnConfiguration
The SWT style bits which will be used to create the column.- Specified by:
getStyleBits
in interfaceColumnConfiguration
- Returns:
- the SWT style bits for the column
-
getWeight
public int getWeight()
Description copied from interface:ColumnConfiguration
The weight of the column.- Specified by:
getWeight
in interfaceColumnConfiguration
- Returns:
- the weight of the column
-
getMinWidth
public int getMinWidth()
Description copied from interface:ColumnConfiguration
The minimal width of the column.- Specified by:
getMinWidth
in interfaceColumnConfiguration
- Returns:
- the min width of the column in pixels
-
getColumnText
public org.eclipse.core.databinding.observable.value.IObservableValue getColumnText()
Description copied from interface:ColumnConfiguration
The header text for the column.- Specified by:
getColumnText
in interfaceColumnConfiguration
- Returns:
- the column header text
-
getColumnTooltip
public org.eclipse.core.databinding.observable.value.IObservableValue getColumnTooltip()
Description copied from interface:ColumnConfiguration
The column header tooltip text.- Specified by:
getColumnTooltip
in interfaceColumnConfiguration
- Returns:
- the column header tooltip
-
createLabelProvider
public org.eclipse.jface.viewers.CellLabelProvider createLabelProvider(org.eclipse.jface.viewers.AbstractTableViewer columnViewer)
Description copied from interface:ColumnConfiguration
The cell label provider which will be set on the column.- Specified by:
createLabelProvider
in interfaceColumnConfiguration
- Parameters:
columnViewer
- the column viewer- Returns:
- the label provider
-
createEditingSupport
public Optional<org.eclipse.jface.viewers.EditingSupport> createEditingSupport(org.eclipse.jface.viewers.AbstractTableViewer columnViewer)
Description copied from interface:ColumnConfiguration
Called to setup theEditingSupport
for the viewer.- Specified by:
createEditingSupport
in interfaceColumnConfiguration
- Parameters:
columnViewer
- theAbstractTableViewer
- Returns:
- the editing support for the column, if present
-
getColumnImage
public Optional<org.eclipse.swt.graphics.Image> getColumnImage()
Description copied from interface:ColumnConfiguration
The image of the column.- Specified by:
getColumnImage
in interfaceColumnConfiguration
- Returns:
- the column image, if present
-
setData
public void setData(java.util.Map<java.lang.String,java.lang.Object> data)
Description copied from interface:ColumnConfiguration
Add the contents of the given map to the data map.- Specified by:
setData
in interfaceColumnConfiguration
- Parameters:
data
- object
-
getData
public java.lang.Object getData(java.lang.String key)
Description copied from interface:ColumnConfiguration
Get an arbitrary element from the data map.- Specified by:
getData
in interfaceColumnConfiguration
- Parameters:
key
- (see constants)- Returns:
- object
-
getData
public java.util.Map<java.lang.String,java.lang.Object> getData()
Description copied from interface:ColumnConfiguration
Get the underlying data map.- Specified by:
getData
in interfaceColumnConfiguration
- Returns:
- data map object
-
getConfigurationCallbacks
public java.util.List<ConfigurationCallback<org.eclipse.jface.viewers.AbstractTableViewer,org.eclipse.jface.viewers.ViewerColumn>> getConfigurationCallbacks()
Description copied from interface:ColumnConfiguration
Get the list of additional ConfigurationCallbacks.- Specified by:
getConfigurationCallbacks
in interfaceColumnConfiguration
- Returns:
- list of ConfigurationCallbacks.
-
visible
public Property<java.lang.Boolean> visible()
Description copied from interface:ColumnConfiguration
Toggle the visible state of the column.- Specified by:
visible
in interfaceColumnConfiguration
- Returns:
- visible property
-
showFilterControl
public Property<java.lang.Boolean> showFilterControl()
Description copied from interface:ColumnConfiguration
Toggle the visible state of the filter control.- Specified by:
showFilterControl
in interfaceColumnConfiguration
- Returns:
- visible property
-
matchFilter
public Property<java.lang.Object> matchFilter()
Description copied from interface:ColumnConfiguration
Set a filter on the current column.- Specified by:
matchFilter
in interfaceColumnConfiguration
- Returns:
- visible property
-
dispose
public void dispose()
Description copied from interface:ColumnConfiguration
Dispose this configuration and all its properties.- Specified by:
dispose
in interfaceColumnConfiguration
-
-