com.starteam.diff
Class HTMLDiffWriter

java.lang.Object
  extended by com.starteam.diff.EditListWriter
      extended by com.starteam.diff.HTMLDiffWriter
Direct Known Subclasses:
HTMLTableDiffWriter

public class HTMLDiffWriter
extends EditListWriter

Writes a simple HTML page showing the differences between two text files.


Field Summary
static int DEFAULT_SPACES_PER_TAB
          The default number of spaces per tab character (currently 4).
 
Constructor Summary
HTMLDiffWriter(ParsedCharSequence source, ParsedCharSequence target, java.io.File output)
          Constructs a simple HTMLDiffWriter, writing output to the specified file.
HTMLDiffWriter(ParsedCharSequence source, ParsedCharSequence target, java.io.Writer output)
          Constructs a simple HTMLDiffWriter, writing output to the specified Writer.
 
Method Summary
 void deleteLines(int sourceStart, int targetStart, int length)
          called when lines are deleted
 void finish()
          called when the last lines are being processed
 java.lang.String getAddedSymbolHTML()
          Gets the HTML text used to draw the symbol that indicates an "added" line.
 java.lang.String getApplicationFooterHTML()
          Gets application-specific HTML text to be drawn at the bottom of the output HTML page.
 java.lang.String getApplicationHeaderHTML()
          Gets application-specific HTML text to be drawn at the top of the output HTML page.
 java.lang.String getCRHTML()
          Returns the string representation of the Carriage-return character in the HTML document.
 java.lang.String getDeletedSymbolHTML()
          Gets the HTML text used to draw the symbol that indicates a "deleted" line.
 boolean getEmbedDefaultStyles()
          Determines whether or not a default style sheet is embedded in the HTML document.
 java.lang.String getGotoBlankHTML()
          Gets the HTML text used to draw whitespace the same width as a naviation control.
 java.lang.String getGotoBottomHTML()
          Gets the HTML text used to draw the navigation symbol that jumps to the bottom of the output page.
 java.lang.String getGotoFirstDiffHTML()
          Gets the HTML text used to draw the navigation symbol that jumps to the first difference on the output page.
 java.lang.String getGotoLastDiffHTML()
          Gets the HTML text used to draw the navigation symbol that jumps to the last difference on the output page.
 java.lang.String getGotoNextDiffHTML()
          Gets the HTML text used to draw the navigation symbol that jumps to the next difference on the output page.
 java.lang.String getGotoPrevDiffHTML()
          Gets the HTML text used to draw the navigation symbol that jumps to the previous difference on the output page.
 java.lang.String getGotoTopHTML()
          Gets the HTML text used to draw the navigation symbol that jumps to the top of the output page.
 java.lang.String getInlineDeleteMarkHTML()
          Gets the HTML text used to mark an in-line deletion point within a source line.
 java.lang.String getInlineInsertMarkHTML()
          Gets the HTML text used to mark an in-line insertion point within a source line.
 java.lang.String getLFHTML()
          Returns the string representation of the line-feed character in the HTML document.
 boolean getNavigateOnEveryChangedLine()
          Indicates whether or not navigation symbols will be drawn on every changed line.
 int getNumContextLines()
          Gets the maximum number of unchanged lines displayed before and after each changed line.
 java.lang.String getPageBaseURL()
          Gets the base URL of the output HTML page.
 java.lang.String getPageTitle()
          Gets the title of the output HTML page.
 java.lang.String getReplacedSymbolHTML()
          Gets the HTML text used to draw the symbol that indicates a "replaced" line.
 boolean getShowEOLs()
          Indicates whether or not "replaced" lines show markup within the line.
 boolean getShowInlineDiffs()
          Indicates whether or not "replaced" lines show markup within the line.
 boolean getShowLineNumbers()
          Determines whether or not line numbers are embedded in the HTML document.
 boolean getShowUnchangedLines()
          Determines whether or not unchanged lines are displayed in the HTML document.
 java.lang.String getSourceFileHTML()
          Gets the HTML text used to display the name of the source file on the output page.
 java.lang.String getSourceFileURL()
          Gets the URL used to link to the source file from the output HTML page.
 int getSpacesPerTab()
          Gets the number of spaces per tab character.
 java.lang.String getStyleSheetURL()
          The URL used to reference a linked style sheet.
 java.lang.String getTargetFileHTML()
          Gets the HTML text used to display the name of the target file on the output page.
 java.lang.String getTargetFileURL()
          Gets the URL used to link to the target file from the output HTML page.
 java.lang.String getUnchangedSymbolHTML()
          Gets the HTML text used to draw the symbol that indicates an "unchanged" line.
 void insertLines(int sourceStart, int targetStart, int length)
          called when lines are inserted
 void replaceLines(int sourcePos, int sourceLen, int targetPos, int targetLen)
          Called when lines in the source are replaced by lines in the target.
 void setAddedSymbolHTML(java.lang.String strHTML)
          Sets the HTML text used to draw the symbol that indicates an "added" line.
 void setApplicationFooterHTML(java.lang.String strHTML)
          Sets application-specific HTML text to be drawn at the bottom of the output HTML page.
 void setApplicationHeaderHTML(java.lang.String strHTML)
          Sets application-specific HTML text to be drawn at the top of the output HTML page.
 void setCRHTML(java.lang.String strCRHTML)
          Sets the representation of the carriage-return character in the HTML document.
 void setDeletedSymbolHTML(java.lang.String strHTML)
          Sets the HTML text used to draw the symbol that indicates a "deleted" line.
 void setEmbedDefaultStyles(boolean bEmbed)
          Determines whether or not a default style sheet is embedded in the HTML document.
 void setGotoBlankHTML(java.lang.String strHTML)
          Sets the HTML text used to draw whitespace the same width as a naviation control.
 void setGotoBottomHTML(java.lang.String strHTML)
          Sets the HTML text used to draw the navigation symbol that jumps to the bottom of the output page.
 void setGotoFirstDiffHTML(java.lang.String strHTML)
          Sets the HTML text used to draw the navigation symbol that jumps to the first difference on the output page.
 void setGotoLastDiffHTML(java.lang.String strHTML)
          Sets the HTML text used to draw the navigation symbol that jumps to the last difference on the output page.
 void setGotoNextDiffHTML(java.lang.String strHTML)
          Sets the HTML text used to draw the navigation symbol that jumps to the next difference on the output page.
 void setGotoPrevDiffHTML(java.lang.String strHTML)
          Sets the HTML text used to draw the navigation symbol that jumps to the previous difference on the output page.
 void setGotoTopHTML(java.lang.String strHTML)
          Sets the HTML text used to draw the navigation symbol that jumps to the top of the output page.
 void setInlineDeleteMarkHTML(java.lang.String strHTML)
          Sets the HTML text used to mark an in-line deletion point within a source line.
 void setInlineInsertMarkHTML(java.lang.String strHTML)
          Sets the HTML text used to mark an in-line insertion point within a source line.
 void setLFHTML(java.lang.String strLFHTML)
          Sets the representation of the line-feed character in the HTML document.
 void setNavigateOnEveryChangedLine(boolean bEveryLine)
          Determines whether or not navigation symbols will be drawn on every changed line.
 void setNumContextLines(int nContextLines)
          Sets the maximum number of unchanged lines displayed before and after each changed line.
 void setPageBaseURL(java.lang.String strURL)
          Sets the base URL of the output HTML page.
 void setPageTitle(java.lang.String strTitle)
          Sets the title of the output HTML page.
 void setReplacedSymbolHTML(java.lang.String strHTML)
          Sets the HTML text used to draw the symbol that indicates a "replaced" line.
 void setShowEOLs(boolean bShow)
          Sets to flag whether or not EOL characters are displayed in the HTML document when compared differently.
 void setShowInlineDiffs(boolean bShow)
          Determines whether or not "replaced" lines show markup within the line.
 void setShowLineNumbers(boolean bShowLineNumbers)
          Sets to flag whether or not line numbers are embedded in the HTML document.
 void setShowUnchangedLines(boolean bShowUnchangedLines)
          Sets to flag whether or not unchanged lines are displayed in the HTML document.
 void setSourceFileHTML(java.lang.String strHTML)
          Sets the HTML text used to display the name of the source file on the output page.
 void setSourceFileURL(java.lang.String strURL)
          Sets the URL used to link to the source file from the output HTML page.
 void setSpacesPerTab(int nSpaces)
          Sets the number of spaces per tab character.
 void setStyleSheetURL(java.lang.String strURL)
          The URL used to reference a linked style sheet.
 void setTargetFileHTML(java.lang.String strHTML)
          Sets the HTML text used to display the name of the target file on the output page.
 void setTargetFileURL(java.lang.String strURL)
          Sets the URL used to link to the target file from the output HTML page.
 void setUnchangedSymbolHTML(java.lang.String strHTML)
          Sets the HTML text used to draw the symbol that indicates an "unchanged" line.
