Package org.eclipse.graphiti.func
Interface IDirectEditing
- All Known Subinterfaces:
IDirectEditingFeature
,IPattern
- All Known Implementing Classes:
AbstractDirectEditingFeature
,AbstractPattern
,DirectEditingFeatureForPattern
,IdPattern
,TypedPattern
public interface IDirectEditing
The Interface IDirectEditing.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
With this type the customers can provide their own cell editors for the direct editing mode.static final int
combo box is wanted for editing.static final int
read only combo box is wanted for editing.static final int
multi line text box is wanted for editing.static final int
no special UI is wanted for editing.static final int
text field is wanted for editing. -
Method Summary
Modifier and TypeMethodDescriptionboolean
canDirectEdit
(IDirectEditingContext context) Checks if the feature can perform direct editing on the context handed over.checkValueValid
(String value, IDirectEditingContext context) This method will be called by clients many times to see if current value is valid and could be set.completeValue
(String value, int caretPosition, String choosenValue, IDirectEditingContext context) Framework calls this method to let the feature calculate the new value.int
Framework calls this method to decide which UI to show up.getInitialValue
(IDirectEditingContext context) Provides the initial value for the opened text editing UI component.String[]
getPossibleValues
(IDirectEditingContext context) This value will be used if the cell editor is a combo box.The direct editing mode contains controls for code completion and the selection from a combo box.String[]
getValueProposals
(String value, int caretPosition, IDirectEditingContext context) This proposals will be used for the completion list of a simple text cell editor.boolean
Checks if auto completion is enabled.boolean
Checks if completion is available.void
setValue
(String value, IDirectEditingContext context) Set the new value.boolean
Stretch input field to fit its contents.
-
Field Details
-
TYPE_NONE
static final int TYPE_NONEno special UI is wanted for editing.- See Also:
-
TYPE_TEXT
static final int TYPE_TEXTtext field is wanted for editing.- See Also:
-
TYPE_MULTILINETEXT
static final int TYPE_MULTILINETEXTmulti line text box is wanted for editing.- See Also:
-
TYPE_DROPDOWN
static final int TYPE_DROPDOWNcombo box is wanted for editing.- See Also:
-
TYPE_DROPDOWN_READ_ONLY
static final int TYPE_DROPDOWN_READ_ONLYread only combo box is wanted for editing.- See Also:
-
TYPE_CUSTOM
static final int TYPE_CUSTOMWith this type the customers can provide their own cell editors for the direct editing mode. In this case the direct editing feature must implement the interfaceorg.eclipse.graphiti.ui.platform.ICellEditorProvider
- Since:
- 0.9
- See Also:
-
-
Method Details
-
getEditingType
int getEditingType()Framework calls this method to decide which UI to show up.- Returns:
- the editing type
-
canDirectEdit
Checks if the feature can perform direct editing on the context handed over.- Parameters:
context
- the context- Returns:
- This method is equivalent to
- See Also:
-
getInitialValue
Provides the initial value for the opened text editing UI component.- Parameters:
context
- the context- Returns:
- the initial value
-
getPossibleValues
This value will be used if the cell editor is a combo box. This functionality only applies to TYPE_DROPDOWN.- Parameters:
context
- the context- Returns:
- the possible values for the combo box.
-
getValueProposals
This proposals will be used for the completion list of a simple text cell editor. This functionality only applies to TYPE_TEXT.- Parameters:
value
- current valuecaretPosition
- current cursor positioncontext
- the context- Returns:
- the proposed values
-
completeValue
String completeValue(String value, int caretPosition, String choosenValue, IDirectEditingContext context) Framework calls this method to let the feature calculate the new value.- Parameters:
value
- current valuecaretPosition
- current cursor positionchoosenValue
- value choosen by usercontext
- the context- Returns:
- the new value
-
isCompletionAvailable
boolean isCompletionAvailable()Checks if completion is available. This functionality only applies to TYPE_TEXT.- Returns:
- true if completion is / proposals are available at all
-
isAutoCompletionEnabled
boolean isAutoCompletionEnabled()Checks if auto completion is enabled. This functionality only applies to TYPE_TEXT.- Returns:
- true, if proposals should appear automatically
-
stretchFieldToFitText
boolean stretchFieldToFitText()Stretch input field to fit its contents. This functionality applies to TYPE_TEXT, TYPE_DROPDOWN and TYPE_DROPDOWN_READ_ONLY.- Returns:
- true if the field should exactly fit the contents
-
checkValueValid
This method will be called by clients many times to see if current value is valid and could be set.- Parameters:
value
- the valuecontext
- the context- Returns:
- null if value is okay and could be set; any text means value is not valid; text is reason for invalidality
-
setValue
Set the new value. The value comes from the text editing UI component.- Parameters:
value
- the valuecontext
- the context
-
getProposalSupport
IProposalSupport getProposalSupport()The direct editing mode contains controls for code completion and the selection from a combo box. In both cases the standard implementation supports only strings.If the customer wants to work with Objects he must provide an implementation of
IProposalSupport
. In this case the following methods ofIDirectEditing
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);- Returns:
- the special implementation to support Objects in code completion and combo box
- Since:
- 0.8
-