com.aptana.ide.editor.js
Class JSFileLanguageService

java.lang.Object
  extended by com.aptana.ide.editors.unified.BaseFileLanguageService
      extended by com.aptana.ide.editor.js.JSFileLanguageService
All Implemented Interfaces:
IFileLanguageService

public class JSFileLanguageService
extends BaseFileLanguageService

The file specifics for a language document.

Author:
Ingo Muschenetz

Field Summary
 
Fields inherited from class com.aptana.ide.editors.unified.BaseFileLanguageService
fileService
 
Constructor Summary
JSFileLanguageService(FileService fileService, IParseState parseState, IParser parser, IParentOffsetMapper mapper)
          JSFileLanguageService
 
Method Summary
 void activateForEditing()
          Called when the associated editor is activated.
 void connectSourceProvider(IFileSourceProvider sourceProvider)
          Perhaps rename to onFileOpen?
 void createOffsetMapper(IParentOffsetMapper parent)
          This will return a default offset mapper if not overridden.
 void deactivateForEditing()
          Called when the associated editor is deactivated.
 void disconnectSourceProvider(IFileSourceProvider sourceProvider)
          Perhaps rename to onFileClose.
 java.lang.String getDefaultLanguage()
           
 java.lang.String getDocumentationFromLexeme(Lexeme lexeme)
          Given a lexeme, returns the documentation for that lexeme based upon the current "environment"
 HelpResource[] getDocumentationResourcesFromLexeme(Lexeme lexeme)
          Reurns a list of documentation links pertinent to the particular lexeme
 IDocumentationStore getDocumentationStore()
          getDocumentationStore
 java.lang.String getDocumentationTitleFromLexeme(Lexeme lexeme)
          Given a lexeme, returns the documentation title for that lexeme based upon the current "environment"
 LexemeBasedEnvironmentLoader getEnvironmentLoader()
          Gets the environemnt loader
static JSFileLanguageService getJSFileLanguageService(IFileService context)
          getJSFileLanguageService
 IOffsetMapper getOffsetMapper()
          This will return a default offset mapper if not overridden.
 Lexeme getValidDocumentationLexeme(Lexeme lexeme)
          Given a lexeme, returns the "valid" neighboring lexeme that is useful for documentation.
 void reset(boolean resetFileIndex)
          reset
 void setDocumentationStore(IDocumentationStore store)
          setDocumentationStore
 
Methods inherited from class com.aptana.ide.editors.unified.BaseFileLanguageService
getFileContext, getParser, getParseState, getParseState, reconnectToEnvironment
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JSFileLanguageService

public JSFileLanguageService(FileService fileService,
                             IParseState parseState,
                             IParser parser,
                             IParentOffsetMapper mapper)
JSFileLanguageService

Parameters:
fileService -
parseState -
parser -
mapper -
Method Detail

getDocumentationTitleFromLexeme

public java.lang.String getDocumentationTitleFromLexeme(Lexeme lexeme)
Description copied from interface: IFileLanguageService
Given a lexeme, returns the documentation title for that lexeme based upon the current "environment"

Specified by:
getDocumentationTitleFromLexeme in interface IFileLanguageService
Overrides:
getDocumentationTitleFromLexeme in class BaseFileLanguageService
Parameters:
lexeme - The lexeme to search documentation for
Returns:
A string representing the code assist documentation
See Also:
IFileLanguageService.getDocumentationTitleFromLexeme(com.aptana.ide.lexer.Lexeme)

getDocumentationResourcesFromLexeme

public HelpResource[] getDocumentationResourcesFromLexeme(Lexeme lexeme)
Description copied from interface: IFileLanguageService
Reurns a list of documentation links pertinent to the particular lexeme

Specified by:
getDocumentationResourcesFromLexeme in interface IFileLanguageService
Overrides:
getDocumentationResourcesFromLexeme in class BaseFileLanguageService
Parameters:
lexeme - The lexeme to search documentation for
Returns:
A list of help resources
See Also:
IFileLanguageService.getDocumentationResourcesFromLexeme(com.aptana.ide.lexer.Lexeme)

getDocumentationFromLexeme

public java.lang.String getDocumentationFromLexeme(Lexeme lexeme)
Given a lexeme, returns the documentation for that lexeme based upon the current "environment"