static void simpleDiff(java.io.File source, java.io.File target, java.io.File output)
          Compares two text files, and generates a simple HTML file describing the differences.
 void start()
          Called to tell writer where it can get the source for the lines.
 void unchangedLines(int sourceStart, int targetStart, int length)
          When an original line from the source carries over into the rebuilt output
 
Methods inherited from class com.starteam.diff.EditListWriter
write
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_SPACES_PER_TAB

public static final int DEFAULT_SPACES_PER_TAB
The default number of spaces per tab character (currently 4).

See Also:
Constant Field Values
Constructor Detail

HTMLDiffWriter

public HTMLDiffWriter(ParsedCharSequence source,
                      ParsedCharSequence target,
                      java.io.File output)
               throws java.io.IOException
Constructs a simple HTMLDiffWriter, writing output to the specified file.

Parameters:
source - A parsed representation of the source text file.
target - A parsed representation of the target text file.
output - The output file to generate.
Throws:
java.io.IOException
See Also:
ParsedCharSequence

HTMLDiffWriter

public HTMLDiffWriter(ParsedCharSequence source,
                      ParsedCharSequence target,
                      java.io.Writer output)
Constructs a simple HTMLDiffWriter, writing output to the specified Writer.

Parameters:
source - A parsed representation of the source text file.
target - A parsed representation of the target text file.
output - The output stream.
See Also:
ParsedCharSequence
Method Detail

