Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.1.0)

E17493-02

oracle.javatools.editor.language
Interface ExtendedBraceProvider

All Superinterfaces:
BraceProvider

public interface ExtendedBraceProvider
extends BraceProvider

The ExtendedBraceProvider interface extends the BraceProvider to provide a routine to allow matching-brace highlight support to locate the closest brace.

This allows brace-matching to always highlight the closest enclosing braces (vs. highlighting only when on the brace). This is a separate interface to avoid breaking existing language implementations that already implement BraceProvider.

See Also:
BraceProvider

Field Summary
static int BRACE_TYPE_ARRAY
          Constant indicating that the given brace type is used for array indexing.
static int BRACE_TYPE_BLOCK
          Constant indicating that the given brace type is used for delimiting code blocks.
static int BRACE_TYPE_PARENTHETICAL
          Constant indicating that the given brace type is used in parenthetical expressions.
static int BRACE_TYPE_UNKNOWN
          Constant indicating that the given brace type is unknown.
 
Fields inherited from interface oracle.javatools.editor.language.BraceProvider
BALANCED_MATCH, MISMATCH, UNBALANCED_MATCH
 
Method Summary
 int findClosestBrace(int offset, NumberRange braceLocation)
          Finds the brace that is closest to the specified offset, but which occurs before the specified offset.
 int getBraceType(int tokenType, NumberRange braceLocation)
          Fetch the brace type represented by the given language-specific token type, such as BRACE_TYPE_PARENTHETICAL.
 boolean isCloseBraceType(int tokenType)
          Fetch whether the brace type represented by the given language-specific token type represents a CLOSED brace type.
 boolean isOpenBraceType(int tokenType)
          Fetch whether the brace type represented by the given language-specific token type represents an OPEN brace type.
 
Methods inherited from interface oracle.javatools.editor.language.BraceProvider
findMatchingBrace, isPartOfBrace
 

Field Detail

BRACE_TYPE_UNKNOWN

static final int BRACE_TYPE_UNKNOWN
Constant indicating that the given brace type is unknown.

See Also:
Constant Field Values

BRACE_TYPE_PARENTHETICAL

static final int BRACE_TYPE_PARENTHETICAL
Constant indicating that the given brace type is used in parenthetical expressions.

See Also:
Constant Field Values

BRACE_TYPE_ARRAY

static final int BRACE_TYPE_ARRAY
Constant indicating that the given brace type is used for array indexing.

See Also:
Constant Field Values

BRACE_TYPE_BLOCK

static final int BRACE_TYPE_BLOCK
Constant indicating that the given brace type is used for delimiting code blocks.

See Also:
Constant Field Values
Method Detail

findClosestBrace

int findClosestBrace(int offset,
                     NumberRange braceLocation)
Finds the brace that is closest to the specified offset, but which occurs before the specified offset. 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.

Parameters:
offset - the starting offset to search from
braceLocation - an out parameter to pass start and end offset information to the caller if a closest brace was found before the offset

isOpenBraceType

boolean isOpenBraceType(int tokenType)
Fetch whether the brace type represented by the given language-specific token type represents an OPEN brace type.

Parameters:
tokenType - the language-specific token type returned by findClosestBrace
Returns:
true if the token type represents an open brace type

isCloseBraceType

boolean isCloseBraceType(int tokenType)
Fetch whether the brace type represented by the given language-specific token type represents a CLOSED brace type.

Parameters:
tokenType - the language-specific token type returned by findClosestBrace
Returns:
true if the token type represents a close brace type

getBraceType

int getBraceType(int tokenType,
                 NumberRange braceLocation)
Fetch the brace type represented by the given language-specific token type, such as BRACE_TYPE_PARENTHETICAL.

Parameters:
tokenType - the language-specific token type returned by findClosestBrace
braceLocation - the brace location filled in by findClosestBrace()
Returns:
the brace type for the specified language-specific token type

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.1.0)

E17493-02

Copyright © 1997, 2011, Oracle. All rights reserved.