Package org.eclipse.jface.fieldassist
Class ContentProposal
java.lang.Object
org.eclipse.jface.fieldassist.ContentProposal
- All Implemented Interfaces:
IContentProposal
A default implementation of
IContentProposal that allows clients to
specify a content proposal using simple constructors.- Since:
- 3.6
-
Constructor Summary
ConstructorsConstructorDescriptionContentProposal(String content) Create a content proposal whose label and content are the specified String.ContentProposal(String content, String description) Create a content proposal whose content and description are as specified in the parameters.ContentProposal(String content, String label, String description) Create a content proposal whose content, label, and description are as specified in the parameters.ContentProposal(String content, String label, String description, int cursorPosition) Create a content proposal whose content, label, description, and cursor position are as specified in the parameters. -
Method Summary
Modifier and TypeMethodDescriptionReturn the content represented by this proposal.intReturn the integer position within the contents that the cursor should be placed after the proposal is accepted.Return a description that describes this proposal.getLabel()Return the label used to describe this proposal.
-
Constructor Details
-
ContentProposal
Create a content proposal whose label and content are the specified String. The cursor position will be located at the end of the content.- Parameters:
content- the String representing the content. Should not benull.
-
ContentProposal
Create a content proposal whose content and description are as specified in the parameters. The cursor position will be located at the end of the content.- Parameters:
content- the String representing the content. Should not benull. This string will also be used as the label.description- the String representing the description, ornullif there should be no description.
-
ContentProposal
Create a content proposal whose content, label, and description are as specified in the parameters. The cursor position will be located at the end of the content.- Parameters:
content- the String representing the content. Should not benull.label- the String representing the label. Should not benull.description- the String representing the description, ornullif there should be no description.
-
ContentProposal
Create a content proposal whose content, label, description, and cursor position are as specified in the parameters.- Parameters:
content- the String representing the content. Should not benull.label- the String representing the label. Should not benull.description- the String representing the description, ornullif there should be no description.cursorPosition- the zero-based index position within the contents where the cursor should be placed after the proposal is accepted. The range of the cursor position is from 0..N where N is the number of characters in the content.- Throws:
IllegalArgumentException- if the index is not between 0 and the number of characters in the content.
-
-
Method Details
-
getContent
Description copied from interface:IContentProposalReturn the content represented by this proposal.- Specified by:
getContentin interfaceIContentProposal- Returns:
- the String content represented by this proposal.
-
getCursorPosition
public int getCursorPosition()Description copied from interface:IContentProposalReturn the integer position within the contents that the cursor should be placed after the proposal is accepted.- Specified by:
getCursorPositionin interfaceIContentProposal- Returns:
- the zero-based index position within the contents where the cursor should be placed after the proposal is accepted. The range of the cursor position is from 0..N where N is the number of characters in the contents.
-
getDescription
Description copied from interface:IContentProposalReturn a description that describes this proposal.- Specified by:
getDescriptionin interfaceIContentProposal- Returns:
- the String label used to further the proposal. If
null, then no description will be displayed.
-
getLabel
Description copied from interface:IContentProposalReturn the label used to describe this proposal.- Specified by:
getLabelin interfaceIContentProposal- Returns:
- the String label used to display the proposal. If
null, then the content will be displayed as the label.
-