setPageTitle

public void setPageTitle(java.lang.String strTitle)
Sets the title of the output HTML page. By default, the page has no title.

Parameters:
strTitle - The title of the output HTML page.

getPageTitle

public java.lang.String getPageTitle()
Gets the title of the output HTML page.

Returns:
The title of the output HTML page.

setPageBaseURL

public void setPageBaseURL(java.lang.String strURL)
Sets the base URL of the output HTML page.

The base URL used to resolve links and references to external sources such as images and style sheets.

By default, no explicit base URL is specified, meaning that external references are resolved realtive to the output page.

Parameters:
strURL - The base URL of the output HTML page.

getPageBaseURL

public java.lang.String getPageBaseURL()
Gets the base URL of the output HTML page.

Returns:
The base URL of the output HTML page.

setSourceFileHTML

public void setSourceFileHTML(java.lang.String strHTML)
Sets the HTML text used to display the name of the source file on the output page. "Source File" is used by default.

Parameters:
strHTML - The HTML text used to display the name of the source file on the output page.

getSourceFileHTML

public java.lang.String getSourceFileHTML()
Gets the HTML text used to display the name of the source file on the output page.

Returns:
The HTML text used to display the name of the source file on the output page.
See Also:
HTMLDiffWriter.getTargetFileHTML()

setTargetFileHTML

public void setTargetFileHTML(java.lang.String strHTML)
Sets the HTML text used to display the name of the target file on the output page. "Target File" is used by default.

Parameters:
strHTML - The HTML text used to display the name of the target file on the output page.

getTargetFileHTML

public java.lang.String getTargetFileHTML()
Gets the HTML text used to display the name of the target file on the output page.

Returns:
The HTML text used to display the name of the target file on the output page.
See Also:
HTMLDiffWriter.getTargetFileHTML()

setSourceFileURL

public void setSourceFileURL(java.lang.String strURL)
Sets the URL used to link to the source file from the output HTML page. If no URL is provided, then no links to the source file will appear on the page.

Parameters:
strURL - The URL used to link to the source file from the output HTML page, or null if no links to the source file should be created.

getSourceFileURL

public java.lang.String getSourceFileURL()
Gets the URL used to link to the source file from the output HTML page.

Returns:
The URL used to link to the source file from the output HTML page, or null if no links to the source file should be created.
See Also:
HTMLDiffWriter.getTargetFileURL(), HTMLDiffWriter.getPageBaseURL()

setTargetFileURL

public void setTargetFileURL(java.lang.String strURL)
Sets the URL used to link to the target file from the output HTML page. If no URL is provided, then no links to the target file will appear on the page.

Parameters:
strURL - The URL used to link to the target file from the output HTML page, or null if no links to the target file should be created.

getTargetFileURL

public java.lang.String getTargetFileURL()
Gets the URL used to link to the target file from the output HTML page.

