org.eclipse.graphiti.func
Interface IDirectEditing

All Known Subinterfaces:
IDirectEditingFeature
All Known Implementing Classes:
AbstractDirectEditingFeature, DirectEditingFeatureForPattern

public interface IDirectEditing

The Interface IDirectEditing.


Field Summary
static int TYPE_CHECK
          check box is wanted for editing.
static int TYPE_COLOR
          color chooser is wanted for editing.
static int TYPE_DIALOG
          dialog is wanted for editing.
static int TYPE_DROPDOWN
          combo box is wanted for editing.
static int TYPE_DROPDOWN_READ_ONLY
          read only combo box is wanted for editing.
static int TYPE_MULTILINETEXT
          multi line text box is wanted for editing.
static int TYPE_NONE
          no spcial UI is wanted for editing.
static int TYPE_TEXT
          text field is wanted for editing.
 
Method Summary
 boolean canDirectEdit(IDirectEditingContext context)
          Checks if the feature can perform direct editing on the context handed over.
 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 caretPosition, 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.
 java.lang.String[] getValueProposals(java.lang.String value, int caretPosition, IDirectEditingContext context)
          This proposals will be used for the completion list of a simple text cell editor.
 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.
 boolean stretchTextfieldToFitText()
          Stretch textfield to fit text.
 

Field Detail

TYPE_NONE

static final int TYPE_NONE
no spcial UI is wanted for editing.

See Also:
Constant Field Values

TYPE_TEXT

static final int TYPE_TEXT
text field is wanted for editing.

See Also:
Constant Field Values

TYPE_COLOR

static final int TYPE_COLOR
color chooser is wanted for editing.

See Also:
Constant Field Values

TYPE_DROPDOWN

static final int TYPE_DROPDOWN
combo box is wanted for editing.

See Also:
Constant Field Values

TYPE_DROPDOWN_READ_ONLY

static final int TYPE_DROPDOWN_READ_ONLY
read only combo box is wanted for editing.

See Also:
Constant Field Values

TYPE_CHECK

static final int TYPE_CHECK
check box is wanted for editing.

See Also:
Constant Field Values

TYPE_MULTILINETEXT

static final int TYPE_MULTILINETEXT
multi line text box is wanted for editing.

See Also:
Constant Field Values

TYPE_DIALOG

static final int TYPE_DIALOG
dialog is wanted for editing.

See Also:
Constant Field Values
Method Detail

getEditingType

int getEditingType()
Framework calls this method to decide which UI to show up.

Returns:
the editing type

canDirectEdit

boolean canDirectEdit(IDirectEditingContext context)
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:
IDirecEditingFeature.canExecute()

getInitialValue

java.lang.String getInitialValue(IDirectEditingContext context)
Provides the initial value for the opened text editing UI component.

Parameters:
context - the context
Returns:
the initial value

getPossibleValues

java.lang.String[] getPossibleValues(IDirectEditingContext context)
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

java.lang.String[] getValueProposals(java.lang.String value,
                                     int caretPosition,
                                     IDirectEditingContext context)
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 value
caretPosition - current cursor position
context - the context
Returns:
the proposed values

completeValue

java.lang.String completeValue(java.lang.String value,
                               int caretPosition,
                               java.lang.String choosenValue,
                               IDirectEditingContext context)
Framework calls this method to let the feature calculate the new value.

Parameters:
value - current value
caretPosition - current cursor position
choosenValue - value choosen by user
context - 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

stretchTextfieldToFitText

boolean stretchTextfieldToFitText()
Stretch textfield to fit text. This functionality only applies to TYPE_TEXT.

Returns:
true if the text field should exactly fit the inserted text

checkValueValid

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.

Parameters:
value - the value
context - 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

void setValue(java.lang.String value,
              IDirectEditingContext context)
Set the new value. The value comes from the text editing UI component.

Parameters:
value - the value
context - the context


Copyright (c) SAP AG 2005, 2010.