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 theEditingSupportfor the viewer.org.eclipse.jface.viewers.CellLabelProvidercreateLabelProvider(org.eclipse.jface.viewers.AbstractTableViewer columnViewer)The cell label provider which will be set on the column.voiddispose()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.IObservableValuegetColumnText()The header text for the column.org.eclipse.core.databinding.observable.value.IObservableValuegetColumnTooltip()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.ObjectgetData(java.lang.String key)Get an arbitrary element from the data map.java.util.Set<Feature>getEnabledFeatures()Returns a static array of enabled features.intgetMinWidth()The minimal width of the column.intgetStyleBits()The SWT style bits which will be used to create the column.intgetWeight()The weight of the column.booleanisMoveable()trueif moveable,falseotherwise.booleanisResizeable()trueif resizeable,falseotherwise.Property<java.lang.Object>matchFilter()Set a filter on the current column.voidsetData(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 benullto indicate that there is no editing support
-
-
Method Detail
-
getEnabledFeatures
public java.util.Set<Feature> getEnabledFeatures()
Description copied from interface:ColumnConfigurationReturns a static array of enabled features.- Specified by:
getEnabledFeaturesin interfaceColumnConfiguration- Returns:
- array of enabled features.
-
isResizeable
public boolean isResizeable()
Description copied from interface:ColumnConfigurationtrueif resizeable,falseotherwise.- Specified by:
isResizeablein interfaceColumnConfiguration- Returns:
- whether the column is resizeable
-
isMoveable
public boolean isMoveable()
Description copied from interface:ColumnConfigurationtrueif moveable,falseotherwise.- Specified by:
isMoveablein interfaceColumnConfiguration- Returns:
- whether the column is moveable
-
getStyleBits
public int getStyleBits()
Description copied from interface:ColumnConfigurationThe SWT style bits which will be used to create the column.- Specified by:
getStyleBitsin interfaceColumnConfiguration- Returns:
- the SWT style bits for the column
-
getWeight
public int getWeight()
Description copied from interface:ColumnConfigurationThe weight of the column.- Specified by:
getWeightin interfaceColumnConfiguration- Returns:
- the weight of the column
-
getMinWidth
public int getMinWidth()
Description copied from interface:ColumnConfigurationThe minimal width of the column.- Specified by:
getMinWidthin interfaceColumnConfiguration- Returns:
- the min width of the column in pixels
-
getColumnText
public org.eclipse.core.databinding.observable.value.IObservableValue getColumnText()
Description copied from interface:ColumnConfigurationThe header text for the column.- Specified by:
getColumnTextin interfaceColumnConfiguration- Returns:
- the column header text
-
getColumnTooltip
public org.eclipse.core.databinding.observable.value.IObservableValue getColumnTooltip()
Description copied from interface:ColumnConfigurationThe column header tooltip text.- Specified by:
getColumnTooltipin interfaceColumnConfiguration- Returns:
- the column header tooltip
-
createLabelProvider
public org.eclipse.jface.viewers.CellLabelProvider createLabelProvider(org.eclipse.jface.viewers.AbstractTableViewer columnViewer)
Description copied from interface:ColumnConfigurationThe cell label provider which will be set on the column.- Specified by:
createLabelProviderin 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:ColumnConfigurationCalled to setup theEditingSupportfor the viewer.- Specified by:
createEditingSupportin 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:ColumnConfigurationThe image of the column.- Specified by:
getColumnImagein 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:ColumnConfigurationAdd the contents of the given map to the data map.- Specified by:
setDatain interfaceColumnConfiguration- Parameters:
data- object
-
getData
public java.lang.Object getData(java.lang.String key)
Description copied from interface:ColumnConfigurationGet an arbitrary element from the data map.- Specified by:
getDatain interfaceColumnConfiguration- Parameters:
key- (see constants)- Returns:
- object
-
getData
public java.util.Map<java.lang.String,java.lang.Object> getData()
Description copied from interface:ColumnConfigurationGet the underlying data map.- Specified by:
getDatain 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:ColumnConfigurationGet the list of additional ConfigurationCallbacks.- Specified by:
getConfigurationCallbacksin interfaceColumnConfiguration- Returns:
- list of ConfigurationCallbacks.
-
visible
public Property<java.lang.Boolean> visible()
Description copied from interface:ColumnConfigurationToggle the visible state of the column.- Specified by:
visiblein interfaceColumnConfiguration- Returns:
- visible property
-
showFilterControl
public Property<java.lang.Boolean> showFilterControl()
Description copied from interface:ColumnConfigurationToggle the visible state of the filter control.- Specified by:
showFilterControlin interfaceColumnConfiguration- Returns:
- visible property
-
matchFilter
public Property<java.lang.Object> matchFilter()
Description copied from interface:ColumnConfigurationSet a filter on the current column.- Specified by:
matchFilterin interfaceColumnConfiguration- Returns:
- visible property
-
dispose
public void dispose()
Description copied from interface:ColumnConfigurationDispose this configuration and all its properties.- Specified by:
disposein interfaceColumnConfiguration
-
-