Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| org.openide.text 6.9.22
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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.

Field Summary

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

    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)`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| org.openide.text 6.9.22
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Built on December 7 2006. | Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.