org.eclipse.jst.jsf.context.symbol.internal.provisional.provider
Class ProposalCreationFactoryAdapter

java.lang.Object
  extended byorg.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
 
Constructor Summary
ProposalCreationFactoryAdapter(int replacementOffset, int replacementLength)
           
 
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
 

Field Detail

_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

Constructor Detail

ProposalCreationFactoryAdapter

public ProposalCreationFactoryAdapter(int replacementOffset,
                                      int replacementLength)
Parameters:
replacementOffset - -- the absolute document offset to do the replacement
replacementLength - -- the number of characters to replace or 0 for insert without any replacement
Method Detail

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 replaced
displayText - The text to be displayed in the assist window
additionalText - The text to be displayed in the "addition info" or null
displayImage - The image to be displayed or null
targetObject - 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