|
Extension SDK 10.1.2 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oracle.javatools.editor.language.GenericBraceProvider
The GenericBraceProvider
implementation provides brace
matching support for "generic" languages that implement the
generic Language
API to describe the language.
BraceProvider
,
BraceMatchingPlugin
Field Summary | |
protected int[] |
braceArray
Stores the array containing start and end offsets of brace tokens, as well as brace indexes. |
protected java.lang.String |
braceCharacters
String containing all possible brace characters for this language. |
protected int |
braceCount
Stores the count of brace tokens in the buffer. |
protected BraceHelper |
braceHelper
The brace helper for the language implementation. |
protected GenericLexer |
lexer
The lexer to use for the language. |
protected LexerToken |
lexerToken
The token to use for lexing. |
protected TextBuffer |
textBuffer
The TextBuffer instance used by this GenericBraceProvider. |
Fields inherited from interface oracle.javatools.editor.language.BraceProvider |
BALANCED_MATCH, MISMATCH, UNBALANCED_MATCH |
Constructor Summary | |
GenericBraceProvider(LanguageSupport support,
Language language)
Constructs a new GenericBraceProvider associated with the given LanguageSupport and language instance. |
|
GenericBraceProvider(LanguageSupport support,
Language language,
GenericLexer lexerToUse)
Constructs a new GenericBraceProvider associated with the given LanguageSupport and language instance. |
Method Summary | |
protected int[] |
expandBraceArray(int[] braceArray)
Utility routine to expand the brace array. |
protected void |
fillBraceArray()
Utility routine to fill the contents of the brace array. |
int |
findMatchingBrace(int braceType,
NumberRange braceLocation,
NumberRange matchingLocation)
Finds the brace matching the given brace identified by isPartOfBrace(). |
protected int |
guessBraceCount(int length)
Utility routine to guess the brace count for a given size file. |
int |
isPartOfBrace(int offset,
NumberRange braceLocation)
Determines whether the character at the given offset is considered a brace or part of a brace in this language. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected TextBuffer textBuffer
protected BraceHelper braceHelper
protected GenericLexer lexer
protected LexerToken lexerToken
protected java.lang.String braceCharacters
protected int[] braceArray
protected int braceCount
Constructor Detail |
public GenericBraceProvider(LanguageSupport support, Language language)
GenericLexer
instance to use.
support
- the language supportlanguage
- the language definitionpublic GenericBraceProvider(LanguageSupport support, Language language, GenericLexer lexerToUse)
GenericLexer
implementation.
support
- the language supportlanguage
- the language definitionlexerToUse
- the lexer to useMethod Detail |
public int isPartOfBrace(int offset, NumberRange braceLocation)
NumberRange
object passed in by the caller is filled in by this routine to
indicate the start and end of the brace at the given offset
provided. This routine returns a language-specific token
type corresponding to the given brace at the offset, or -1
(Lexer.NOT_FOUND) if the offset is not part of a brace.
isPartOfBrace
in interface BraceProvider
offset
- the offset in the document associated with the
specific LanguageSupport to check if it is a bracebraceLocation
- an out parameter to pass start and end
offset information to the caller if the provided
brace offset is indeed part of a brace
public int findMatchingBrace(int braceType, NumberRange braceLocation, NumberRange matchingLocation)
findMatchingBrace
in interface BraceProvider
braceType
- the language-specific token type returned by
isPartOfBrace().braceLocation
- the brace location filled in by isPartOfBrace()matchingLocation
- an out parameter to pass start and end
offset information to the caller if a matching brace was found
protected int guessBraceCount(int length)
length
- the length of the file
protected int[] expandBraceArray(int[] braceArray)
braceArray
- the old brace array
protected void fillBraceArray()
|
Extension SDK | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1997, 2004, Oracle. All rights reserved.