Package org.eclipse.graphiti.func
Class AbstractProposalSupport
- java.lang.Object
-
- org.eclipse.graphiti.func.AbstractProposalSupport
-
- All Implemented Interfaces:
IProposalSupport
public class AbstractProposalSupport extends java.lang.Object implements IProposalSupport
- Since:
- 0.8
-
-
Field Summary
Fields Modifier and Type Field Description protected static IProposal[]EMPTY_PROPOSAL_ARRAY
-
Constructor Summary
Constructors Constructor Description AbstractProposalSupport()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringcheckValueValid(java.lang.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.java.lang.StringcompleteValue(java.lang.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(java.lang.String value, int caretPosition, IDirectEditingContext context)This proposals will be used for the completion list of a simple text cell editor.voidsetValue(java.lang.String text, IProposal proposal, IDirectEditingContext context)Set the new value.
-
-
-
Field Detail
-
EMPTY_PROPOSAL_ARRAY
protected static final IProposal[] EMPTY_PROPOSAL_ARRAY
-
-
Method Detail
-
getPossibleValues
public IProposal[] getPossibleValues(IDirectEditingContext context)
Description copied from interface:IProposalSupportThis value will be used if the cell editor is a combo box. This functionality only applies to TYPE_DROPDOWN.- Specified by:
getPossibleValuesin interfaceIProposalSupport- Parameters:
context- the context- Returns:
- the possible values for the combo box.
-
completeValue
public java.lang.String completeValue(java.lang.String value, int caretPosition, IProposal choosenValue, IDirectEditingContext context)Description copied from interface:IProposalSupportFramework calls this method to let the feature calculate the new value.- Specified by:
completeValuein interfaceIProposalSupport- Parameters:
value- current valuecaretPosition- current cursor positionchoosenValue- value choosen by usercontext- the context- Returns:
- the new value
-
checkValueValid
public java.lang.String checkValueValid(java.lang.String text, IProposal proposal, IDirectEditingContext context)Description copied from interface:IProposalSupportThis method will be called by clients many times to see if current value is valid and could be set.- Specified by:
checkValueValidin interfaceIProposalSupport- Parameters:
text- the value as textproposal- the value as proposalcontext- 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(java.lang.String value, int caretPosition, IDirectEditingContext context)
Description copied from interface:IProposalSupportThis proposals will be used for the completion list of a simple text cell editor. This functionality only applies to TYPE_TEXT.- Specified by:
getValueProposalsin interfaceIProposalSupport- Parameters:
value- current valuecaretPosition- current cursor positioncontext- the context- Returns:
- the proposed values
-
setValue
public void setValue(java.lang.String text, IProposal proposal, IDirectEditingContext context)Description copied from interface:IProposalSupportSet the new value. The value comes from the text editing UI component.- Specified by:
setValuein interfaceIProposalSupport- Parameters:
text- the valueproposal- the selected proposalcontext- the context
-
-