Returns:
The URL used to link to the target file from the output HTML page, or null if no links to the target file should be created.
See Also:
HTMLDiffWriter.getSourceFileURL(), HTMLDiffWriter.getPageBaseURL()

setApplicationHeaderHTML

public void setApplicationHeaderHTML(java.lang.String strHTML)
Sets application-specific HTML text to be drawn at the top of the output HTML page.

Parameters:
strHTML - Application-specific HTML text to be drawn at the top of the output HTML page.

getApplicationHeaderHTML

public java.lang.String getApplicationHeaderHTML()
Gets application-specific HTML text to be drawn at the top of the output HTML page.

Returns:
Application-specific HTML text to be drawn at the top of the output HTML page.
See Also:
HTMLDiffWriter.getApplicationFooterHTML()

setApplicationFooterHTML

public void setApplicationFooterHTML(java.lang.String strHTML)
Sets application-specific HTML text to be drawn at the bottom of the output HTML page.

Parameters:
strHTML - Application-specific HTML text to be drawn at the bottom of the output HTML page.

getApplicationFooterHTML

public java.lang.String getApplicationFooterHTML()
Gets application-specific HTML text to be drawn at the bottom of the output HTML page.

Returns:
Application-specific HTML text to be drawn at the bottom of the output HTML page.
See Also:
HTMLDiffWriter.getApplicationHeaderHTML()

setEmbedDefaultStyles

public void setEmbedDefaultStyles(boolean bEmbed)
Determines whether or not a default style sheet is embedded in the HTML document.

Parameters:
bEmbed - true (the default) to embed a default style sheet in the HTML output; false to insert a link to an external style sheet file.

getEmbedDefaultStyles

public boolean getEmbedDefaultStyles()
Determines whether or not a default style sheet is embedded in the HTML document.

Returns:
true (the default) to embed a default style sheet in the HTML output; false to insert a link to an external style sheet file.
See Also:
HTMLDiffWriter.getStyleSheetURL()

setStyleSheetURL

public void setStyleSheetURL(java.lang.String strURL)
The URL used to reference a linked style sheet. Ignored if getEmbedDefaultStyles() is true. The default URL used to reference an linked style sheet is "diff.css".

Parameters:
strURL - The URL used to reference a linked style sheet.

getStyleSheetURL

public java.lang.String getStyleSheetURL()
The URL used to reference a linked style sheet. Ignored if getEmbedDefaultStyles() is true. The default URL used to reference an linked style sheet is "diff.css".

Returns:
The URL used to reference a linked style sheet.
See Also:
HTMLDiffWriter.getEmbedDefaultStyles(), HTMLDiffWriter.getPageBaseURL()

setShowInlineDiffs

public void setShowInlineDiffs(boolean bShow)
Determines whether or not "replaced" lines show markup within the line.

Parameters:
bShow - true (the default) if "replaced" lines show markup within the line; false if each replaced line is shown as an inserted line followed by a deleted line.

getShowInlineDiffs

public boolean getShowInlineDiffs()
Indicates whether or not "replaced" lines show markup within the line.

Returns:
true (the default) if "replaced" lines show markup within the line; false if each replaced line is shown as an inserted line followed by a deleted line.

setSpacesPerTab

public void setSpacesPerTab(int nSpaces)
Sets the number of spaces per tab character. The default is currently 4.

Parameters:
nSpaces - The number of space characters represented by a single tab character, or zero if tabs are not expanded to spaces in the HTML output.

getSpacesPerTab

public int getSpacesPerTab()
Gets the number of spaces per tab character.

Returns:
The number of space characters represented by a single tab character, or zero if tabs are not expanded to spaces in the HTML output.
See Also:
HTMLDiffWriter.DEFAULT_SPACES_PER_TAB

setGotoTopHTML

public void setGotoTopHTML(java.lang.String strHTML)
Sets the HTML text used to draw the navigation symbol that jumps to the top of the output page.

Parameters:
strHTML - The HTML text used to draw the navigation symbol that jumps to the top of the output page.

getGotoTopHTML

public java.lang.String getGotoTopHTML()
Gets the HTML text used to draw the navigation symbol that jumps to the top of the output page.

