Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.1.0)

E13403-02

oracle.javatools.editor.language
Interface WordLocator

All Known Implementing Classes:
DefaultWordLocator, NaturalWordLocator

public interface WordLocator

The WordLocator interface provides the methods for allowing each language to define its own word boundaries for word-based navigation. For example, in the natural language, text like "it's" or "1.0" forms an entire word, while in Java, text like "java.lang.String" forms three separate words.

Note that these methods all bias to the right currently. This may be an issue for bi-directional languages that needs to be resolved at some point.

See Also:
LanguageModule, LanguageSupport

Method Summary
 int getNextWordEnd(int offset)
          Fetches the next offset where a word ends.
 int getNextWordStart(int offset)
          Fetches the next offset where a word starts from.
 int getPreviousWordEnd(int offset)
          Fetches the previous offset where a word ends.
 int getPreviousWordStart(int offset)
          Fetches the previous offset where a word starts from.
 int getWordEnd(int offset)
          Fetches the end of the word for the given offset location.
 int getWordStart(int offset)
          Fetches the start of the word for the given offset location.
 

Method Detail

getWordStart

int getWordStart(int offset)
Fetches the start of the word for the given offset location. If the offset occurs at the boundary between two words, then we will bias to the right, following the Swing defaults - this means that the offset is already at the start of the word on the right, and should return the same offset.

Parameters:
offset - the specified document offset
Returns:
the start of the word that the offset is contained in

getWordEnd

int getWordEnd(int offset)
Fetches the end of the word for the given offset location. If the offset occurs at the boundary between two words, again, we will bias to the right, following the Swing defaults. This means that the offset is at the start of the word on the right, and should return that word's end offset.

Parameters:
offset - the specified document offset
Returns:
the end of the word that the offset is contained in

getNextWordStart

int getNextWordStart(int offset)
Fetches the next offset where a word starts from.

Parameters:
offset - the specified document offset
Returns:
the next start of a word

getNextWordEnd

int getNextWordEnd(int offset)
Fetches the next offset where a word ends.

Parameters:
offset - the specified document offset
Returns:
the next end of a word

getPreviousWordStart

int getPreviousWordStart(int offset)
Fetches the previous offset where a word starts from.

Parameters:
offset - the specified document offset
Returns:
the previous start of a word

getPreviousWordEnd

int getPreviousWordEnd(int offset)
Fetches the previous offset where a word ends.

Parameters:
offset - the specified document offset
Returns:
the previous end of a word

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.1.0)

E13403-02

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