org.eclipse.graphiti.func
Class AbstractProposalSupport

java.lang.Object
  extended by org.eclipse.graphiti.func.AbstractProposalSupport
All Implemented Interfaces:
IProposalSupport

public class AbstractProposalSupport
extends Object
implements IProposalSupport

Since:
0.8

Field Summary
protected static IProposal[] EMPTY_PROPOSAL_ARRAY
           
 
Constructor Summary
AbstractProposalSupport()
           
 
Method Summary
 String checkValueValid(String text, IProposal proposal, IDirectEditingContext context)
          This method will be called by clients many times to see if current value is valid and could be set.
 String completeValue(String value, int caretPosition, IProposal choosenValue, IDirectEditingContext context)
          Framework calls this method to let the feature calculate the new value.
 IProposal[] getPossibleValues(IDirectEditingContext context)
          This value will be used if the cell editor is a combo box.
 IProposal[] getValueProposals(String value, int caretPosition, IDirectEditingContext context)
          This proposals will be used for the completion list of a simple text cell editor.
 void setValue(String text, IProposal proposal, IDirectEditingContext context)
          Set the new value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY_PROPOSAL_ARRAY

protected static final IProposal[] EMPTY_PROPOSAL_ARRAY
Constructor Detail

AbstractProposalSupport

public AbstractProposalSupport()
Method Detail

getPossibleValues

public IProposal[] getPossibleValues(IDirectEditingContext context)
Description copied from interface: IProposalSupport
This value will be used if the cell editor is a combo box. This functionality only applies to TYPE_DROPDOWN.

Specified by:
getPossibleValues in interface IProposalSupport
Parameters:
context - the context
Returns:
the possible values for the combo box.

completeValue

public String completeValue(String value,
                            int caretPosition,
                            IProposal choosenValue,
                            IDirectEditingContext context)
Description copied from interface: IProposalSupport
Framework calls this method to let the feature calculate the new value.

Specified by:
completeValue in interface IProposalSupport
Parameters:
value - current value
caretPosition - current cursor position
choosenValue - value choosen by user
context - the context
Returns:
the new value

checkValueValid

public String checkValueValid(String text,
                              IProposal proposal,
                              IDirectEditingContext context)
Description copied from interface: IProposalSupport
This method will be called by clients many times to see if current value is valid and could be set.

Specified by:
checkValueValid in interface IProposalSupport
Parameters:
text - the value as text
proposal - the value as proposal
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

getValueProposals

public IProposal[] getValueProposals(String value,
                                     int caretPosition,
                                     IDirectEditingContext context)
Description copied from interface: IProposalSupport
This proposals will be used for the completion list of a simple text cell editor. This functionality only applies to TYPE_TEXT.

Specified by:
getValueProposals in interface IProposalSupport
Parameters:
value - current value
caretPosition - current cursor position
context - the context
Returns:
the proposed values

setValue

public void setValue(String text,
                     IProposal proposal,
                     IDirectEditingContext context)
Description copied from interface: IProposalSupport
Set the new value. The value comes from the text editing UI component.

Specified by:
setValue in interface IProposalSupport
Parameters:
text - the value
proposal - the selected proposal
context - the context


Copyright (c) SAP AG 2005, 2012.