Returns:
The HTML text used to draw the navigation symbol that jumps to the top of the output page.
See Also:
HTMLDiffWriter.getGotoBottomHTML(), HTMLDiffWriter.getGotoFirstDiffHTML(), HTMLDiffWriter.getGotoLastDiffHTML(), HTMLDiffWriter.getGotoPrevDiffHTML(), HTMLDiffWriter.getGotoNextDiffHTML(), HTMLDiffWriter.getGotoBlankHTML(), HTMLDiffWriter.getPageBaseURL(), HTMLDiffWriter.getNavigateOnEveryChangedLine()

setGotoBottomHTML

public void setGotoBottomHTML(java.lang.String strHTML)
Sets the HTML text used to draw the navigation symbol that jumps to the bottom of the output page.

Parameters:
strHTML - The HTML text used to draw the navigation symbol that jumps to the bottom of the output page.

getGotoBottomHTML

public java.lang.String getGotoBottomHTML()
Gets the HTML text used to draw the navigation symbol that jumps to the bottom of the output page.

Returns:
The HTML text used to draw the navigation symbol that jumps to the bottom of the output page.
See Also:
HTMLDiffWriter.getGotoTopHTML(), HTMLDiffWriter.getGotoFirstDiffHTML(), HTMLDiffWriter.getGotoLastDiffHTML(), HTMLDiffWriter.getGotoPrevDiffHTML(), HTMLDiffWriter.getGotoNextDiffHTML(), HTMLDiffWriter.getGotoBlankHTML(), HTMLDiffWriter.getPageBaseURL(), HTMLDiffWriter.getNavigateOnEveryChangedLine()

setGotoFirstDiffHTML

public void setGotoFirstDiffHTML(java.lang.String strHTML)
Sets the HTML text used to draw the navigation symbol that jumps to the first difference on the output page.

Parameters:
strHTML - The HTML text used to draw the navigation symbol that jumps to the first difference on the output page.

getGotoFirstDiffHTML

public java.lang.String getGotoFirstDiffHTML()
Gets the HTML text used to draw the navigation symbol that jumps to the first difference on the output page.

Returns:
The HTML text used to draw the navigation symbol that jumps to the first difference on the output page.
See Also:
HTMLDiffWriter.getGotoTopHTML(), HTMLDiffWriter.getGotoBottomHTML(), HTMLDiffWriter.getGotoLastDiffHTML(), HTMLDiffWriter.getGotoPrevDiffHTML(), HTMLDiffWriter.getGotoNextDiffHTML(), HTMLDiffWriter.getGotoBlankHTML(), HTMLDiffWriter.getPageBaseURL(), HTMLDiffWriter.getNavigateOnEveryChangedLine()

setGotoLastDiffHTML

public void setGotoLastDiffHTML(java.lang.String strHTML)
Sets the HTML text used to draw the navigation symbol that jumps to the last difference on the output page.

Parameters:
strHTML - The HTML text used to draw the navigation symbol that jumps to the last difference on the output page.

getGotoLastDiffHTML

public java.lang.String getGotoLastDiffHTML()
Gets the HTML text used to draw the navigation symbol that jumps to the last difference on the output page.

Returns:
The HTML text used to draw the navigation symbol that jumps to the last difference on the output page.
See Also:
HTMLDiffWriter.getGotoTopHTML(), HTMLDiffWriter.getGotoBottomHTML(), HTMLDiffWriter.getGotoFirstDiffHTML(), HTMLDiffWriter.getGotoPrevDiffHTML(), HTMLDiffWriter.getGotoNextDiffHTML(), HTMLDiffWriter.getGotoBlankHTML(), HTMLDiffWriter.getPageBaseURL(), HTMLDiffWriter.getNavigateOnEveryChangedLine()

setGotoPrevDiffHTML

public void setGotoPrevDiffHTML(java.lang.String strHTML)
Sets the HTML text used to draw the navigation symbol that jumps to the previous difference on the output page.

Parameters:
strHTML - The HTML text used to draw the navigation symbol that jumps to the previous difference on the output page.

getGotoPrevDiffHTML

public java.lang.String getGotoPrevDiffHTML()
Gets the HTML text used to draw the navigation symbol that jumps to the previous difference on the output page.

Returns:
The HTML text used to draw the navigation symbol that jumps to the previous difference on the output page.
See Also:
HTMLDiffWriter.getGotoTopHTML(), HTMLDiffWriter.getGotoBottomHTML(), HTMLDiffWriter.getGotoFirstDiffHTML(), HTMLDiffWriter.getGotoLastDiffHTML(), HTMLDiffWriter.getGotoNextDiffHTML(), HTMLDiffWriter.getGotoBlankHTML(), HTMLDiffWriter.getPageBaseURL(), HTMLDiffWriter.getNavigateOnEveryChangedLine()

