com.aptana.ide.editors.unified
Class BaseFileLanguageService

java.lang.Object
  extended by com.aptana.ide.editors.unified.BaseFileLanguageService
All Implemented Interfaces:
IFileLanguageService
Direct Known Subclasses:
CSSFileLanguageService, HTMLFileLanguageService, JSCommentFileLanguageService, JSFileLanguageService, ScriptDocFileLanguageService, XMLFileLanguageService

public class BaseFileLanguageService
extends java.lang.Object
implements IFileLanguageService

Author:
Robin Debreuil

Field Summary
protected  FileService fileService
          fileService
 
Constructor Summary
BaseFileLanguageService(FileService fileService, IParseState parseState, IParser parser, IParentOffsetMapper mapper)
          BaseFileLanguageService
 
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 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
 java.lang.String getDocumentationTitleFromLexeme(Lexeme lexeme)
          Given a lexeme, returns the documentation title for that lexeme based upon the current "environment"
 IFileService getFileContext()
          Gets the language service provider
 IOffsetMapper getOffsetMapper()
          This will return a default offset mapper if not overridden.
 IParser getParser()
          getParser
 IParseState getParseState()
          Return the parse state for this language.
 IParseState getParseState(java.lang.String language)
          getParseState
 Lexeme getValidDocumentationLexeme(Lexeme lexeme)
          Given a lexeme, returns the "valid" neighboring lexeme that is useful for documentation.
 void reconnectToEnvironment()
          Reconnecting to the environment is occasionally necessary when the environment gets reset and file indexes get reset this can happen when the profile manager is updated...in that case, all fileIndexes are invalidated, so we need to reset ours.
 void reset(boolean resetFileIndex)
          reset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fileService

protected FileService fileService
fileService

Constructor Detail

BaseFileLanguageService

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

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

getParseState

public IParseState getParseState()
Return the parse state for this language.

Specified by:
getParseState in interface IFileLanguageService
Returns:
ParseState

getParseState

public IParseState getParseState(java.lang.String language)
Description copied from interface: IFileLanguageService
getParseState

Specified by:
getParseState in interface IFileLanguageService
Returns:
IParseState
See Also:
IFileLanguageService.getParseState(java.lang.String)

getParser

public IParser getParser()
Description copied from interface: IFileLanguageService
getParser

Specified by:
getParser in interface IFileLanguageService
Returns:
IParser
See Also:
IFileLanguageService.getParser()

getFileContext

public IFileService getFileContext()
Gets the language service provider

Specified by:
getFileContext in interface IFileLanguageService
Returns:
Returns the language service provider

getOffsetMapper

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

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

createOffsetMapper

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

Parameters:
parent -

getDocumentationFromLexeme

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

Specified by:
getDocumentationFromLexeme in interface IFileLanguageService
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)

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
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
Parameters:
lexeme - The lexeme to search documentation for
Returns:
A list of help resources
See Also:
IFileLanguageService.getDocumentationResourcesFromLexeme(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
Parameters:
lexeme - The lexeme to search documentation for
Returns:
A string representing the valid lexeme
See Also:
IFileLanguageService.getValidDocumentationLexeme(com.aptana.ide.lexer.Lexeme)

activateForEditing

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

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

deactivateForEditing

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

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

connectSourceProvider

public void connectSourceProvider(IFileSourceProvider sourceProvider)
Perhaps rename to onFileOpen?

Specified by:
connectSourceProvider in interface IFileLanguageService
Parameters:
sourceProvider -

disconnectSourceProvider

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

Specified by:
disconnectSourceProvider in interface IFileLanguageService
Parameters:
sourceProvider -

reconnectToEnvironment

public void reconnectToEnvironment()
Reconnecting to the environment is occasionally necessary when the environment gets reset and file indexes get reset this can happen when the profile manager is updated...in that case, all fileIndexes are invalidated, so we need to reset ours.

Specified by:
reconnectToEnvironment in interface IFileLanguageService

reset

public void reset(boolean resetFileIndex)
Description copied from interface: IFileLanguageService
reset

Specified by:
reset in interface IFileLanguageService
See Also:
IFileLanguageService.reset(boolean)