Eclipse Platform
Release 3.5

org.eclipse.jface.fieldassist
Class SimpleContentProposal

java.lang.Object
  extended by org.eclipse.jface.fieldassist.SimpleContentProposal
All Implemented Interfaces:
IContentProposal

public class SimpleContentProposal
extends Object
implements IContentProposal

A default implementation of IContentProposal that allows clients to specify the contents in a constructor method.

Since:
3.6

Constructor Summary
SimpleContentProposal(String content)
          Create a simple content proposal whose label and content are the specified String.
SimpleContentProposal(String content, String description)
          Create a simple content proposal whose content and description are as specified in the parameters.
SimpleContentProposal(String content, String label, String description)
          Create a simple content proposal whose content, label, and description are as specified in the parameters.
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleContentProposal

public SimpleContentProposal(String content)
Create a simple content proposal whose label and content are the specified String.

Parameters:
content - the String representing the content. Should not be null.

SimpleContentProposal

public SimpleContentProposal(String content,
                             String description)
Create a simple content proposal whose content and description are as specified in the parameters.

Parameters:
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.

SimpleContentProposal

public SimpleContentProposal(String content,
                             String label,
                             String description)
Create a simple content proposal whose content, label, and description are as specified in the parameters.

Parameters:
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.
Method Detail

getContent

public String getContent()
Description copied from interface: IContentProposal
Return the content represented by this proposal.

Specified by:
getContent in interface IContentProposal
Returns:
the String content represented by this proposal.

getCursorPosition

public int getCursorPosition()
Description copied from interface: IContentProposal
Return the integer position within the contents that the cursor should be placed after the proposal is accepted.

Specified by:
getCursorPosition in interface IContentProposal
Returns:
the zero-based index position within the contents where the cursor should be placed after the proposal is accepted.

getDescription

public String getDescription()
Description copied from interface: IContentProposal
Return a description that describes this proposal.

Specified by:
getDescription in interface IContentProposal
Returns:
the String label used to further the proposal. If null, then no description will be displayed.

getLabel

public String getLabel()
Description copied from interface: IContentProposal
Return the label used to describe this proposal.

Specified by:
getLabel in interface IContentProposal
Returns:
the String label used to display the proposal. If null, then the content will be displayed as the label.

Eclipse Platform
Release 3.5

Guidelines for using Eclipse APIs.

Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.