setGotoNextDiffHTML

public void setGotoNextDiffHTML(java.lang.String strHTML)
Sets the HTML text used to draw the navigation symbol that jumps to the next difference on the output page.

Parameters:
strHTML - The HTML text used to draw the navigation symbol that jumps to the next difference on the output page.

getGotoNextDiffHTML

public java.lang.String getGotoNextDiffHTML()
Gets the HTML text used to draw the navigation symbol that jumps to the next difference on the output page.

Returns:
The HTML text used to draw the navigation symbol that jumps to the next difference on the output page.
See Also:
HTMLDiffWriter.getGotoTopHTML(), HTMLDiffWriter.getGotoBottomHTML(), HTMLDiffWriter.getGotoFirstDiffHTML(), HTMLDiffWriter.getGotoLastDiffHTML(), HTMLDiffWriter.getGotoPrevDiffHTML(), HTMLDiffWriter.getGotoBlankHTML(), HTMLDiffWriter.getPageBaseURL(), HTMLDiffWriter.getNavigateOnEveryChangedLine()

setGotoBlankHTML

public void setGotoBlankHTML(java.lang.String strHTML)
Sets the HTML text used to draw whitespace the same width as a naviation control.

Parameters:
strHTML - The HTML text used to draw whitespace the same width as a naviation control.

getGotoBlankHTML

public java.lang.String getGotoBlankHTML()
Gets the HTML text used to draw whitespace the same width as a naviation control.

Returns:
The HTML text used to draw whitespace the same width as a naviation control.
See Also:
HTMLDiffWriter.getGotoTopHTML(), HTMLDiffWriter.getGotoBottomHTML(), HTMLDiffWriter.getGotoFirstDiffHTML(), HTMLDiffWriter.getGotoLastDiffHTML(), HTMLDiffWriter.getGotoPrevDiffHTML(), HTMLDiffWriter.getGotoNextDiffHTML(), HTMLDiffWriter.getPageBaseURL(), HTMLDiffWriter.getNavigateOnEveryChangedLine()

setNavigateOnEveryChangedLine

public void setNavigateOnEveryChangedLine(boolean bEveryLine)
Determines whether or not navigation symbols will be drawn on every changed line. The default is false, indicating that navigation symbols will be drawn only on the first line of multi-line changes.

Parameters:
bEveryLine - true to draw navigation symbols on every changed line; false (the default) to draw navigation symbols only on the first line of multi-line changes.

getNavigateOnEveryChangedLine

public boolean getNavigateOnEveryChangedLine()
Indicates whether or not navigation symbols will be drawn on every changed line.

Returns:
true to draw navigation symbols on every changed line; false (the default) to draw navigation symbols only on the first line of multi-line changes.
See Also:
HTMLDiffWriter.getGotoTopHTML(), HTMLDiffWriter.getGotoBottomHTML(), HTMLDiffWriter.getGotoFirstDiffHTML(), HTMLDiffWriter.getGotoLastDiffHTML(), HTMLDiffWriter.getGotoPrevDiffHTML(), HTMLDiffWriter.getGotoNextDiffHTML(), HTMLDiffWriter.getGotoBlankHTML()

setShowLineNumbers

public void setShowLineNumbers(boolean bShowLineNumbers)
Sets to flag whether or not line numbers are embedded in the HTML document.

Parameters:
bShowLineNumbers - The desired value of the flag to show line numbers in HTML output.

getShowLineNumbers

public boolean getShowLineNumbers()
Determines whether or not line numbers are embedded in the HTML document.

Returns:
true (the default) to embed line numbers in the HTML output; false otherwise.

setShowUnchangedLines

public void setShowUnchangedLines(boolean bShowUnchangedLines)
Sets to flag whether or not unchanged lines are displayed in the HTML document.

Parameters:
bShowUnchangedLines - The desired value of the flag to show line numbers in HTML output.

getShowUnchangedLines

public boolean getShowUnchangedLines()
Determines whether or not unchanged lines are displayed in the HTML document.

Returns:
true (the default) to display unchanged lines in the HTML output; false otherwise.

setNumContextLines

public void setNumContextLines(int nContextLines)
Sets the maximum number of unchanged lines displayed before and after each changed line. Ignored if display of unchanged lines has been disabled.

