Package org.apache.wiki.diff
Class ContextualDiffProvider
java.lang.Object
org.apache.wiki.diff.ContextualDiffProvider
- All Implemented Interfaces:
WikiProvider,DiffProvider
public class ContextualDiffProvider extends Object implements DiffProvider
A seriously better diff provider, which highlights changes word-by-word using CSS.
Suggested by John Volkar.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.wiki.diff.DiffProvider
DiffProvider.NullDiffProvider -
Field Summary
Fields Modifier and Type Field Description static StringALTERNATING_SPACE_HTMLstatic StringCHANGE_END_HTMLstatic StringCHANGE_START_HTMLstatic StringDELETION_END_HTMLstatic StringDELETION_START_HTMLstatic StringDIFF_ENDstatic StringDIFF_STARTstatic StringELIDED_HEAD_INDICATOR_HTMLstatic StringELIDED_TAIL_INDICATOR_HTMLstatic StringINSERTION_END_HTMLstatic StringINSERTION_START_HTMLstatic StringLINE_BREAK_HTMLbooleanm_emitChangeNextPreviousHyperlinksstatic StringPROP_UNCHANGED_CONTEXT_LIMITA jspwiki.properties value to define how many characters are shown around the change context.Fields inherited from interface org.apache.wiki.api.providers.WikiProvider
LATEST_VERSION -
Constructor Summary
Constructors Constructor Description ContextualDiffProvider()Constructs this provider. -
Method Summary
Modifier and Type Method Description StringgetProviderInfo()Return a valid HTML string for information.voidinitialize(Engine engine, Properties properties)Initializes the page provider.StringmakeDiffHtml(Context ctx, String wikiOld, String wikiNew)Do a colored diff of the two regions.
-
Field Details
-
PROP_UNCHANGED_CONTEXT_LIMIT
A jspwiki.properties value to define how many characters are shown around the change context. The current value is "jspwiki.contextualDiffProvider.unchangedContextLimit".- See Also:
- Constant Field Values
-
m_emitChangeNextPreviousHyperlinks
-
CHANGE_START_HTML
-
CHANGE_END_HTML
-
DIFF_START
-
DIFF_END
-
INSERTION_START_HTML
-
INSERTION_END_HTML
-
DELETION_START_HTML
-
DELETION_END_HTML
-
ELIDED_HEAD_INDICATOR_HTML
-
ELIDED_TAIL_INDICATOR_HTML
-
LINE_BREAK_HTML
-
ALTERNATING_SPACE_HTML
-
-
Constructor Details
-
ContextualDiffProvider
public ContextualDiffProvider()Constructs this provider.
-
-
Method Details
-
getProviderInfo
Description copied from interface:WikiProviderReturn a valid HTML string for information. May be anything.- Specified by:
getProviderInfoin interfaceWikiProvider- Returns:
- A string describing the provider.
- See Also:
WikiProvider.getProviderInfo()
-
initialize
public void initialize(Engine engine, Properties properties) throws NoRequiredPropertyException, IOExceptionDescription copied from interface:WikiProviderInitializes the page provider.- Specified by:
initializein interfaceWikiProvider- Parameters:
engine- Engine to own this providerproperties- A set of properties used to initialize this provider- Throws:
NoRequiredPropertyException- If the provider needs a property which is not found in the property setIOException- If there is an IO problem- See Also:
WikiProvider.initialize(org.apache.wiki.api.core.Engine, java.util.Properties)
-
makeDiffHtml
Do a colored diff of the two regions. This. is. serious. fun. ;-)- Specified by:
makeDiffHtmlin interfaceDiffProvider- Parameters:
ctx- The Wiki ContextwikiOld- the old textwikiNew- the new text- Returns:
- An XHTML diff.
- See Also:
DiffProvider.makeDiffHtml(Context, String, String)
-