org.eclipse.mylyn.internal.wikitext.confluence.core.block
Class TableBlock

java.lang.Object
  extended by org.eclipse.mylyn.wikitext.core.parser.markup.Processor
      extended by org.eclipse.mylyn.wikitext.core.parser.markup.Block
          extended by org.eclipse.mylyn.internal.wikitext.confluence.core.block.TableBlock
All Implemented Interfaces:
Cloneable

public class TableBlock
extends Block

Table block, matches blocks that start with table. or those that start with a table row.

Author:
David Green

Field Summary
protected  int blockLineCount
           
protected  int builderLevel
           
protected  int colCount
           
protected  int headerColCount
           
protected  boolean isHeaderRow
           
protected  int rowCount
           
 
Fields inherited from class org.eclipse.mylyn.wikitext.core.parser.markup.Processor
builder, markupLanguage, parser, state
 
Constructor Summary
TableBlock()
           
 
Method Summary
 boolean beginNesting()
          Indicate if block nesting should begin.
 boolean canStart(String line, int lineOffset)
          Indicate if the block can start with the given markup line at the provided offset.
 Block clone()
          Clone the block including its state.
protected  boolean closeToLevel(org.eclipse.mylyn.internal.wikitext.confluence.core.block.TableBlock.State targetState)
           
 int findCloseOffset(String line, int lineOffset)
          Indicate if the block can close on the given line at the given offset.
 boolean isNestingEnabled()
           
 int processLineContent(String line, int offset)
          Process the given line of markup starting at the provided offset.
 void setClosed(boolean closed)
          Cause the block to be closed.
 
Methods inherited from class org.eclipse.mylyn.wikitext.core.parser.markup.Block
isClosed, processLine
 
Methods inherited from class org.eclipse.mylyn.wikitext.core.parser.markup.Processor
getBuilder, getMarkupLanguage, getParser, getState, setParser, setState
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

blockLineCount

protected int blockLineCount

builderLevel

protected int builderLevel

rowCount

protected int rowCount

headerColCount

protected int headerColCount

colCount

protected int colCount

isHeaderRow

protected boolean isHeaderRow
Constructor Detail

TableBlock

public TableBlock()
Method Detail

processLineContent

public int processLineContent(String line,
                              int offset)
Description copied from class: Block
Process the given line of markup starting at the provided offset.

Specified by:
processLineContent in class Block
Parameters:
line - the markup line to process
offset - the offset at which to start processing
Returns:
a non-negative integer to indicate that processing of the block completed before the end of the line, or -1 if the entire line was processed.

canStart

public boolean canStart(String line,
                        int lineOffset)
Description copied from class: Block
Indicate if the block can start with the given markup line at the provided offset. Calling this method may cause the block to have state which is propagated when cloning and consumed in #processLine(String, int, int). Calling this method must cause any previous state to be reset. Note that it is valid for block implementations to refuse to start at non-zero offsets. Implementations must be able to handle this method without having the processor state initialized.

Specified by:
canStart in class Block
Parameters:
line - the line of markup to test
lineOffset - the offset at which the block should start processing
Returns:
true if the provided markup consists of a valid starting point for the block

setClosed

public void setClosed(boolean closed)
Description copied from class: Block
Cause the block to be closed. If the block is going from the open to the closed state, then the block must cause the closed state to be propagated to the builder if necessary.

Overrides:
setClosed in class Block

beginNesting

public boolean beginNesting()
Description copied from class: Block
Indicate if block nesting should begin. Called after Block.processLineContent(String, int).

Overrides:
beginNesting in class Block
Returns:
true if nesting should start, otherwise false.
See Also:
Block.findCloseOffset(String, int)

isNestingEnabled

public boolean isNestingEnabled()

findCloseOffset

public int findCloseOffset(String line,
                           int lineOffset)
Description copied from class: Block
Indicate if the block can close on the given line at the given offset. blocks that implement a nesting protocol must implement this method.

Overrides:
findCloseOffset in class Block
Parameters:
line - the line of content
lineOffset - the 0-based offset into the line
Returns:
the 0-based offset where the close will occur, or -1 if the block should not close on this line.
See Also:
Block.beginNesting()

clone

public Block clone()
Description copied from class: Block
Clone the block including its state. Cloning is generally used after the Block.canStart(String, int) method is called in order to implement the Template design pattern.

Overrides:
clone in class Block

closeToLevel

protected boolean closeToLevel(org.eclipse.mylyn.internal.wikitext.confluence.core.block.TableBlock.State targetState)


Copyright © 2011 FuseSource, Corp.. All Rights Reserved.