org.eclipse.jst.jsf.context.symbol.internal.provisional.provider
Class ProposalCreationFactoryAdapter
java.lang.Object
org.eclipse.jst.jsf.context.symbol.internal.provisional.provider.ProposalCreationFactoryAdapter
- All Implemented Interfaces:
- IContentProposalProvider.IProposalCreationFactory
- public class ProposalCreationFactoryAdapter
- extends java.lang.Object
- implements IContentProposalProvider.IProposalCreationFactory
Default implementation of the proposal creation factory
Field Summary |
protected int |
_replacementLength
The number of characters to replace starting from _replaceOffset with
the proposal. |
protected int |
_replacementOffset
The absolute document offset where the replacement is to occur |
Method Summary |
protected static org.eclipse.jface.text.contentassist.ICompletionProposal |
createDefaultProposal(java.lang.String replacementText,
int replacementOffset,
int replacementLength,
int cursorPosition,
org.eclipse.swt.graphics.Image displayImage,
java.lang.String displayText,
org.eclipse.jface.text.contentassist.IContextInformation contextInfo,
java.lang.String additionalText,
int relevance)
Simple factory method for creating a default proposal |
org.eclipse.jface.text.contentassist.ICompletionProposal |
createProposal(java.lang.String replacementText,
java.lang.String displayText,
java.lang.String additionalText,
org.eclipse.swt.graphics.Image displayImage,
java.lang.Object targetObject)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_replacementOffset
protected final int _replacementOffset
- The absolute document offset where the replacement is to occur
_replacementLength
protected final int _replacementLength
- The number of characters to replace starting from _replaceOffset with
the proposal. 0 indicates insertion with no replacement
ProposalCreationFactoryAdapter
public ProposalCreationFactoryAdapter(int replacementOffset,
int replacementLength)
- Parameters:
replacementOffset
- -- the absolute document offset to do the replacementreplacementLength
- -- the number of characters to replace or 0
for insert without any replacement
createProposal
public org.eclipse.jface.text.contentassist.ICompletionProposal createProposal(java.lang.String replacementText,
java.lang.String displayText,
java.lang.String additionalText,
org.eclipse.swt.graphics.Image displayImage,
java.lang.Object targetObject)
- Specified by:
createProposal
in interface IContentProposalProvider.IProposalCreationFactory
- Parameters:
replacementText
- The text to be replaceddisplayText
- The text to be displayed in the assist windowadditionalText
- The text to be displayed in the "addition info"
or nulldisplayImage
- The image to be displayed or nulltargetObject
- The original source object. Implementors should
make no assumptions (i.e. always test instanceof before casting)
- Returns:
- a configured completion proposal for the parameters
createDefaultProposal
protected static org.eclipse.jface.text.contentassist.ICompletionProposal createDefaultProposal(java.lang.String replacementText,
int replacementOffset,
int replacementLength,
int cursorPosition,
org.eclipse.swt.graphics.Image displayImage,
java.lang.String displayText,
org.eclipse.jface.text.contentassist.IContextInformation contextInfo,
java.lang.String additionalText,
int relevance)
- Simple factory method for creating a default proposal
- Parameters:
replacementText
- replacementOffset
- replacementLength
- cursorPosition
- displayImage
- displayText
- contextInfo
- additionalText
- relevance
-
- Returns:
- a default configuration of the completion proposal based on
the CustomCompletionProposal