Class MultiStringCellEditor
- java.lang.Object
-
- org.eclipse.jface.viewers.CellEditor
-
- org.eclipse.jface.viewers.TextCellEditor
-
- org.eclipse.emf.ecp.edit.spi.swt.table.StringBasedCellEditor
-
- org.eclipse.emf.ecp.edit.spi.swt.table.MultiStringCellEditor
-
- All Implemented Interfaces:
ECPCellEditor
public class MultiStringCellEditor extends StringBasedCellEditor
A cell Editor to display List of Strings in a cell editor. it allows to enter a list of string using a separator (by default ";").- Since:
- 1.14
- Author:
- Jonas Helming
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
MultiStringCellEditor.TargetToModelStrategy
-
Field Summary
-
Fields inherited from class org.eclipse.jface.viewers.CellEditor
COPY, CUT, DELETE, FIND, PASTE, REDO, SELECT_ALL, UNDO
-
Fields inherited from interface org.eclipse.emf.ecp.edit.spi.swt.table.ECPCellEditor
COPY_STRING_ALTERNATIVE, CUSTOM_VARIANT
-
-
Constructor Summary
Constructors Constructor Description MultiStringCellEditor(org.eclipse.swt.widgets.Composite parent)
The constructor which only takes a parent composite.MultiStringCellEditor(org.eclipse.swt.widgets.Composite parent, int style)
A constructor which takes a parent and the style to use, the style is ignored by this cell editor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.List<java.lang.String>
convertStringToList(java.lang.String value)
Convertes a String into a list of Strings using the separator.int
getColumnWidthWeight()
The returned value is used for layouting the table columns.java.lang.String
getFormatedString(java.lang.Object value)
This returns the String which will be shown in the table when no cell editor is open.org.eclipse.swt.graphics.Image
getImage(java.lang.Object value)
This returns the Image which will be shown in the table when no cell editor is open.int
getMinWidth()
Returns the minimum width of the cell editor.org.eclipse.core.databinding.UpdateValueStrategy
getModelToTargetStrategy(org.eclipse.core.databinding.DataBindingContext databindingContext)
ThisUpdateValueStrategy
will be used as the model to target strategy during data binding.protected java.lang.String
getSeparator()
Returns the separator used to split the input string into entries of the String list.org.eclipse.core.databinding.UpdateValueStrategy
getTargetToModelStrategy(org.eclipse.core.databinding.DataBindingContext databindingContext)
ThisUpdateValueStrategy
will be used as the target to model strategy during data binding.protected org.eclipse.swt.widgets.Text
getText()
returns theText
of the cell editor.org.eclipse.core.databinding.property.value.IValueProperty
getValueProperty()
Returns theIValueProperty
for this cell editor which is used by the table to create anIObservableValue
.void
instantiate(org.eclipse.emf.ecore.EStructuralFeature eStructuralFeature, ViewModelContext viewModelContext)
Instantiates this cell editor.void
setEditable(boolean editable)
Sets editable state of the cell editor.-
Methods inherited from class org.eclipse.emf.ecp.edit.spi.swt.table.StringBasedCellEditor
activate, doSetFocus, fireCancelEditor, isPrintable, withPreSetValidation
-
Methods inherited from class org.eclipse.jface.viewers.TextCellEditor
createControl, dependsOnExternalFocusListener, doGetValue, doSetValue, editOccured, getLayoutData, handleDefaultSelection, isCopyEnabled, isCutEnabled, isDeleteEnabled, isPasteEnabled, isSaveAllEnabled, isSelectAllEnabled, keyReleaseOccured, performCopy, performCut, performDelete, performPaste, performSelectAll
-
Methods inherited from class org.eclipse.jface.viewers.CellEditor
activate, addListener, addPropertyChangeListener, create, deactivate, deactivate, dispose, fireApplyEditorValue, fireEditorValueChanged, fireEnablementChanged, focusLost, getControl, getDoubleClickTimeout, getErrorMessage, getStyle, getValidator, getValue, isActivated, isCorrect, isDirty, isFindEnabled, isRedoEnabled, isUndoEnabled, isValueValid, markDirty, performFind, performRedo, performUndo, removeListener, removePropertyChangeListener, setErrorMessage, setFocus, setStyle, setValidator, setValue, setValueValid, valueChanged
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.emf.ecp.edit.spi.swt.table.ECPCellEditor
getStyle
-
-
-
-
Constructor Detail
-
MultiStringCellEditor
public MultiStringCellEditor(org.eclipse.swt.widgets.Composite parent)
The constructor which only takes a parent composite.- Parameters:
parent
- theComposite
to use as a parent.
-
MultiStringCellEditor
public MultiStringCellEditor(org.eclipse.swt.widgets.Composite parent, int style)
A constructor which takes a parent and the style to use, the style is ignored by this cell editor.- Parameters:
parent
- theComposite
to use as a parentstyle
- the SWT style to set
-
-
Method Detail
-
convertStringToList
protected java.util.List<java.lang.String> convertStringToList(java.lang.String value)
Convertes a String into a list of Strings using the separator.- Parameters:
value
- the String to split- Returns:
- the list of sub string
-
getSeparator
protected java.lang.String getSeparator()
Returns the separator used to split the input string into entries of the String list.- Returns:
- the separator as a String
-
getValueProperty
public org.eclipse.core.databinding.property.value.IValueProperty getValueProperty()
Description copied from interface:ECPCellEditor
Returns theIValueProperty
for this cell editor which is used by the table to create anIObservableValue
.- Returns:
- the
IValueProperty
for this cell editor
-
instantiate
public void instantiate(org.eclipse.emf.ecore.EStructuralFeature eStructuralFeature, ViewModelContext viewModelContext)
Description copied from interface:ECPCellEditor
Instantiates this cell editor. This allows the cell editor to useViewModelServices
.- Specified by:
instantiate
in interfaceECPCellEditor
- Overrides:
instantiate
in classStringBasedCellEditor
- Parameters:
eStructuralFeature
- theEStructuralFeature
displayed in this cell editorviewModelContext
- theViewModelContext
used for the current view
-
getFormatedString
public java.lang.String getFormatedString(java.lang.Object value)
Description copied from interface:ECPCellEditor
This returns the String which will be shown in the table when no cell editor is open.- Parameters:
value
- the Object to get the formated String for- Returns:
- the formated String
-
getColumnWidthWeight
public int getColumnWidthWeight()
Description copied from interface:ECPCellEditor
The returned value is used for layouting the table columns. The value is a relative column weight. A column containing text has a weight of 100. Please consider this when defining you weight. E.g if you return 200 your column will be twice the width of a text column.- Returns:
- the relative column width
-
getTargetToModelStrategy
public org.eclipse.core.databinding.UpdateValueStrategy getTargetToModelStrategy(org.eclipse.core.databinding.DataBindingContext databindingContext)
Description copied from interface:ECPCellEditor
ThisUpdateValueStrategy
will be used as the target to model strategy during data binding.- Parameters:
databindingContext
- TheDataBindingContext
used by this strategy- Returns:
- the strategy
-
getModelToTargetStrategy
public org.eclipse.core.databinding.UpdateValueStrategy getModelToTargetStrategy(org.eclipse.core.databinding.DataBindingContext databindingContext)
Description copied from interface:ECPCellEditor
ThisUpdateValueStrategy
will be used as the model to target strategy during data binding.- Parameters:
databindingContext
- TheDataBindingContext
used by this strategy- Returns:
- the strategy
-
getText
protected org.eclipse.swt.widgets.Text getText()
returns theText
of the cell editor.- Returns:
- a
Text
-
setEditable
public void setEditable(boolean editable)
Description copied from interface:ECPCellEditor
Sets editable state of the cell editor.- Parameters:
editable
-true
if editable,false
otherwise
-
getImage
public org.eclipse.swt.graphics.Image getImage(java.lang.Object value)
Description copied from interface:ECPCellEditor
This returns the Image which will be shown in the table when no cell editor is open.- Parameters:
value
- the Object to get the Image for- Returns:
- the image
-
getMinWidth
public int getMinWidth()
Description copied from interface:ECPCellEditor
Returns the minimum width of the cell editor.- Returns:
- the minimum width
-
-