com.aptana.ide.editor.js.contentassist
Class JSCompletionProposal

java.lang.Object
  extended by com.aptana.ide.editor.js.contentassist.JSCompletionProposal
All Implemented Interfaces:
IUnifiedCompletionProposal, org.eclipse.jface.text.contentassist.ICompletionProposal

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


Field Summary
 boolean defaultSelection
          defaultSelection
 boolean suggestedSelection
          suggestedSelection
 
Constructor Summary
JSCompletionProposal(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, java.lang.String fileLocation, org.eclipse.swt.graphics.Image[] userAgentImages)
          Creates a new completion proposal.
 
Method Summary
 void apply(org.eclipse.jface.text.IDocument document)
           
 java.lang.String getAdditionalProposalInfo()
           
 org.eclipse.jface.text.contentassist.IContextInformation getContextInformation()
           
 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()
           
 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 isSuggestedSelection()
           
static java.lang.String padToColumn(java.lang.String stringToPad, int columnWidth)
          padToColumn
 void setDefaultSelection(boolean defaultSelection)
           
 void setReplacementLength(int replacementLength)
           
 void setSuggestedSelection(boolean suggestedSelection)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

defaultSelection

public boolean defaultSelection
defaultSelection


suggestedSelection

public boolean suggestedSelection
suggestedSelection

Constructor Detail

JSCompletionProposal

public JSCompletionProposal(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,
                            java.lang.String fileLocation,
                            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).
fileLocation - The source file location where the CA proposal was found.
userAgentImages -
Method Detail

padToColumn

public static java.lang.String padToColumn(java.lang.String stringToPad,
                                           int columnWidth)
padToColumn

Parameters:
stringToPad -
columnWidth -
Returns:
String

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.

getFileLocation

public java.lang.String getFileLocation()
Specified by:
getFileLocation in interface IUnifiedCompletionProposal
Returns:
Returns the file location where the given CA was found (or jsCore, Dom0, Dom1 etc).

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.

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()

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.