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

Mark (Editor Library) - NetBeans API Javadoc (Current Development Version)

org.netbeans.modules.editor.lib/1 1.14.0 3

org.netbeans.editor
Class Mark

java.lang.Object
  extended by org.netbeans.editor.Mark
Direct Known Subclasses:
MarkFactory.ContextMark, MarkFactory.SyntaxMark

public class Mark
extends Object

Class defining basic type of mark. This is a mark used most frequently. It's instances are inserted into the leaf plane of the tree.


Constructor Summary
Mark()
          Construct new mark with forward bias.
Mark(boolean backwardBias)
          Construct new mark.
Mark(Position.Bias bias)
           
 
Method Summary
 int compare(int pos)
          Compare this mark to some position.
 void dispose()
          Mark will no longer represent a valid place in the document.
 boolean getBackwardBias()
           
 Position.Bias getBias()
           
 boolean getInsertAfter()
          Deprecated.  
 int getLine()
          Get the line number of this mark
 int getOffset()
          Get the position of this mark
 boolean isValid()
           
 void remove()
          Remove mark from the structure holding the marks.
protected  void removeUpdateAction(int pos, int len)
          Deprecated. It will not be supported in the future.
 String toString()
          Get info about Mark.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Mark

public Mark()
Construct new mark with forward bias.


Mark

public Mark(Position.Bias bias)

Mark

public Mark(boolean backwardBias)
Construct new mark.

Parameters:
backwardBias - whether the inserts performed right at the position of this mark will go after this mark i.e. this mark will not move forward when inserting right at its position. This flag corresponds to Position.Bias.Backward.
Method Detail

getOffset

public final int getOffset()
                    throws InvalidMarkException
Get the position of this mark

Throws:
InvalidMarkException

getLine

public final int getLine()
                  throws InvalidMarkException
Get the line number of this mark

Throws:
InvalidMarkException

getInsertAfter

public final boolean getInsertAfter()
Deprecated. 

Get the insertAfter flag. Replaced by getBackwardBias()


getBackwardBias

public final boolean getBackwardBias()
Returns:
true if the mark has backward bias or false if it has forward bias.

getBias

public final Position.Bias getBias()
Returns:
the bias of this mark. It will be either Position.Bias.Forward or Position.Bias.Backward.

dispose

public final void dispose()
Mark will no longer represent a valid place in the document. Although it will not be removed from the structure that holds the marks it will be done later automatically.


remove

public final void remove()
                  throws InvalidMarkException
Remove mark from the structure holding the marks. The mark can be inserted again into some document.

Throws:
InvalidMarkException

compare

public final int compare(int pos)
                  throws InvalidMarkException
Compare this mark to some position.

Parameters:
pos - tested position
Returns:
zero - if the marks have the same position less than zero - if this mark is before the position greater than zero - if this mark is after the position
Throws:
InvalidMarkException

removeUpdateAction

protected void removeUpdateAction(int pos,
                                  int len)
Deprecated. It will not be supported in the future.

This function is called from removeUpdater when mark occupies the removal area. The mark can decide what to do next. If it doesn't redefine this method it will be simply moved to the begining of removal area. It is valid to add or remove other mark from this method. It is even possible (but not very useful) to add the mark to the removal area. However that mark will not be notified about current removal.


isValid

public final boolean isValid()
Returns:
true if this mark is currently inserted in the document or false otherwise.

toString

public String toString()
Get info about Mark.

Overrides:
toString in class Object

org.netbeans.modules.editor.lib/1 1.14.0 3

Built on May 28 2007.  |  Portions Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.