Parameters:
nContextLines - The maximum number of unchanged lines displayed before and after each changed line.

getNumContextLines

public int getNumContextLines()
Gets the maximum number of unchanged lines displayed before and after each changed line.

Returns:
The maximum number of unchanged lines displayed before and after each changed line.
See Also:
HTMLDiffWriter.getShowUnchangedLines()

setShowEOLs

public void setShowEOLs(boolean bShow)
Sets to flag whether or not EOL characters are displayed in the HTML document when compared differently.

Parameters:
bShow - true if EOL characters are displayed in HTML document when compared differently; false (the default) they are not displayed at all.

getShowEOLs

public boolean getShowEOLs()
Indicates whether or not "replaced" lines show markup within the line.

Returns:
true if EOL characters are displayed in HTML document when compared differently; false (the default) they are not displayed at all.
See Also:
HTMLDiffWriter.getCRHTML(), HTMLDiffWriter.getLFHTML()

setCRHTML

public void setCRHTML(java.lang.String strCRHTML)
Sets the representation of the carriage-return character in the HTML document.

Parameters:
strCRHTML - The string representation of the carriage-return character in the HTML document.

getCRHTML

public java.lang.String getCRHTML()
Returns the string representation of the Carriage-return character in the HTML document. The default value is "[CR]".

Returns:
The string representation of the Carriage-return character in the HTML document. The default value is "[CR]".
See Also:
HTMLDiffWriter.getLFHTML(), HTMLDiffWriter.getShowEOLs()

setLFHTML

public void setLFHTML(java.lang.String strLFHTML)
Sets the representation of the line-feed character in the HTML document.

Parameters:
strLFHTML - The string representation of the line-feed character in the HTML document.

getLFHTML

public java.lang.String getLFHTML()
Returns the string representation of the line-feed character in the HTML document. The default value is "[LF]".

Returns:
The string representation of the line-feed character in the HTML document. The default value is "[LF]".
See Also:
HTMLDiffWriter.getCRHTML(), HTMLDiffWriter.getShowEOLs()

setAddedSymbolHTML

public void setAddedSymbolHTML(java.lang.String strHTML)
Sets the HTML text used to draw the symbol that indicates an "added" line.

Parameters:
strHTML - The HTML text used to draw the symbol that indicates an "added" line.

getAddedSymbolHTML

public java.lang.String getAddedSymbolHTML()
Gets the HTML text used to draw the symbol that indicates an "added" line.

Returns:
The HTML text used to draw the symbol that indicates an "added" line.
See Also:
HTMLDiffWriter.getDeletedSymbolHTML(), HTMLDiffWriter.getReplacedSymbolHTML(), HTMLDiffWriter.getUnchangedSymbolHTML(), HTMLDiffWriter.getPageBaseURL()

setDeletedSymbolHTML

public void setDeletedSymbolHTML(java.lang.String strHTML)
Sets the HTML text used to draw the symbol that indicates a "deleted" line.

Parameters:
strHTML - The HTML text used to draw the symbol that indicates a "deleted" line.

getDeletedSymbolHTML

public java.lang.String getDeletedSymbolHTML()
Gets the HTML text used to draw the symbol that indicates a "deleted" line.

Returns:
The HTML text used to draw the symbol that indicates a "deleted" line.
See Also:
HTMLDiffWriter.getAddedSymbolHTML(), HTMLDiffWriter.getReplacedSymbolHTML(), HTMLDiffWriter.getUnchangedSymbolHTML(), HTMLDiffWriter.getPageBaseURL()

setReplacedSymbolHTML

public void setReplacedSymbolHTML(java.lang.String strHTML)
Sets the HTML text used to draw the symbol that indicates a "replaced" line.

Parameters:
strHTML - The HTML text used to draw the symbol that indicates a "replaced" line.

getReplacedSymbolHTML

public java.lang.String getReplacedSymbolHTML()
Gets the HTML text used to draw the symbol that indicates a "replaced" line.

Returns:
The HTML text used to draw the symbol that indicates a "replaced" line.
See Also:
HTMLDiffWriter.getAddedSymbolHTML(), HTMLDiffWriter.getDeletedSymbolHTML(), HTMLDiffWriter.getUnchangedSymbolHTML(), HTMLDiffWriter.getPageBaseURL()

setUnchangedSymbolHTML

public void setUnchangedSymbolHTML(java.lang.String strHTML)
Sets the HTML text used to draw the symbol that indicates an "unchanged" line.

