Use the compare command to compare the current document to a specified file. Lines that exist in the specified file but not in the current document are highlighted with the styleAttributes.deletedLines style attributes. Lines that exist in the current document but not in the specified file are highlighted with the styleAttributes.addedLines style attributes.
compare { clear | next | previous | refresh | [ ignoredStyles styleChars ] [ prompt | fileOptions ] [ "fileName" ] }
clear | Use the clear parameter to remove the compare information from a previous compare session. |
next | Use the next parameter to move forward to the next mismatch. This will not wrap around to the top of the document. |
previous | Use the previous parameter to move backward to the previous mismatch. This will not wrap around to the bottom of the document. |
refresh | Use the refresh parameter to refresh the comparison against the previously specified file, using the latest changes in the current view. |
ignoredStyles styleChars | Use the ignoredStyles parameter to indicate that the text corresponding to the style characters specified by the styleChars parameter should be ignored in the comparison. White space will also be ignored. Style characters are set by document parsers. |
prompt | Use the prompt parameter to indicate that the compare file dialog should be displayed to allow the user to select a file. When the optional parameter fileName is specified, the compare file dialog will be initialized with the specified file name. |
fileOptions | Optional settings for the compare file, in this format:
[ sequenceNumbers numColumn numWidth textColumn textWidth ] [ encoding charEncoding ]Use the sequenceNumbers parameter to specify that the sequence numbers setting of the file is numColumn numWidth textColumn textWidth. If not specified, the compare file is assumed to have the same sequence numbers setting as the current document. Refer to the sequenceNumbers editor parameter for additional information on specifying sequence numbers. Use the encoding parameter to specify that the character encoding of the file is charEncoding. If you specify an empty string (""), the editor tries to detect the file encoding by itself, and defaults to the native encoding if unsuccessful. If not specified, the compare file is assumed to be in the native (platform default) character encoding; when the compare defaults to the underlying file of the document, its known encoding will be used. |
"fileName" | Use the fileName parameter to indicate the file that should be used. If no fileName is specified, the document is compared with the saved version of its underlying file. If the prompt parameter was specified, the file name is used to initialize the compare file dialog. |
The status parameter will be set to one of the following:
null The compare command successfully located the specified file. file.notFound The compare command could not locate the specified file. file.errorReading The compare command encountered an error while reading the file.
Lines which exist in the current document but not in the compare document are highlighted and continue to be part of the document. Lines that do not exist in the current document but exist in the compare document are inserted as show elements in the current view. They are protected and cannot be edited. Since they are show elements, they will not be saved with the document.
The comparison takes into account the settings of the compare. parameters. After changing any of these settings, another compare or compare refresh command must be issued for the view to reflect the changes.
compare prompt compare "test.java" compare encoding Cp850 "test.java" compare ignoredStyles "c" prompt "test.java" compare clear compare next compare previous compare refresh
Editor commands, actions, and parameters
print command
compare.columns parameter
compare.endColumn parameter
compare.ignoreAllBlanks parameter
compare.ignoreCase parameter
compare.ignoreComments parameter
compare.ignoreLeadingBlanks parameter
compare.ignoreSequenceNumbers parameter
compare.ignoreTrailingBlanks parameter
compare.startColumn parameter
sequenceNumbers parameter
show parameter
status parameter
style parameter
styleAttributes parameter
compare action
compareAllBlanks action
compareCase action
compareClear action
compareComments action
compareLeadingBlanks action
compareNext action
comparePrevious action
compareRefresh action
compareSequenceNumbers action
compareTrailingBlanks action
printCompare action
Copyright IBM Corporation 1992, 2008. All Rights Reserved.