com.aptana.ide.editors.unified.contentassist
Class UnifiedCompletionProposal

java.lang.Object
  extended by com.aptana.ide.editors.unified.contentassist.UnifiedCompletionProposal
All Implemented Interfaces:
IUnifiedCompletionProposal, org.eclipse.jface.text.contentassist.ICompletionProposal
Direct Known Subclasses:
CSSCompletionProposal, HTMLCompletionProposal

public abstract class UnifiedCompletionProposal
extends java.lang.Object
implements org.eclipse.jface.text.contentassist.ICompletionProposal, IUnifiedCompletionProposal

UnifiedCompletionProposal

Author:
Ingo Muschenetz

Field Summary
protected  java.lang.String additionalProposalInfo
          The additional info of this proposal.
protected  org.eclipse.jface.text.contentassist.IContextInformation contextInformation
          The context information of this proposal.
protected  int cursorPosition
          The cursor position after this proposal has been applied.
 boolean defaultSelection
          defaultSelection
protected  java.lang.String displayString
          The string to be displayed in the completion proposal popup.
protected  org.eclipse.swt.graphics.Image image
          The image to be displayed in the completion proposal popup.
protected  int objectType
          The type of the object.
protected  boolean popAssistOnInsert
          Do we pop code assist once the insertion has happened *
protected  int replacementLength
          The replacement length.
protected  int replacementOffset
          The replacement offset.
protected  java.lang.String replacementString
          The replacement string.
 boolean suggestedSelection
          suggestedSelection
protected  org.eclipse.jface.text.ITextViewer unifiedViewer
          The local document viewer *
protected  org.eclipse.swt.graphics.Image[] userAgentImages
          The list of images to display for various user agents
 
Constructor Summary
UnifiedCompletionProposal(java.lang.String replacementString, int replacementOffset, int replacementLength, int cursorPosition, org.eclipse.swt.graphics.Image image, java.lang.String displayString, org.eclipse.jface.text.contentassist.IContextInformation contextInformation, java.lang.String additionalProposalInfo, int objectType, org.eclipse.jface.text.ITextViewer unifiedViewer, org.eclipse.swt.graphics.Image[] userAgentImages)
          Creates a new completion proposal.
 
Method Summary
 boolean activateContentAssistOnInsert()
          activateContentAssistOnInsert
 void apply(org.eclipse.jface.text.IDocument document)
           
 java.lang.String getAdditionalProposalInfo()
           
 org.eclipse.jface.text.contentassist.IContextInformation getContextInformation()
           
 int getCursorPosition()
          getCursorPosition
 java.lang.String getDisplayString()
           
 java.lang.String getFileLocation()
           
 org.eclipse.swt.graphics.Image getImage()
           
 int getObjectType()
          Returns the type of object this proposal contains (class, method, etc).This is used for sorting.
 int getReplacementLength()
           
 int getReplacementOffset()
          getReplacementOffset
 java.lang.String getReplacementString()
          getReplacementString
 java.lang.String getReplaceString()
           
 org.eclipse.swt.graphics.Point getSelection(org.eclipse.jface.text.IDocument document)
           
 org.eclipse.swt.graphics.Image[] getUserAgentImages()
           
 boolean isDefaultSelection()
           
 boolean isPopAssistOnInsert()
          isPopAssistOnInsert
 boolean isSuggestedSelection()
           
 void scheduleContentAssistOnInsert(boolean popAssistOnInsert)
          scheduleContentAssistOnInsert
 void setCursorPosition(int cursorPosition)
          setCursorPosition
 void setDefaultSelection(boolean defaultSelection)
           
 void setPopAssistOnInsert(boolean popAssistOnInsert)
          setPopAssistOnInsert
 void setReplacementLength(int replacementLength)
           
 void setReplacementOffset(int replacementOffset)
          setReplacementOffset
 void setReplacementString(java.lang.String replacementString)
          setReplacementString
 void setSuggestedSelection(boolean suggestedSelection)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

displayString

protected java.lang.String displayString
The string to be displayed in the completion proposal popup.


replacementString

protected java.lang.String replacementString
The replacement string.


replacementOffset

protected int replacementOffset
The replacement offset.


replacementLength

protected int replacementLength
The replacement length.


cursorPosition

protected int cursorPosition
The cursor position after this proposal has been applied.


image

protected org.eclipse.swt.graphics.Image image
The image to be displayed in the completion proposal popup.


contextInformation

protected org.eclipse.jface.text.contentassist.IContextInformation contextInformation
The context information of this proposal.


additionalProposalInfo

protected java.lang.String additionalProposalInfo
The additional info of this proposal.


objectType

protected int objectType
The type of the object. This is an 'enum' of JSCompletionProposalComparator sorting types.


unifiedViewer

protected org.eclipse.jface.text.ITextViewer unifiedViewer
The local document viewer *


popAssistOnInsert

protected boolean popAssistOnInsert
Do we pop code assist once the insertion has happened *


userAgentImages

protected org.eclipse.swt.graphics.Image[] userAgentImages
The list of images to display for various user agents


defaultSelection

public boolean defaultSelection
defaultSelection


suggestedSelection

public boolean suggestedSelection
suggestedSelection

Constructor Detail

UnifiedCompletionProposal

public UnifiedCompletionProposal(java.lang.String replacementString,
                                 int replacementOffset,
                                 int replacementLength,
                                 int cursorPosition,
                                 org.eclipse.swt.graphics.Image image,
                                 java.lang.String displayString,
                                 org.eclipse.jface.text.contentassist.IContextInformation contextInformation,
                                 java.lang.String additionalProposalInfo,
                                 int objectType,
                                 org.eclipse.jface.text.ITextViewer unifiedViewer,
                                 org.eclipse.swt.graphics.Image[] userAgentImages)