Parameters:
strHTML - The HTML text used to draw the symbol that indicates an "unchanged" line.

getUnchangedSymbolHTML

public java.lang.String getUnchangedSymbolHTML()
Gets the HTML text used to draw the symbol that indicates an "unchanged" line.

Returns:
The HTML text used to draw the symbol that indicates an "unchanged" line.
See Also:
HTMLDiffWriter.getAddedSymbolHTML(), HTMLDiffWriter.getDeletedSymbolHTML(), HTMLDiffWriter.getReplacedSymbolHTML(), HTMLDiffWriter.getPageBaseURL()

setInlineInsertMarkHTML

public void setInlineInsertMarkHTML(java.lang.String strHTML)
Sets the HTML text used to mark an in-line insertion point within a source line.

Parameters:
strHTML - The HTML text used to mark an in-line insertion point within a source line.

getInlineInsertMarkHTML

public java.lang.String getInlineInsertMarkHTML()
Gets the HTML text used to mark an in-line insertion point within a source line.

Returns:
The HTML text used to mark an in-line insertion point within a source line.
See Also:
HTMLDiffWriter.getInlineDeleteMarkHTML(), HTMLDiffWriter.getPageBaseURL()

setInlineDeleteMarkHTML

public void setInlineDeleteMarkHTML(java.lang.String strHTML)
Sets the HTML text used to mark an in-line deletion point within a source line.

Parameters:
strHTML - The HTML text used to mark an in-line deletion point within a source line.

getInlineDeleteMarkHTML

public java.lang.String getInlineDeleteMarkHTML()
Gets the HTML text used to mark an in-line deletion point within a source line.

Returns:
The HTML text used to mark an in-line deletion point within a source line.
See Also:
HTMLDiffWriter.getInlineInsertMarkHTML(), HTMLDiffWriter.getPageBaseURL()

simpleDiff

public static void simpleDiff(java.io.File source,
                              java.io.File target,
                              java.io.File output)
                       throws java.io.FileNotFoundException,
                              java.io.IOException,
                              DiffException
Compares two text files, and generates a simple HTML file describing the differences.

Uses a default text comparison algorithm: leading and trailing whitespace is ignored, and sequential whitespace characters within a line are treated as equivalent to a single space character.

Parameters:
source - The source text file.
target - The target text file.
output - The output file to generate.
Throws:
java.io.FileNotFoundException
java.io.IOException
DiffException

start

public void start()
           throws java.io.IOException
Description copied from class: EditListWriter
Called to tell writer where it can get the source for the lines.

Specified by:
start in class EditListWriter
Throws:
java.io.IOException

finish

public void finish()
            throws java.io.IOException
called when the last lines are being processed

Specified by:
finish in class EditListWriter
Throws:
java.io.IOException - an exception on failure

unchangedLines

public void unchangedLines(int sourceStart,
                           int targetStart,
                           int length)
                    throws java.io.IOException
When an original line from the source carries over into the rebuilt output

Specified by:
unchangedLines in class EditListWriter
Parameters:
sourceStart - the start line in the source
targetStart - the start line in the target
length - the length of lines to leave unchanged
Throws:
java.io.IOException - an exception on failure

insertLines

public void insertLines(int sourceStart,
                        int targetStart,
                        int length)
                 throws java.io.IOException
called when lines are inserted

Specified by:
insertLines in class EditListWriter
Parameters:
sourceStart - the start line in the source
targetStart - the start line in the target
length - the number of lines to insert
Throws:
java.io.IOException - an exception on failure

deleteLines

public void deleteLines(int sourceStart,
                        int targetStart,
                        int length)
                 throws java.io.IOException
called when lines are deleted

Specified by:
deleteLines in class EditListWriter
Parameters:
sourceStart - the start line in the source
targetStart - the start line in the target
length - the number of lines to delete
Throws:
java.io.IOException - an exception on failure

replaceLines

public void replaceLines(int sourcePos,
                         int sourceLen,
                         int targetPos,
                         int targetLen)
                  throws java.io.IOException
Called when lines in the source are replaced by lines in the target.

Specified by:
replaceLines in class EditListWriter
Parameters:
sourcePos - the start line in the source
sourceLen - the length of the source
targetPos - the start line in the target
targetLen - the length of the target
Throws:
java.io.IOException - an exception on failure


StarTeam SDK 14.0, Build 21
Copyright © 2003-2012 Borland Software Corporation. All rights reserved.