Specified by:
getDocumentationFromLexeme in interface IFileLanguageService
Overrides:
getDocumentationFromLexeme in class BaseFileLanguageService
Parameters:
lexeme - The lexeme to search documentation for
Returns:
A string representing the code assist documentation
See Also:
IFileLanguageService.getDocumentationFromLexeme(com.aptana.ide.lexer.Lexeme)

getValidDocumentationLexeme

public Lexeme getValidDocumentationLexeme(Lexeme lexeme)
Description copied from interface: IFileLanguageService
Given a lexeme, returns the "valid" neighboring lexeme that is useful for documentation. As an example, if doing document.getElementById(, it will return "getElementById", not "("

Specified by:
getValidDocumentationLexeme in interface IFileLanguageService
Overrides:
getValidDocumentationLexeme in class BaseFileLanguageService
Parameters:
lexeme - The lexeme to search documentation for
Returns:
A string representing the valid lexeme
See Also:
IFileLanguageService.getValidDocumentationLexeme(com.aptana.ide.lexer.Lexeme)

getOffsetMapper

public IOffsetMapper getOffsetMapper()
Description copied from class: BaseFileLanguageService
This will return a default offset mapper if not overridden. overrides shouldn't call the base class.

Specified by:
getOffsetMapper in interface IFileLanguageService
Overrides:
getOffsetMapper in class BaseFileLanguageService
Returns:
IOffsetMapper
See Also:
IFileLanguageService.getOffsetMapper()

createOffsetMapper

public void createOffsetMapper(IParentOffsetMapper parent)
Description copied from class: BaseFileLanguageService
This will return a default offset mapper if not overridden. overrides shouldn't call the base class.

Overrides:
createOffsetMapper in class BaseFileLanguageService
See Also:
BaseFileLanguageService.createOffsetMapper(com.aptana.ide.editors.unified.IParentOffsetMapper)

getEnvironmentLoader

public LexemeBasedEnvironmentLoader getEnvironmentLoader()
Gets the environemnt loader

Returns:
Gets the environemnt loader

getDefaultLanguage

public java.lang.String getDefaultLanguage()
Returns:
DefaultLanguage

reset

public void reset(boolean resetFileIndex)
reset

Specified by:
reset in interface IFileLanguageService
Overrides:
reset in class BaseFileLanguageService
Parameters:
resetFileIndex -
See Also:
IFileLanguageService.reset(boolean)

connectSourceProvider

public void connectSourceProvider(IFileSourceProvider sourceProvider)
Description copied from class: BaseFileLanguageService
Perhaps rename to onFileOpen?

Specified by:
connectSourceProvider in interface IFileLanguageService
Overrides:
connectSourceProvider in class BaseFileLanguageService
See Also:
IFileLanguageService.connectSourceProvider(com.aptana.ide.editors.unified.IFileSourceProvider)

disconnectSourceProvider

public void disconnectSourceProvider(IFileSourceProvider sourceProvider)
Description copied from class: BaseFileLanguageService
Perhaps rename to onFileClose. Languages should clean out their environement, delete the given file, and rebuild here

Specified by:
disconnectSourceProvider in interface IFileLanguageService
Overrides:
disconnectSourceProvider in class BaseFileLanguageService
See Also:
IFileLanguageService.disconnectSourceProvider(com.aptana.ide.editors.unified.IFileSourceProvider)

getDocumentationStore

public IDocumentationStore getDocumentationStore()
getDocumentationStore

Returns:
IDocumentationStore

setDocumentationStore

public void setDocumentationStore(IDocumentationStore store)
setDocumentationStore

Parameters:
store -

getJSFileLanguageService

public static JSFileLanguageService getJSFileLanguageService(IFileService context)
getJSFileLanguageService

Parameters:
context -
Returns:
JSFileLanguageService

activateForEditing

public void activateForEditing()
Description copied from interface: IFileLanguageService
Called when the associated editor is activated.

Specified by:
activateForEditing in interface IFileLanguageService
Overrides:
activateForEditing in class BaseFileLanguageService
See Also:
BaseFileLanguageService.activateForEditing()

deactivateForEditing

public void deactivateForEditing()
Description copied from interface: IFileLanguageService
Called when the associated editor is deactivated.

Specified by:
deactivateForEditing in interface IFileLanguageService
Overrides:
deactivateForEditing in class BaseFileLanguageService
See Also:
BaseFileLanguageService.deactivateForEditing()