org.eclipse.mylyn.wikitext.core.parser.markup
Class MarkupLanguageConfiguration

java.lang.Object
  extended by org.eclipse.mylyn.wikitext.core.parser.markup.MarkupLanguageConfiguration
All Implemented Interfaces:
Cloneable

public class MarkupLanguageConfiguration
extends Object
implements Cloneable

A configuration for a markup language, which enables client code to modify the syntax of the markup language by adding blocks, phrase modifiers, and tokens. Also provides a mechanism for disabling some common markup language features.

Since:
1.0
Author:
David Green

Constructor Summary
MarkupLanguageConfiguration()
           
 
Method Summary
 void addBlockExtensions(List<Block> blocks, List<Block> paragraphBreakingBlocks)
           
 void addPhraseModifierExtensions(MarkupLanguage.PatternBasedSyntax phraseModifierSyntax)
          Indicate if newlines in the markup must cause a line break.
 void addTokenExtensions(MarkupLanguage.PatternBasedSyntax tokenSyntax)
           
 MarkupLanguageConfiguration clone()
           
protected  int computeInsertPosition(Block block)
           
 List<Block> getBlocks()
           
 Locale getLocale()
          The locale to use for output, which may affect literals emitted into the output.
 List<PatternBasedElement> getPhraseModifiers()
           
 List<PatternBasedElement> getTokens()
           
 boolean isEnableUnwrappedParagraphs()
          indicate if unwrapped paragraphs should be supported.
 boolean isEscapingHtmlAndXml()
          Indicate if this language should escape HTML and XML tags.
 boolean isNewlinesMustCauseLineBreak()
          Indicate if newlines in the markup must cause a line break.
 boolean isOptimizeForRepositoryUsage()
          indicate if the markup syntax should be optimized for use with a task repository.
 boolean isParagraphBreaking(Block block)
          Indicate if the given block should break paragraph content even if there is no blank line preceding it.
 Boolean isWikiWordLinking()
          indicate if WikiWord linking should be enabled if the markup language supports it.
 void setEnableUnwrappedParagraphs(boolean enableUnwrappedParagraphs)
          indicate if unwrapped paragraphs should be supported.
 void setEscapingHtmlAndXml(boolean escapingHtmlAndXml)
          Indicate if this language should escape HTML and XML tags.
 void setLocale(Locale locale)
          The locale to use for output, which may affect literals emitted into the output.
 void setNewlinesMustCauseLineBreak(boolean newlinesMustCauseLineBreak)
          Indicate if newlines in the markup must cause a line break.
 void setOptimizeForRepositoryUsage(boolean optimizeForRepositoryUsage)
          indicate if the markup syntax should be optimized for use with a task repository.
 void setWikiWordLinking(Boolean wikiWordLinking)
          indicate if WikiWord linking should be enabled if the markup language supports it.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MarkupLanguageConfiguration

public MarkupLanguageConfiguration()
Method Detail

getTokens

public List<PatternBasedElement> getTokens()

getPhraseModifiers

public List<PatternBasedElement> getPhraseModifiers()

getBlocks

public List<Block> getBlocks()

isParagraphBreaking

public boolean isParagraphBreaking(Block block)
Indicate if the given block should break paragraph content even if there is no blank line preceding it. The default implementation returns true.

Parameters:
block - the block
Returns:
true if the block should break paragraph content

isEscapingHtmlAndXml

public boolean isEscapingHtmlAndXml()
Indicate if this language should escape HTML and XML tags. When HTML and XML tags are escaped they appear as literals in the page, rather than affecting the presentation. The default is false.


setEscapingHtmlAndXml

public void setEscapingHtmlAndXml(boolean escapingHtmlAndXml)
Indicate if this language should escape HTML and XML tags. When HTML and XML tags are escaped they appear as literals in the page, rather than affecting the presentation. The default is false.


isEnableUnwrappedParagraphs

public boolean isEnableUnwrappedParagraphs()
indicate if unwrapped paragraphs should be supported. Unwrapped paragraphs are those that are not nested in <p> or <div> tags. The default is true.


setEnableUnwrappedParagraphs

public void setEnableUnwrappedParagraphs(boolean enableUnwrappedParagraphs)
indicate if unwrapped paragraphs should be supported. Unwrapped paragraphs are those that are not nested in <p> or <div> tags. The default is true.


isNewlinesMustCauseLineBreak

public boolean isNewlinesMustCauseLineBreak()
Indicate if newlines in the markup must cause a line break. If false, then the default markup language behaviour should be observed. The default is false.


setNewlinesMustCauseLineBreak

public void setNewlinesMustCauseLineBreak(boolean newlinesMustCauseLineBreak)
Indicate if newlines in the markup must cause a line break. If false, then the default markup language behaviour should be observed. The default is false.


addPhraseModifierExtensions

public void addPhraseModifierExtensions(MarkupLanguage.PatternBasedSyntax phraseModifierSyntax)
Indicate if newlines in the markup must cause a line break. If false, then the default markup language behaviour should be observed. The default is false.


isOptimizeForRepositoryUsage

public boolean isOptimizeForRepositoryUsage()
indicate if the markup syntax should be optimized for use with a task repository.


setOptimizeForRepositoryUsage

public void setOptimizeForRepositoryUsage(boolean optimizeForRepositoryUsage)
indicate if the markup syntax should be optimized for use with a task repository.


isWikiWordLinking

public Boolean isWikiWordLinking()
indicate if WikiWord linking should be enabled if the markup language supports it. If null then the default markup language behaviour should be observed.

Since:
1.1

setWikiWordLinking

public void setWikiWordLinking(Boolean wikiWordLinking)
indicate if WikiWord linking should be enabled if the markup language supports it. If null then the default markup language behaviour should be observed.

Since:
1.1

getLocale

public Locale getLocale()
The locale to use for output, which may affect literals emitted into the output.

Returns:
configured locale or null if the default locale should be used
Since:
1.2

setLocale

public void setLocale(Locale locale)
The locale to use for output, which may affect literals emitted into the output.

Parameters:
locale - the locale or null if the default locale should be used
Since:
1.2

addBlockExtensions

public void addBlockExtensions(List<Block> blocks,
                               List<Block> paragraphBreakingBlocks)

computeInsertPosition

protected int computeInsertPosition(Block block)

addTokenExtensions

public void addTokenExtensions(MarkupLanguage.PatternBasedSyntax tokenSyntax)

clone

public MarkupLanguageConfiguration clone()
Overrides:
clone in class Object


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