Package org.apache.wiki.diff

## Class ContextualDiffProvider

- java.lang.Object
- - org.apache.wiki.diff.ContextualDiffProvider

All Implemented Interfaces:
  `WikiProvider`, `DiffProvider`

    public class ContextualDiffProvider
    extends java.lang.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
`static java.lang.String` `ALTERNATING_SPACE_HTML`
`static java.lang.String` `CHANGE_END_HTML`
`static java.lang.String` `CHANGE_START_HTML`
`static java.lang.String` `DELETION_END_HTML`
`static java.lang.String` `DELETION_START_HTML`
`static java.lang.String` `DIFF_END`
`static java.lang.String` `DIFF_START`
`static java.lang.String` `ELIDED_HEAD_INDICATOR_HTML`
`static java.lang.String` `ELIDED_TAIL_INDICATOR_HTML`
`static java.lang.String` `INSERTION_END_HTML`
`static java.lang.String` `INSERTION_START_HTML`
`static java.lang.String` `LINE_BREAK_HTML`
`boolean` `m_emitChangeNextPreviousHyperlinks`
`static java.lang.String` `PROP_UNCHANGED_CONTEXT_LIMIT` A 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
`ContextualDiffProvider()` Constructs this provider.

### Method Summary

All Methods Instance Methods Concrete Methods
`java.lang.String` `getProviderInfo()`
`void` `initialize​(Engine engine, java.util.Properties properties)`
`java.lang.String` `makeDiffHtml​(Context ctx, java.lang.String wikiOld, java.lang.String wikiNew)` Do a colored diff of the two regions.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### PROP_UNCHANGED_CONTEXT_LIMIT

    public static final java.lang.String 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

    public boolean m_emitChangeNextPreviousHyperlinks

#### CHANGE_START_HTML

    public static java.lang.String CHANGE_START_HTML

#### CHANGE_END_HTML

    public static java.lang.String CHANGE_END_HTML

#### DIFF_START

    public static java.lang.String DIFF_START

#### DIFF_END

    public static java.lang.String DIFF_END

#### INSERTION_START_HTML

    public static java.lang.String INSERTION_START_HTML

#### INSERTION_END_HTML

    public static java.lang.String INSERTION_END_HTML

#### DELETION_START_HTML

    public static java.lang.String DELETION_START_HTML

#### DELETION_END_HTML

    public static java.lang.String DELETION_END_HTML

#### ELIDED_HEAD_INDICATOR_HTML

    public static java.lang.String ELIDED_HEAD_INDICATOR_HTML

#### ELIDED_TAIL_INDICATOR_HTML

    public static java.lang.String ELIDED_TAIL_INDICATOR_HTML

#### LINE_BREAK_HTML

    public static java.lang.String LINE_BREAK_HTML

#### ALTERNATING_SPACE_HTML

    public static java.lang.String ALTERNATING_SPACE_HTML

### Constructor Detail

#### ContextualDiffProvider

    public ContextualDiffProvider()

Constructs this provider.

### Method Detail

#### getProviderInfo

    public java.lang.String getProviderInfo()

Specified by:
  `getProviderInfo` in interface `WikiProvider`
See Also:
  `WikiProvider.getProviderInfo()`

#### initialize

    public void initialize​(Engine engine,
                           java.util.Properties properties)
                    throws NoRequiredPropertyException,
                           java.io.IOException

Specified by:
  `initialize` in interface `WikiProvider`
Throws:
  `NoRequiredPropertyException`
  `java.io.IOException`
See Also:
  `WikiProvider.initialize(org.apache.wiki.api.core.Engine, java.util.Properties)`

#### makeDiffHtml

    public java.lang.String makeDiffHtml​(Context ctx,
                                         java.lang.String wikiOld,
                                         java.lang.String wikiNew)

Do a colored diff of the two regions. This. is. serious. fun. ;-)

Specified by:
  `makeDiffHtml` in interface `DiffProvider`
Parameters:
  `ctx` - The Wiki Context
  `wikiOld` - the old text
  `wikiNew` - the new text
Returns:
  An XHTML diff.
See Also:
  `DiffProvider.makeDiffHtml(Context, String, String)`