org.openide.text
Interface NbDocument.PositionBiasable

All Superinterfaces:
Document
Enclosing class:
NbDocument

public static interface NbDocument.PositionBiasable
extends Document

Enhanced version of document that provides better support for holding and working with biased positions. It adds one new method createPosition(int, javax.swing.text.Position.Bias) that creates a position that moves either to the left or to the right when an insertion is performed at it.

If a document implements this interface, the new method is used in NbDocument.createPosition(javax.swing.text.Document, int, javax.swing.text.Position.Bias). If not, special support for the position is created.


Fields inherited from interface javax.swing.text.Document
StreamDescriptionProperty, TitleProperty
 
Method Summary
 Position createPosition(int offset, Position.Bias bias)
          Creates position with a bias.
 
Methods inherited from interface javax.swing.text.Document
addDocumentListener, addUndoableEditListener, createPosition, getDefaultRootElement, getEndPosition, getLength, getProperty, getRootElements, getStartPosition, getText, getText, insertString, putProperty, remove, removeDocumentListener, removeUndoableEditListener, render
 

Method Detail

createPosition

public Position createPosition(int offset,
                               Position.Bias bias)
                        throws BadLocationException
Creates position with a bias. If the bias is Position.Bias.Backward then if an insert occures at the position, the text is inserted after the position. If the bias is Forward, then the text is inserted before the position.
Parameters:
offset - the offset for the position
bias - the bias to use for the position
Throws:
BadLocationException - if the offset is invalid
See Also:
NbDocument.createPosition(javax.swing.text.Document, int, javax.swing.text.Position.Bias)


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