public class ItemProviderEnumCellEditor extends ECPEnumCellEditor
ECPCellEditor
which is
applicable for all EAttributes
with a Single EEnum
data type.
This cell editor uses the EMF.Edit item provider to determine
the model's proper choice of values for an EEnum
attribute. Additionally, it filters out enum literals with
are marked as isInputtable=false
with a custom annotation.COPY, CUT, DELETE, FIND, PASTE, REDO, SELECT_ALL, UNDO
COPY_STRING_ALTERNATIVE, CUSTOM_VARIANT
Constructor and Description |
---|
ItemProviderEnumCellEditor(org.eclipse.swt.widgets.Composite parent)
Initializes me with my parent.
|
ItemProviderEnumCellEditor(org.eclipse.swt.widgets.Composite parent,
int style)
Initializes me with my parent and style.
|
ItemProviderEnumCellEditor(org.eclipse.swt.widgets.Composite parent,
int style,
BundleResolver bundleResolver,
EMFFormsLocalizationService l10n)
Initializes me with my parent, style, and custom
BundleResolver and EMFFormsLocalizationService . |
Modifier and Type | Method and Description |
---|---|
void |
activate(org.eclipse.jface.viewers.ColumnViewerEditorActivationEvent actEvent) |
protected org.eclipse.swt.widgets.Control |
createControl(org.eclipse.swt.widgets.Composite parent) |
void |
deactivate() |
protected Object |
doGetValue() |
protected void |
doSetFocus() |
protected void |
doSetValue(Object value) |
protected List<?> |
getChoiceOfValues()
Gets the proper choice of values provided by the item-provider
of the source object of our data binding for the attribute that
is bound.
|
int |
getColumnWidthWeight()
The returned value is used for layouting the table columns.
|
org.eclipse.emf.ecore.EEnum |
getEEnum()
Returns the
EEnum is cell editor responsible for. |
String |
getFormatedString(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(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)
This
UpdateValueStrategy will be used as the model to target strategy during data binding. |
protected Optional<org.eclipse.emf.edit.provider.IItemPropertyDescriptor> |
getPropertyDescriptor() |
protected Optional<org.eclipse.emf.ecore.EObject> |
getSource() |
org.eclipse.core.databinding.UpdateValueStrategy |
getTargetToModelStrategy(org.eclipse.core.databinding.DataBindingContext databindingContext)
This
UpdateValueStrategy will be used as the target to model strategy during data binding. |
org.eclipse.core.databinding.property.value.IValueProperty |
getValueProperty()
Returns the
IValueProperty for this cell editor which is used by the table to create an
IObservableValue . |
void |
instantiate(org.eclipse.emf.ecore.EStructuralFeature feature,
ViewModelContext viewModelContext)
Instantiates this cell editor.
|
void |
setEditable(boolean editable)
Sets editable state of the cell editor.
|
getELiterals
activate, addListener, addPropertyChangeListener, create, deactivate, dependsOnExternalFocusListener, dispose, fireApplyEditorValue, fireCancelEditor, fireEditorValueChanged, fireEnablementChanged, focusLost, getControl, getDoubleClickTimeout, getErrorMessage, getLayoutData, getStyle, getValidator, getValue, isActivated, isCopyEnabled, isCorrect, isCutEnabled, isDeleteEnabled, isDirty, isFindEnabled, isPasteEnabled, isRedoEnabled, isSelectAllEnabled, isUndoEnabled, isValueValid, keyReleaseOccured, markDirty, performCopy, performCut, performDelete, performFind, performPaste, performRedo, performSelectAll, performUndo, removeListener, removePropertyChangeListener, setErrorMessage, setFocus, setStyle, setValidator, setValue, setValueValid, valueChanged
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getStyle
public ItemProviderEnumCellEditor(org.eclipse.swt.widgets.Composite parent)
parent
- my parent compositepublic ItemProviderEnumCellEditor(org.eclipse.swt.widgets.Composite parent, int style)
parent
- my parent compositestyle
- my style bitspublic ItemProviderEnumCellEditor(org.eclipse.swt.widgets.Composite parent, int style, BundleResolver bundleResolver, EMFFormsLocalizationService l10n)
BundleResolver
and EMFFormsLocalizationService
.parent
- my parent compositestyle
- my style bitsbundleResolver
- custom BundleResolver
l10n
- custom EMFFormsLocalizationService
public org.eclipse.core.databinding.UpdateValueStrategy getModelToTargetStrategy(org.eclipse.core.databinding.DataBindingContext databindingContext)
ECPCellEditor
UpdateValueStrategy
will be used as the model to target strategy during data binding.databindingContext
- The DataBindingContext
used by this strategypublic org.eclipse.core.databinding.UpdateValueStrategy getTargetToModelStrategy(org.eclipse.core.databinding.DataBindingContext databindingContext)
ECPCellEditor
UpdateValueStrategy
will be used as the target to model strategy during data binding.databindingContext
- The DataBindingContext
used by this strategyprotected org.eclipse.swt.widgets.Control createControl(org.eclipse.swt.widgets.Composite parent)
createControl
in class org.eclipse.jface.viewers.CellEditor
protected List<?> getChoiceOfValues()
null
public String getFormatedString(Object value)
ECPCellEditor
value
- the Object to get the formated String forpublic void instantiate(org.eclipse.emf.ecore.EStructuralFeature feature, ViewModelContext viewModelContext)
ECPCellEditor
ViewModelServices
.feature
- the EStructuralFeature
displayed in this cell editorviewModelContext
- the ViewModelContext
used for the current viewpublic org.eclipse.core.databinding.property.value.IValueProperty getValueProperty()
ECPCellEditor
IValueProperty
for this cell editor which is used by the table to create an
IObservableValue
.IValueProperty
for this cell editorpublic void activate(org.eclipse.jface.viewers.ColumnViewerEditorActivationEvent actEvent)
activate
in class org.eclipse.jface.viewers.CellEditor
public void deactivate()
deactivate
in class org.eclipse.jface.viewers.CellEditor
public int getColumnWidthWeight()
ECPCellEditor
public int getMinWidth()
ECPCellEditor
public org.eclipse.emf.ecore.EEnum getEEnum()
ECPEnumCellEditor
EEnum
is cell editor responsible for.getEEnum
in class ECPEnumCellEditor
public org.eclipse.swt.graphics.Image getImage(Object value)
ECPCellEditor
value
- the Object to get the Image forpublic void setEditable(boolean editable)
ECPCellEditor
editable
- true
if editable, false
otherwiseprotected Optional<org.eclipse.emf.ecore.EObject> getSource()
protected Optional<org.eclipse.emf.edit.provider.IItemPropertyDescriptor> getPropertyDescriptor()
IItemPropertyDescriptor
descriptor of the current source if it is availableprotected Object doGetValue()
doGetValue
in class org.eclipse.jface.viewers.CellEditor
protected void doSetValue(Object value)
doSetValue
in class org.eclipse.jface.viewers.CellEditor
protected void doSetFocus()
doSetFocus
in class org.eclipse.jface.viewers.CellEditor
Copyright © 2019. All rights reserved.