org.netbeans.modules.editor.lib/3 3.23.0 19

org.netbeans.editor
Class MarkBlockChain

java.lang.Object
  extended by org.netbeans.editor.MarkBlockChain

public class MarkBlockChain
extends Object

Support class for chain of MarkBlocks


Field Summary
protected  MarkBlock chain
          Chain of all blocks
protected  MarkBlock currentBlock
          Current block to make checks faster
protected  BaseDocument doc
          Document for this block
static String PROP_BLOCKS_CHANGED
           
 
Constructor Summary
MarkBlockChain(BaseDocument doc)
          Construct chain using regular base marks
 
Method Summary
 void addBlock(int startPos, int endPos, boolean concat)
          Add non-empty block to the chain of blocks
 void addPropertyChangeListener(PropertyChangeListener l)
           
 int adjustToBlockEnd(int pos)
           
 int adjustToNextBlockStart(int pos)
          Return the position adjusted to the start of the next mark-block.
protected  MarkBlock checkedRemove(MarkBlock blk)
          Removes mark block and possibly updates the chain.
 int compareBlock(int startPos, int endPos)
          Tests whether the position range is partly or fully inside some mark block from the chain.
protected  MarkBlock createBlock(int startPos, int endPos)
           
protected  Mark createBlockEndMark()
           
protected  Mark createBlockStartMark()
           
 MarkBlock getChain()
           
 void removeBlock(int startPos, int endPos)
          Remove non-empty block from area covered by blocks from chain
 void removeEmptyBlocks()
           
 void removePropertyChangeListener(PropertyChangeListener l)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PROP_BLOCKS_CHANGED

public static final String PROP_BLOCKS_CHANGED
See Also:
Constant Field Values

chain

protected MarkBlock chain
Chain of all blocks


currentBlock

protected MarkBlock currentBlock
Current block to make checks faster


doc

protected BaseDocument doc
Document for this block

Constructor Detail

MarkBlockChain

public MarkBlockChain(BaseDocument doc)
Construct chain using regular base marks

Method Detail

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener l)

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener l)

getChain

public final MarkBlock getChain()

compareBlock

public int compareBlock(int startPos,
                        int endPos)
Tests whether the position range is partly or fully inside some mark block from the chain.

Parameters:
startPos - starting position of tested area
endPos - ending position of tested area for removal or same as startPos when insert is made
Returns:
relation of currentBlock to the given block

removeEmptyBlocks

public void removeEmptyBlocks()

createBlock

protected MarkBlock createBlock(int startPos,
                                int endPos)
                         throws BadLocationException
Throws:
BadLocationException

createBlockStartMark

protected Mark createBlockStartMark()

createBlockEndMark

protected Mark createBlockEndMark()

addBlock

public void addBlock(int startPos,
                     int endPos,
                     boolean concat)
Add non-empty block to the chain of blocks

Parameters:
concat - whether concatenate adjacent blocks

removeBlock

public void removeBlock(int startPos,
                        int endPos)
Remove non-empty block from area covered by blocks from chain


checkedRemove

protected MarkBlock checkedRemove(MarkBlock blk)
Removes mark block and possibly updates the chain.

Returns:
next block after removed one

adjustToBlockEnd

public int adjustToBlockEnd(int pos)

adjustToNextBlockStart

public int adjustToNextBlockStart(int pos)
Return the position adjusted to the start of the next mark-block.


toString

public String toString()
Overrides:
toString in class Object

org.netbeans.modules.editor.lib/3 3.23.0 19

Built on May 22 2012.  |  Portions Copyright 1997-2012 Oracle. All rights reserved.