org.netbeans.modules.editor.lib2/1 1.43.1 10

org.netbeans.spi.editor.typinghooks
Class TypedBreakInterceptor.Context

java.lang.Object
  extended by org.netbeans.spi.editor.typinghooks.TypedBreakInterceptor.Context
Direct Known Subclasses:
TypedBreakInterceptor.MutableContext
Enclosing interface:
TypedBreakInterceptor

public static class TypedBreakInterceptor.Context
extends Object

The context class providing information about the edited document, its editor pane, caret offset, line break insertion offset and text.


Method Summary
 int getBreakInsertOffset()
          Gets the line break insertion offset.
 int getCaretOffset()
          Gets the caret offset.
 JTextComponent getComponent()
          Gets the editor component where the currently processed key typed event occurred.
 Document getDocument()
          Gets the edited document.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getComponent

public JTextComponent getComponent()
Gets the editor component where the currently processed key typed event occurred.

Returns:
The editor pane that contains the edited Document.

getDocument

public Document getDocument()
Gets the edited document. It's the document where the line break is going to be inserted.

Returns:
The edited document.

getCaretOffset

public int getCaretOffset()
Gets the caret offset. This is the offset in the document where the caret is at the time when a user performed an action resulting in the insertion of a line break (ie. where the currently processed KeyEvent happened). This may or may not be the same offset, where the line break will be inserted.

Returns:
The offset in the edited document.

getBreakInsertOffset

public int getBreakInsertOffset()
Gets the line break insertion offset. This is the offset in the document where the line break will be inserted.

Returns:
The offset in the edited document.

org.netbeans.modules.editor.lib2/1 1.43.1 10

Built on December 5 2011.  |  Portions Copyright 1997-2011 Sun Microsystems, Inc. All rights reserved.