Creates a new completion proposal. All fields are initialized based on the provided information.

Parameters:
replacementString - the actual string to be inserted into the document
replacementOffset - the offset of the text to be replaced
replacementLength - the length of the text to be replaced
cursorPosition - the position of the cursor following the insert relative to replacementOffset
image - the image to display for this proposal
displayString - the string to be displayed for the proposal
contextInformation - the context information associated with this proposal
additionalProposalInfo - the additional information associated with this proposal
objectType - The type of the object. This is an 'enum' of JSCompletionProposalComparator sorting types (used for quicker sorting).
unifiedViewer -
userAgentImages -
Method Detail

getObjectType

public int getObjectType()
Returns the type of object this proposal contains (class, method, etc).This is used for sorting.

Returns:
Returns the type of object this proposal contains (class, method, etc).This is used for sorting.

apply

public void apply(org.eclipse.jface.text.IDocument document)
Specified by:
apply in interface org.eclipse.jface.text.contentassist.ICompletionProposal
See Also:
ICompletionProposal.apply(IDocument)

getSelection

public org.eclipse.swt.graphics.Point getSelection(org.eclipse.jface.text.IDocument document)
Specified by:
getSelection in interface org.eclipse.jface.text.contentassist.ICompletionProposal
See Also:
ICompletionProposal.getSelection(IDocument)

getContextInformation

public org.eclipse.jface.text.contentassist.IContextInformation getContextInformation()
Specified by:
getContextInformation in interface org.eclipse.jface.text.contentassist.ICompletionProposal
See Also:
ICompletionProposal.getContextInformation()

getImage

public org.eclipse.swt.graphics.Image getImage()
Specified by:
getImage in interface org.eclipse.jface.text.contentassist.ICompletionProposal
See Also:
ICompletionProposal.getImage()

getDisplayString

public java.lang.String getDisplayString()
Specified by:
getDisplayString in interface IUnifiedCompletionProposal
Specified by:
getDisplayString in interface org.eclipse.jface.text.contentassist.ICompletionProposal
Returns:
The string to display the proposal on screen
See Also:
ICompletionProposal.getDisplayString()

getReplaceString

public java.lang.String getReplaceString()
Specified by:
getReplaceString in interface IUnifiedCompletionProposal
Returns:
The string to replace the proposal in code
See Also:
IUnifiedCompletionProposal.getReplaceString()

getAdditionalProposalInfo

public java.lang.String getAdditionalProposalInfo()
Specified by:
getAdditionalProposalInfo in interface org.eclipse.jface.text.contentassist.ICompletionProposal
See Also:
ICompletionProposal.getAdditionalProposalInfo()

isDefaultSelection

public boolean isDefaultSelection()
Specified by:
isDefaultSelection in interface IUnifiedCompletionProposal
Returns:
Returns the defaultSelection.

setDefaultSelection

public void setDefaultSelection(boolean defaultSelection)
Specified by:
setDefaultSelection in interface IUnifiedCompletionProposal
Parameters:
defaultSelection - The defaultSelection to set.

isSuggestedSelection

public boolean isSuggestedSelection()
Specified by:
isSuggestedSelection in interface IUnifiedCompletionProposal
Returns:
Returns the defaultSelection.

setSuggestedSelection

public void setSuggestedSelection(boolean suggestedSelection)
Specified by:
setSuggestedSelection in interface IUnifiedCompletionProposal
Parameters:
suggestedSelection - The suggestedSelection to set.

activateContentAssistOnInsert

public boolean activateContentAssistOnInsert()
activateContentAssistOnInsert

Returns:
boolean

scheduleContentAssistOnInsert

public void scheduleContentAssistOnInsert(boolean popAssistOnInsert)
scheduleContentAssistOnInsert

Parameters:
popAssistOnInsert -

getCursorPosition

public int getCursorPosition()
getCursorPosition

Returns:
int

setCursorPosition

public void setCursorPosition(int cursorPosition)
setCursorPosition

Parameters:
cursorPosition -

isPopAssistOnInsert

public boolean isPopAssistOnInsert()
isPopAssistOnInsert

Returns:
boolean

getReplacementLength

public int getReplacementLength()
Specified by:
getReplacementLength in interface IUnifiedCompletionProposal
Returns:
Returns the replacementLength.

setReplacementLength

public void setReplacementLength(int replacementLength)
Parameters:
replacementLength - The replacementLength to set.

setPopAssistOnInsert

public void setPopAssistOnInsert(boolean popAssistOnInsert)
setPopAssistOnInsert

Parameters:
popAssistOnInsert -

getReplacementOffset

public int getReplacementOffset()
getReplacementOffset

Returns:
int

setReplacementOffset

public void setReplacementOffset(int replacementOffset)
setReplacementOffset

Parameters:
replacementOffset -

getReplacementString

public java.lang.String getReplacementString()
getReplacementString

Returns:
String

setReplacementString

public void setReplacementString(java.lang.String replacementString)
setReplacementString

Parameters:
replacementString -

getFileLocation

public java.lang.String getFileLocation()
Specified by:
getFileLocation in interface IUnifiedCompletionProposal
Returns:
The string to display that specifies the location of this proposal
See Also:
IUnifiedCompletionProposal.getFileLocation()

getUserAgentImages

public org.eclipse.swt.graphics.Image[] getUserAgentImages()
Specified by:
getUserAgentImages in interface IUnifiedCompletionProposal
Returns:
The length of text to be replaced
See Also:
IUnifiedCompletionProposal.getUserAgentImages()