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

java.lang.Object
  extended by com.aptana.ide.editor.js.contentassist.JSContentAssistProcessor
All Implemented Interfaces:
IUnifiedContentAssistProcessor, org.eclipse.jface.text.contentassist.IContentAssistProcessor

public class JSContentAssistProcessor
extends java.lang.Object
implements org.eclipse.jface.text.contentassist.IContentAssistProcessor, IUnifiedContentAssistProcessor


Constructor Summary
JSContentAssistProcessor(EditorFileContext context)
          Provides code assist information for javascript.
 
Method Summary
 org.eclipse.jface.text.contentassist.ICompletionProposal[] computeCompletionProposals(org.eclipse.jface.text.ITextViewer viewer, int offset)
           
 org.eclipse.jface.text.contentassist.ICompletionProposal[] computeCompletionProposals(org.eclipse.jface.text.ITextViewer viewer, int offset, char activationChar)
           
 org.eclipse.jface.text.contentassist.IContextInformation[] computeContextInformation(org.eclipse.jface.text.ITextViewer viewer, int offset)
          Determines what 'tooltip' style highlighting to show.
static java.lang.String[] getAllPropertyNamesInScope(IObject object, boolean includeHiddenProps)
          getAllPropertyNamesInScope
 char[] getCompletionProposalAllActivationCharacters()
          The characters that triggers competion proposals (a combination of all activation chars)
 char[] getCompletionProposalAutoActivationCharacters()
          The characters that triggers competion proposals (dot for completion, and space for "new XX" in our case)
 int[] getCompletionProposalIdleActivationTokens()
          The token types that triggers competion proposals on idle
 char[] getContextInformationAutoActivationCharacters()
          Characters that trigger tooltip popup help
 org.eclipse.jface.text.contentassist.IContextInformationValidator getContextInformationValidator()
           
 java.lang.String getErrorMessage()
           
 JSOffsetMapper getJSOffsetMapper()
          getJSOffsetMapper
 IOffsetMapper getOffsetMapper()
          getOffsetMapper
 boolean isNextIdleActivated()
          isNextIdleActivated
 boolean isValidIdleActivationLocation(org.eclipse.jface.text.ITextViewer viewer, int offset)
          Is this a valid location for auto-assisting (based on lexeme, usually)
 void setHotkeyActivated(boolean value)
          setHotkeyActivated
 void setNextIdleActivated(boolean value)
          setNextIdleActivated
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JSContentAssistProcessor

public JSContentAssistProcessor(EditorFileContext context)
Provides code assist information for javascript.

Parameters:
context -
Method Detail

computeCompletionProposals

public org.eclipse.jface.text.contentassist.ICompletionProposal[] computeCompletionProposals(org.eclipse.jface.text.ITextViewer viewer,
                                                                                             int offset)
Specified by:
computeCompletionProposals in interface org.eclipse.jface.text.contentassist.IContentAssistProcessor
Parameters:
viewer -
offset -
Returns:
ICompletionProposal[]
See Also:
IContentAssistProcessor.computeCompletionProposals(org.eclipse.jface.text.ITextViewer, int)

computeCompletionProposals

public org.eclipse.jface.text.contentassist.ICompletionProposal[] computeCompletionProposals(org.eclipse.jface.text.ITextViewer viewer,
                                                                                             int offset,
                                                                                             char activationChar)
Specified by:
computeCompletionProposals in interface IUnifiedContentAssistProcessor
Returns:
ICompletionProposal[]
See Also:
IUnifiedContentAssistProcessor.computeCompletionProposals(org.eclipse.jface.text.ITextViewer, int, char)

computeContextInformation

public org.eclipse.jface.text.contentassist.IContextInformation[] computeContextInformation(org.eclipse.jface.text.ITextViewer viewer,
                                                                                            int offset)
Determines what 'tooltip' style highlighting to show. This will be argument insight for methods. This is formatted in JSContextInformationValidator (of all places) by implementing the optional IContextInformationPresenter interface.

Specified by:
computeContextInformation in interface org.eclipse.jface.text.contentassist.IContentAssistProcessor
Parameters:
viewer -
offset -
Returns:
Returns an array of relevant context info.

getCompletionProposalAllActivationCharacters

public char[] getCompletionProposalAllActivationCharacters()
The characters that triggers competion proposals (a combination of all activation chars)

Returns:
Returns the trigger characters for code completion.

getCompletionProposalAutoActivationCharacters

public char[] getCompletionProposalAutoActivationCharacters()
The characters that triggers competion proposals (dot for completion, and space for "new XX" in our case)

Specified by:
getCompletionProposalAutoActivationCharacters in interface org.eclipse.jface.text.contentassist.IContentAssistProcessor
Returns:
Returns the trigger characters for code completion.

getContextInformationValidator

public org.eclipse.jface.text.contentassist.IContextInformationValidator getContextInformationValidator()
Specified by:
getContextInformationValidator in interface org.eclipse.jface.text.contentassist.IContentAssistProcessor
See Also:
IContentAssistProcessor.getContextInformationValidator()

getContextInformationAutoActivationCharacters

public char[] getContextInformationAutoActivationCharacters()
Characters that trigger tooltip popup help

Specified by:
getContextInformationAutoActivationCharacters in interface org.eclipse.jface.text.contentassist.IContentAssistProcessor
Returns:
Returns the trigger characters for auto activation.

getCompletionProposalIdleActivationTokens

public int[] getCompletionProposalIdleActivationTokens()
Description copied from interface: IUnifiedContentAssistProcessor
The token types that triggers competion proposals on idle

Specified by:
getCompletionProposalIdleActivationTokens in interface IUnifiedContentAssistProcessor
Returns:
Returns the trigger tokens for code completion.
See Also:
IUnifiedContentAssistProcessor.getCompletionProposalIdleActivationTokens()

getErrorMessage

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

getAllPropertyNamesInScope

public static java.lang.String[] getAllPropertyNamesInScope(IObject object,
                                                            boolean includeHiddenProps)
getAllPropertyNamesInScope

Parameters:
object -
includeHiddenProps -
Returns:
String[]

getOffsetMapper

public IOffsetMapper getOffsetMapper()
getOffsetMapper

Specified by:
getOffsetMapper in interface IUnifiedContentAssistProcessor
Returns:
IOffsetMapper

getJSOffsetMapper

public JSOffsetMapper getJSOffsetMapper()
getJSOffsetMapper

Returns:
JSOffsetMapper

setHotkeyActivated

public void setHotkeyActivated(boolean value)
setHotkeyActivated

Parameters:
value -

setNextIdleActivated

public void setNextIdleActivated(boolean value)
setNextIdleActivated

Parameters:
value -

isNextIdleActivated

public boolean isNextIdleActivated()
isNextIdleActivated

Returns:
boolean

isValidIdleActivationLocation

public boolean isValidIdleActivationLocation(org.eclipse.jface.text.ITextViewer viewer,
                                             int offset)
Description copied from interface: IUnifiedContentAssistProcessor
Is this a valid location for auto-assisting (based on lexeme, usually)

Specified by:
isValidIdleActivationLocation in interface IUnifiedContentAssistProcessor
Returns:
Returns a valid location for auto-assisting (based on lexeme, usually)
See Also:
IUnifiedContentAssistProcessor.isValidIdleActivationLocation(org.eclipse.jface.text.ITextViewer, int)