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

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.ParameterizedBlock
              extended by org.eclipse.mylyn.internal.wikitext.confluence.core.block.TableOfContentsBlock
All Implemented Interfaces:
Cloneable

public class TableOfContentsBlock
extends ParameterizedBlock

Author:
David Green

Field Summary
 
Fields inherited from class org.eclipse.mylyn.wikitext.core.parser.markup.Processor
builder, markupLanguage, parser, state
 
Constructor Summary
TableOfContentsBlock()
           
 
Method Summary
 boolean canStart(String line, int lineOffset)
          Indicate if the block can start with the given markup line at the provided offset.
 int getMaxLevel()
           
 String getStyle()
           
 int processLineContent(String line, int offset)
          Process the given line of markup starting at the provided offset.
 void setMaxLevel(int maxLevel)
           
protected  void setOption(String key, String value)
          Set an option with key and value pair
 void setStyle(String style)
           
 
Methods inherited from class org.eclipse.mylyn.internal.wikitext.confluence.core.block.ParameterizedBlock
setOption, setOptions
 
Methods inherited from class org.eclipse.mylyn.wikitext.core.parser.markup.Block
beginNesting, clone, findCloseOffset, isClosed, processLine, setClosed
 
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
 

Constructor Detail

TableOfContentsBlock

public TableOfContentsBlock()
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

getStyle

public String getStyle()

setStyle

public void setStyle(String style)

getMaxLevel

public int getMaxLevel()

setMaxLevel

public void setMaxLevel(int maxLevel)

setOption

protected void setOption(String key,
                         String value)
Description copied from class: ParameterizedBlock
Set an option with key and value pair

Specified by:
setOption in class ParameterizedBlock
Parameters:
key - the key of the option
value - the value of the option
See Also:
ParameterizedBlock.setOption(String)


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