public class ContentProposal extends Object implements IContentProposal
IContentProposal
that allows clients to
specify a content proposal using simple constructors.Constructor and Description |
---|
ContentProposal(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.
|
Modifier and Type | Method and Description |
---|---|
String |
getContent()
Return the content represented by this proposal.
|
int |
getCursorPosition()
Return the integer position within the contents that the cursor should be
placed after the proposal is accepted.
|
String |
getDescription()
Return a description that describes this proposal.
|
String |
getLabel()
Return the label used to describe this proposal.
|
public ContentProposal(String content)
content
- the String representing the content. Should not be
null
.public ContentProposal(String content, String description)
content
- the String representing the content. Should not be
null
. This string will also be used as the label.description
- the String representing the description, or null
if there should be no description.public ContentProposal(String content, String label, String description)
content
- the String representing the content. Should not be
null
.label
- the String representing the label. Should not be
null
.description
- the String representing the description, or null
if there should be no description.public ContentProposal(String content, String label, String description, int cursorPosition)
content
- the String representing the content. Should not be
null
.label
- the String representing the label. Should not be
null
.description
- the String representing the description, or null
if 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.IllegalArgumentException
- if the index is not between 0 and the number of characters
in the content.public String getContent()
IContentProposal
getContent
in interface IContentProposal
public int getCursorPosition()
IContentProposal
getCursorPosition
in interface IContentProposal
public String getDescription()
IContentProposal
getDescription
in interface IContentProposal
null
, then no description will be displayed.public String getLabel()
IContentProposal
getLabel
in interface IContentProposal
null
, then the content will be displayed as the
label.
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.