站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc 4.1.0

NbDocument.PositionBiasable (NetBeans APIs) - NetBeans API Javadoc 4.1.0


org.openide.text
Interface NbDocument.PositionBiasable

All Superinterfaces:
Document
Enclosing interface:
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

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 May 4 2005.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.