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, toString
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
getEditingType, getInitialValue
canUndo, isAvailable
getDescription
getFeatureProvider
public AbstractDirectEditingFeature(IFeatureProvider fp)
AbstractDirectEditingFeature
.fp
- the fppublic boolean canExecute(IContext context)
IFeature
canExecute
in interface IFeature
context
- this is the general input for this methodIContext
public boolean canDirectEdit(IDirectEditingContext context)
IDirectEditing
canDirectEdit
in interface IDirectEditing
context
- the contextIFeature.canExecute(org.eclipse.graphiti.features.context.IContext)
public void execute(IContext context)
IFeature
public boolean hasDoneChanges()
hasDoneChanges
in interface IFeature
hasDoneChanges
in class AbstractFeature
true
if the feature should appear in the undo stack,
false
otherwisepublic final void setValueChanged()
public java.lang.String[] getPossibleValues(IDirectEditingContext context)
IDirectEditing
getPossibleValues
in interface IDirectEditing
context
- the contextpublic java.lang.String[] getValueProposals(java.lang.String value, int caretPos, IDirectEditingContext context)
IDirectEditing
getValueProposals
in interface IDirectEditing
value
- current valuecaretPos
- current cursor positioncontext
- the contextpublic java.lang.String checkValueValid(java.lang.String value, IDirectEditingContext context)
IDirectEditing
checkValueValid
in interface IDirectEditing
value
- the valuecontext
- the contextpublic java.lang.String completeValue(java.lang.String value, int caretPos, java.lang.String choosenValue, IDirectEditingContext context)
IDirectEditing
completeValue
in interface IDirectEditing
value
- current valuecaretPos
- current cursor positionchoosenValue
- value choosen by usercontext
- the contextpublic boolean stretchFieldToFitText()
IDirectEditing
stretchFieldToFitText
in interface IDirectEditing
public boolean isAutoCompletionEnabled()
IDirectEditing
isAutoCompletionEnabled
in interface IDirectEditing
public boolean isCompletionAvailable()
IDirectEditing
isCompletionAvailable
in interface IDirectEditing
public java.lang.String getName()
IName
getName
in interface IName
getName
in class AbstractFeature
public 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 IDirectEditing
public void setValue(java.lang.String value, IDirectEditingContext context)
IDirectEditing
setValue
in interface IDirectEditing
value
- the valuecontext
- the context