public abstract class AbstractDirectEditingFeature extends AbstractFeature implements IDirectEditingFeature
TYPE_CUSTOM, TYPE_DROPDOWN, TYPE_DROPDOWN_READ_ONLY, TYPE_MULTILINETEXT, TYPE_NONE, TYPE_TEXT| Constructor and Description |
|---|
AbstractDirectEditingFeature(IFeatureProvider fp)
Creates a new
AbstractDirectEditingFeature. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canDirectEdit(IDirectEditingContext context)
Checks if the feature can perform direct editing on the context handed
over.
|
boolean |
canExecute(IContext context)
Decides if the current feature can execute with the given context.
|
java.lang.String |
checkValueValid(java.lang.String value,
IDirectEditingContext context)
This method will be called by clients many times to see if current value
is valid and could be set.
|
java.lang.String |
completeValue(java.lang.String value,
int caretPos,
java.lang.String choosenValue,
IDirectEditingContext context)
Framework calls this method to let the feature calculate the new value.
|
void |
execute(IContext context)
Executes the current feature with the given context.
|
java.lang.String |
getName()
Gets the name.
|
java.lang.String[] |
getPossibleValues(IDirectEditingContext context)
This value will be used if the cell editor is a combo box.
|
IProposalSupport |
getProposalSupport()
The direct editing mode contains controls for code completion and the
selection from a combo box.
|
java.lang.String[] |
getValueProposals(java.lang.String value,
int caretPos,
IDirectEditingContext context)
This proposals will be used for the completion list of a simple text cell
editor.
|
boolean |
hasDoneChanges()
Returns true only if the direct editing feature really has changed
anything.
|
boolean |
isAutoCompletionEnabled()
Checks if auto completion is enabled.
|
boolean |
isCompletionAvailable()
Checks if completion is available.
|
void |
setValue(java.lang.String value,
IDirectEditingContext context)
Set the new value.
|
void |
setValueChanged()
Called by the framework (@see DirectEditingFeatureCommandWithContext) to
indicate that this direct editing feature execution has really changed
something.
|
boolean |
stretchFieldToFitText()
Stretch input field to fit its contents.
|
canUndo, getDescription, getFeatureProvider, isAvailable, manageFont, manageFont, setProgressCallback, toStringequals, getClass, hashCode, notify, notifyAll, wait, wait, waitgetEditingType, getInitialValuecanUndo, isAvailablegetDescriptiongetFeatureProviderpublic AbstractDirectEditingFeature(IFeatureProvider fp)
AbstractDirectEditingFeature.fp - the fppublic boolean canExecute(IContext context)
IFeaturecanExecute in interface IFeaturecontext - this is the general input for this methodIContextpublic boolean canDirectEdit(IDirectEditingContext context)
IDirectEditingcanDirectEdit in interface IDirectEditingcontext - the contextIFeature.canExecute(org.eclipse.graphiti.features.context.IContext)public void execute(IContext context)
IFeaturepublic boolean hasDoneChanges()
hasDoneChanges in interface IFeaturehasDoneChanges in class AbstractFeaturetrue if the feature should appear in the undo stack,
false otherwisepublic final void setValueChanged()
public java.lang.String[] getPossibleValues(IDirectEditingContext context)
IDirectEditinggetPossibleValues in interface IDirectEditingcontext - the contextpublic java.lang.String[] getValueProposals(java.lang.String value,
int caretPos,
IDirectEditingContext context)
IDirectEditinggetValueProposals in interface IDirectEditingvalue - current valuecaretPos - current cursor positioncontext - the contextpublic java.lang.String checkValueValid(java.lang.String value,
IDirectEditingContext context)
IDirectEditingcheckValueValid in interface IDirectEditingvalue - the valuecontext - the contextpublic java.lang.String completeValue(java.lang.String value,
int caretPos,
java.lang.String choosenValue,
IDirectEditingContext context)
IDirectEditingcompleteValue in interface IDirectEditingvalue - current valuecaretPos - current cursor positionchoosenValue - value choosen by usercontext - the contextpublic boolean stretchFieldToFitText()
IDirectEditingstretchFieldToFitText in interface IDirectEditingpublic boolean isAutoCompletionEnabled()
IDirectEditingisAutoCompletionEnabled in interface IDirectEditingpublic boolean isCompletionAvailable()
IDirectEditingisCompletionAvailable in interface IDirectEditingpublic java.lang.String getName()
INamegetName in interface INamegetName in class AbstractFeaturepublic IProposalSupport getProposalSupport()
IDirectEditing
If the customer wants to work with Objects he must provide an
implementation of IProposalSupport. In this case the following
methods of IDirectEditing are ignored:
* String checkValueValid(String value, IDirectEditingContext context);
* String completeValue(String value, int caretPosition, String choosenValue, IDirectEditingContext context);
* String[] getPossibleValues(IDirectEditingContext context);
* String[] getValueProposals(String value, int caretPosition, IDirectEditingContext context);
* void setValue(String value, IDirectEditingContext context);
getProposalSupport in interface IDirectEditingpublic void setValue(java.lang.String value,
IDirectEditingContext context)
IDirectEditingsetValue in interface IDirectEditingvalue - the valuecontext - the context