public class DirectEditingFeatureForPattern extends AbstractDirectEditingFeature implements ICustomAbortableUndoRedoFeature
TYPE_CUSTOM, TYPE_DROPDOWN, TYPE_DROPDOWN_READ_ONLY, TYPE_MULTILINETEXT, TYPE_NONE, TYPE_TEXT| Constructor and Description |
|---|
DirectEditingFeatureForPattern(IFeatureProvider featureProvider,
IDirectEditing pattern)
Creates a new
DirectEditingFeatureForPattern. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canDirectEdit(IDirectEditingContext context)
Checks if the feature can perform direct editing on the context handed
over.
|
boolean |
canRedo(IContext context)
Decides if the processed feature can be re-done.
|
boolean |
canUndo(IContext context)
Decides if the current feature can be undone - this is the undo of the
execute operation.
|
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.
|
int |
getEditingType()
Framework calls this method to decide which UI to show up.
|
java.lang.String |
getInitialValue(IDirectEditingContext context)
Provides the initial value for the opened text editing UI component.
|
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 |
isAbort()
The Graphiti framework will call this method after
ICustomUndoRedoFeature.preUndo(org.eclipse.graphiti.features.context.IContext)/
ICustomUndoRedoFeature.preRedo(org.eclipse.graphiti.features.context.IContext) have
been called and before the actual undo/redo operation is triggered. |
boolean |
isAutoCompletionEnabled()
Checks if auto completion is enabled.
|
boolean |
isCompletionAvailable()
Checks if completion is available.
|
void |
postRedo(IContext context)
This method will be called by the Graphiti framework after the EMF undo
has finished.
|
void |
postUndo(IContext context)
This method will be called by the Graphiti framework after the EMF undo
is finished.
|
void |
preRedo(IContext context)
This method will be called by the Graphiti framework before the EMF undo
has triggered.
|
void |
preUndo(IContext context)
This method will be called by the Graphiti framework before the EMF undo
is triggered.
|
void |
setValue(java.lang.String value,
IDirectEditingContext context)
Set the new value.
|
boolean |
stretchFieldToFitText()
Stretch input field to fit its contents.
|
canExecute, execute, getName, hasDoneChanges, setValueChangedgetDescription, getFeatureProvider, isAvailable, manageFont, manageFont, setProgressCallback, toStringequals, getClass, hashCode, notify, notifyAll, wait, wait, waitisAvailablegetDescriptiongetFeatureProviderpublic DirectEditingFeatureForPattern(IFeatureProvider featureProvider, IDirectEditing pattern)
DirectEditingFeatureForPattern.featureProvider - the feature providerpattern - the patternpublic boolean canDirectEdit(IDirectEditingContext context)
IDirectEditingcanDirectEdit in interface IDirectEditingcanDirectEdit in class AbstractDirectEditingFeaturecontext - the contextIFeature.canExecute(org.eclipse.graphiti.features.context.IContext)public java.lang.String checkValueValid(java.lang.String value,
IDirectEditingContext context)
IDirectEditingcheckValueValid in interface IDirectEditingcheckValueValid in class AbstractDirectEditingFeaturevalue - the valuecontext - the contextpublic java.lang.String completeValue(java.lang.String value,
int caretPos,
java.lang.String choosenValue,
IDirectEditingContext context)
IDirectEditingcompleteValue in interface IDirectEditingcompleteValue in class AbstractDirectEditingFeaturevalue - current valuecaretPos - current cursor positionchoosenValue - value choosen by usercontext - the contextpublic java.lang.String[] getPossibleValues(IDirectEditingContext context)
IDirectEditinggetPossibleValues in interface IDirectEditinggetPossibleValues in class AbstractDirectEditingFeaturecontext - the contextpublic java.lang.String[] getValueProposals(java.lang.String value,
int caretPos,
IDirectEditingContext context)
IDirectEditinggetValueProposals in interface IDirectEditinggetValueProposals in class AbstractDirectEditingFeaturevalue - current valuecaretPos - current cursor positioncontext - the contextpublic boolean isAutoCompletionEnabled()
IDirectEditingisAutoCompletionEnabled in interface IDirectEditingisAutoCompletionEnabled in class AbstractDirectEditingFeaturepublic boolean isCompletionAvailable()
IDirectEditingisCompletionAvailable in interface IDirectEditingisCompletionAvailable in class AbstractDirectEditingFeaturepublic boolean stretchFieldToFitText()
IDirectEditingstretchFieldToFitText in interface IDirectEditingstretchFieldToFitText in class AbstractDirectEditingFeaturepublic int getEditingType()
IDirectEditinggetEditingType in interface IDirectEditingpublic java.lang.String getInitialValue(IDirectEditingContext context)
IDirectEditinggetInitialValue in interface IDirectEditingcontext - the contextpublic void setValue(java.lang.String value,
IDirectEditingContext context)
IDirectEditingsetValue in interface IDirectEditingsetValue in class AbstractDirectEditingFeaturevalue - the valuecontext - the contextpublic 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 IDirectEditinggetProposalSupport in class AbstractDirectEditingFeaturepublic boolean isAbort()
ICustomAbortableUndoRedoFeatureICustomUndoRedoFeature.preUndo(org.eclipse.graphiti.features.context.IContext)/
ICustomUndoRedoFeature.preRedo(org.eclipse.graphiti.features.context.IContext) have
been called and before the actual undo/redo operation is triggered. In
case this method returns true, the operation will be
cancelled by the Graphiti framework by throwing an
OperationCanceledException that causes am EMF revert of the
operation.
Implementing classes might e.g. set a flag in
ICustomUndoRedoFeature.preUndo(org.eclipse.graphiti.features.context.IContext)/
ICustomUndoRedoFeature.preRedo(org.eclipse.graphiti.features.context.IContext) as
cancellation indication and check that that flag here.
isAbort in interface ICustomAbortableUndoRedoFeaturetrue in case you want to cancel the current
operation, false otherwise.public boolean canUndo(IContext context)
IFeaturecanUndo in interface ICustomUndoRedoFeaturecanUndo in interface IFeaturecanUndo in class AbstractFeaturecontext - this is the general input for this methodIContextpublic void preUndo(IContext context)
ICustomUndoRedoFeatureICustomUndoRedoFeature.postUndo(IContext).preUndo in interface ICustomUndoRedoFeaturecontext - this is the instance of the IContext object that was
in use when executing the featurepublic void postUndo(IContext context)
ICustomUndoRedoFeatureICustomUndoRedoFeature.preUndo(IContext).postUndo in interface ICustomUndoRedoFeaturecontext - this is the instance of the IContext object that was
in use when executing the featurepublic boolean canRedo(IContext context)
ICustomUndoRedoFeatureICustomUndoRedoFeature.preRedo(IContext).
Note that as soon as any feature reports false here, also
all consecutive entries in the command stack are no longer reachable for
redo.
canRedo in interface ICustomUndoRedoFeaturecontext - this is the instance of the IContext object that was
in use when executing the featurepublic void preRedo(IContext context)
ICustomUndoRedoFeatureICustomUndoRedoFeature.postRedo(IContext). (Usually it might be
sufficient to delegate to the execution method of the feature.)preRedo in interface ICustomUndoRedoFeaturecontext - this is the instance of the IContext object that was
in use when executing the featurepublic void postRedo(IContext context)
ICustomUndoRedoFeatureICustomUndoRedoFeature.preRedo(IContext). (Usually it might be
sufficient to delegate to the execution method of the feature.)postRedo in interface ICustomUndoRedoFeaturecontext - this is the instance of the IContext object that was
in use when executing the feature