public class CompareOptions extends Object
Example usage:
try (Comparer comparer = new Comparer(sourceFile)) {
comparer.add(targetFile);
final StyleSettings styleSettings = new StyleSettings();
styleSettings.setHighlightColor(Color.RED);
styleSettings.setFontColor(Color.GREEN);
styleSettings.setUnderline(true);
CompareOptions compareOptions = new CompareOptions();
compareOptions.setInsertedItemStyle(styleSettings);
comparer.compare(resultFile, compareOptions);
}
Comparer,
StyleSettings| Modifier and Type | Class and Description |
|---|---|
static class |
CompareOptions.Builder
A
CompareOptions builder. |
| Constructor and Description |
|---|
CompareOptions()
Initializes a new instance of the CompareOptions class.
|
CompareOptions(StyleSettings insertedItemStyle,
StyleSettings deletedItemStyle,
StyleSettings changedItemStyle)
Initializes a new instance of the CompareOptions class with settings for different styles.
|
| Modifier and Type | Method and Description |
|---|---|
com.groupdocs.comparison.options.enums.CalculateCoordinatesModeEnumeration |
getCalculateCoordinatesMode()
Gets a calculate coordinates mode as
CalculateCoordinatesModeEnumeration object. |
StyleSettings |
getChangedItemStyle()
Gets a style settings that will be applied to changed items.
|
ComparisonType |
getComparisonType()
Gets a type of source and target documents as
ComparisonType object so that Comparison will know how to compare them. |
StyleSettings |
getDeletedItemStyle()
Gets a style settings that will be applied to deleted items.
|
DetalisationLevel |
getDetalisationLevel()
Gets a level of comparison detalization represented as
DetalisationLevel. |
DiagramMasterSetting |
getDiagramMasterSetting()
Gets a setting of master page for Diagram documents represented by
DiagramMasterSetting object. |
com.groupdocs.comparison.options.enums.FolderComparisonExtension |
getFolderComparisonExtension()
Gets the format of the resulting folder comparison file.
|
StyleSettings |
getInsertedItemStyle()
Gets a style settings that will be applied to inserted items.
|
boolean |
getMarkLineBreaks()
Get a value indicating whether to mark line breaks.
|
OriginalSize |
getOriginalSize()
Gets an original sizes of compared documents represented by
OriginalSize object. |
PaperSize |
getPaperSize()
Gets a size of a paper in result document as
PaperSize object. |
PasswordSaveOption |
getPasswordSaveOption()
Gets a password save option represented by
PasswordSaveOption object. |
String |
getRevisionAuthorName()
Gets or sets revision author name.
|
int |
getSensitivityOfComparison()
Gets a sensitivity of comparison.
|
String |
getUserMasterPath()
Gets the path to the user master's template for Diagrams.
|
boolean |
isCalculateCoordinates()
Gets a flag that indicates whether to calculate coordinates for changed components.
|
boolean |
isCompareBookmarks()
Gets a flag that indicates whether bookmarks in Word documents will be compared.
|
boolean |
isCompareDocumentProperty()
Gets a flag that indicates whether built and custom properties in Word documents will be compared.
|
boolean |
isCompareVariableProperty()
Gets a flag that indicates whether variables properties in Word documents will be compared.
|
boolean |
isDetectStyleChanges()
Gets a flag that indicates whether to detect style changes or not.
|
boolean |
isDirectoryCompare()
Returns a flag that indicates whether directory comparison is enabled.
|
boolean |
isExtendedSummaryPage()
Gets a flag that indicates whether to add extended file comparison information to the summary page or not.
|
boolean |
isGenerateSummaryPage()
Gets a flag that indicates whether to add summary page with detected changes statistics to resultant document or not.
|
boolean |
isHeaderFootersComparison()
Gets a flag that indicates whether to compare header/footer contents.
|
boolean |
isLeaveGaps()
Gets a flag that determines whether to leave empty lines instead of inserted/deleted components or not.
|
boolean |
isMarkChangedContent()
Gets a flag that indicates whether frames for shapes in Word Processing and for rectangles in Image documents will be used.
|
boolean |
isMarkNestedContent()
Gets a flag that indicates whether to mark the children of the deleted or inserted elements as deleted or inserted.
|
boolean |
isShowDeletedContent()
Gets a flag that indicates whether to show deleted components in resultant document or not.
|
boolean |
isShowInsertedContent()
Gets a flag that indicates whether to show inserted components in resultant document or not.
|
boolean |
isShowOnlyChanged()
Returns a boolean value that indicates whether only changed items should be displayed.
|
boolean |
isShowOnlySummaryPage()
Gets a flag that indicates whether to leave in the resulting document only a page with statistics of detected changes or not.
|
boolean |
isShowRevisions()
Gets a flag that indicates whether others revisions in the resulting document will be displayed.
|
boolean |
isWordTrackChanges()
Gets a flag that indicates whether Words Track Revisions will be compared.
|
void |
setCalculateCoordinates(boolean value)
Sets a flag that indicates whether to calculate coordinates for changed components.
|
void |
setCalculateCoordinatesMode(com.groupdocs.comparison.options.enums.CalculateCoordinatesModeEnumeration calculateCoordinatesMode)
Sets a calculate coordinates mode as
CalculateCoordinatesModeEnumeration object. |
void |
setChangedItemStyle(StyleSettings value)
Sets a style settings that will be applied to changed items.
|
void |
setCompareBookmarks(boolean value)
Sets a flag that indicates whether bookmarks in Word documents should be compared.
|
void |
setCompareDocumentProperty(boolean value)
Sets a flag that indicates whether built and custom properties in Word documents should be compared.
|
void |
setCompareVariableProperty(boolean value)
Sets a flag that indicates whether variables properties in Word documents should be compared.
|
void |
setComparisonType(ComparisonType comparisonType)
Sets a type of source and target documents as
ComparisonType object so that Comparison will know how to compare them. |
void |
setDeletedItemStyle(StyleSettings value)
Sets a style settings that will be applied to deleted items.
|
void |
setDetalisationLevel(DetalisationLevel value)
Sets a level of comparison detalization represented as
DetalisationLevel. |
void |
setDetectStyleChanges(boolean value)
Sets a flag that indicates whether to detect style changes or not.
|
void |
setDiagramMasterSetting(DiagramMasterSetting value)
Sets a setting of master page for Diagram documents represented by
DiagramMasterSetting object. |
void |
setDirectoryCompare(boolean directoryCompare)
Sets a flag that indicates whether directory comparison should be enabled.
|
void |
setExtendedSummaryPage(boolean value)
Sets a flag that indicates whether to add extended file comparison information to the summary page or not.
|
void |
setFolderComparisonExtension(com.groupdocs.comparison.options.enums.FolderComparisonExtension folderComparisonExtension)
Sets the format of the resulting folder comparison file.
|
void |
setGenerateSummaryPage(boolean value)
Sets a flag that indicates whether to add summary page with detected changes statistics to resultant document or not.
|
void |
setHeaderFootersComparison(boolean value)
Sets a flag that indicates whether to compare header/footer contents.
|
void |
setInsertedItemStyle(StyleSettings value)
Sets a style settings that will be applied to inserted items.
|
void |
setLeaveGaps(boolean value)
Sets a flag that determines whether to leave empty lines instead of inserted/deleted components or not.
|
void |
setMarkChangedContent(boolean value)
Sets a flag that indicates whether frames for shapes in Word Processing and for rectangles in Image documents will be used.
|
void |
setMarkLineBreaks(boolean value)
Set a value indicating whether to mark line breaks.
|
void |
setMarkNestedContent(boolean value)
Sets a flag that indicates whether to mark the children of the deleted or inserted elements as deleted or inserted.
|
void |
setOriginalSize(OriginalSize value)
Sets an original sizes of compared documents represented by
OriginalSize object. |
void |
setPaperSize(PaperSize value)
Sets a size of a paper in result document as
PaperSize object. |
void |
setPasswordSaveOption(PasswordSaveOption value)
Sets a password save option represented by
PasswordSaveOption object. |
void |
setRevisionAuthorName(String revisionAuthorName)
Sets the revision author name.
|
void |
setSensitivityOfComparison(int value)
Sets a sensitivity of comparison.
|
void |
setShowDeletedContent(boolean value)
Sets a flag that indicates whether to show deleted components in resultant document or not.
|
void |
setShowInsertedContent(boolean value)
Sets a flag that indicates whether to show inserted components in resultant document or not.
|
void |
setShowOnlyChanged(boolean showOnlyChanged)
Sets the value indicating whether only changed items should be displayed.
|
void |
setShowOnlySummaryPage(boolean value)
Sets a flag that indicates whether to leave in the resulting document only a page with statistics of detected changes or not.
|
void |
setShowRevisions(boolean value)
Sets a flag that indicates whether others revisions in the resulting document should be displayed.
|
void |
setUserMasterPath(String userMasterPath)
Sets the path to the user master's template for Diagrams.
|
void |
setWordsSeparatorChars(char[] value)
Sets an array of delimiters which will be used to split text into words.
|
void |
setWordTrackChanges(boolean value)
Sets a flag that indicates whether Words Track Revisions should be compared.
|
public CompareOptions()
Initializes a new instance of the CompareOptions class.
public CompareOptions(StyleSettings insertedItemStyle, StyleSettings deletedItemStyle, StyleSettings changedItemStyle)
Initializes a new instance of the CompareOptions class with settings for different styles.
insertedItemStyle - Style settings for inserted itemsdeletedItemStyle - Style settings for deleted itemschangedItemStyle - Style settings for changed style itemspublic com.groupdocs.comparison.options.enums.CalculateCoordinatesModeEnumeration getCalculateCoordinatesMode()
Gets a calculate coordinates mode as CalculateCoordinatesModeEnumeration object.
public final StyleSettings getChangedItemStyle()
Gets a style settings that will be applied to changed items.
public ComparisonType getComparisonType()
Gets a type of source and target documents as ComparisonType object so that Comparison will know how to compare them.
LoadOptions.getFileType() option will be omitted.public final StyleSettings getDeletedItemStyle()
Gets a style settings that will be applied to deleted items.
public final DetalisationLevel getDetalisationLevel()
Gets a level of comparison detalization represented as DetalisationLevel.
DetalisationLevel.LOW.public final DiagramMasterSetting getDiagramMasterSetting()
Gets a setting of master page for Diagram documents represented by DiagramMasterSetting object.
public com.groupdocs.comparison.options.enums.FolderComparisonExtension getFolderComparisonExtension()
Gets the format of the resulting folder comparison file.
public final StyleSettings getInsertedItemStyle()
Gets a style settings that will be applied to inserted items.
public final boolean getMarkLineBreaks()
Get a value indicating whether to mark line breaks.
public final OriginalSize getOriginalSize()
Gets an original sizes of compared documents represented by OriginalSize object.
public final PaperSize getPaperSize()
Gets a size of a paper in result document as PaperSize object.
public final PasswordSaveOption getPasswordSaveOption()
Gets a password save option represented by PasswordSaveOption object.
public String getRevisionAuthorName()
Gets or sets revision author name. Enabled if not null.
public final int getSensitivityOfComparison()
Gets a sensitivity of comparison.
The percentage of deleted and inserted elements of two compared objects in relation to all elements of these objects.public String getUserMasterPath()
Gets the path to the user master's template for Diagrams.
public final boolean isCalculateCoordinates()
Gets a flag that indicates whether to calculate coordinates for changed components.
public boolean isCompareBookmarks()
Gets a flag that indicates whether bookmarks in Word documents will be compared.
public boolean isCompareDocumentProperty()
Gets a flag that indicates whether built and custom properties in Word documents will be compared.
public boolean isCompareVariableProperty()
Gets a flag that indicates whether variables properties in Word documents will be compared.
public final boolean isDetectStyleChanges()
Gets a flag that indicates whether to detect style changes or not.
public boolean isDirectoryCompare()
Returns a flag that indicates whether directory comparison is enabled.
public boolean isExtendedSummaryPage()
Gets a flag that indicates whether to add extended file comparison information to the summary page or not.
public final boolean isGenerateSummaryPage()
Gets a flag that indicates whether to add summary page with detected changes statistics to resultant document or not.
public final boolean isHeaderFootersComparison()
Gets a flag that indicates whether to compare header/footer contents.
public boolean isLeaveGaps()
Gets a flag that determines whether to leave empty lines instead of inserted/deleted components or not.
Whether to display empty lines instead of inserted/deleted components in the final document or not. Used withisShowInsertedContent() or isShowDeletedContent() properties.public final boolean isMarkChangedContent()
Gets a flag that indicates whether frames for shapes in Word Processing and for rectangles in Image documents will be used.
public final boolean isMarkNestedContent()
Gets a flag that indicates whether to mark the children of the deleted or inserted elements as deleted or inserted.
public final boolean isShowDeletedContent()
Gets a flag that indicates whether to show deleted components in resultant document or not.
public final boolean isShowInsertedContent()
Gets a flag that indicates whether to show inserted components in resultant document or not.
public boolean isShowOnlyChanged()
Returns a boolean value that indicates whether only changed items should be displayed.
public boolean isShowOnlySummaryPage()
Gets a flag that indicates whether to leave in the resulting document only a page with statistics of detected changes or not.
public boolean isShowRevisions()
Gets a flag that indicates whether others revisions in the resulting document will be displayed.
public boolean isWordTrackChanges()
Gets a flag that indicates whether Words Track Revisions will be compared.
public final void setCalculateCoordinates(boolean value)
Sets a flag that indicates whether to calculate coordinates for changed components.
value - true if coordinates for changed components should be calculated, otherwise falsepublic void setCalculateCoordinatesMode(com.groupdocs.comparison.options.enums.CalculateCoordinatesModeEnumeration calculateCoordinatesMode)
Sets a calculate coordinates mode as CalculateCoordinatesModeEnumeration object.
calculateCoordinatesMode - The calculate coordinates modepublic final void setChangedItemStyle(StyleSettings value)
Sets a style settings that will be applied to changed items.
value - Style settings of changed itemsIllegalArgumentException - if value is nullpublic void setCompareBookmarks(boolean value)
Sets a flag that indicates whether bookmarks in Word documents should be compared.
value - true if bookmarks in Word documents should be compared, otherwise falsepublic void setCompareDocumentProperty(boolean value)
Sets a flag that indicates whether built and custom properties in Word documents should be compared.
value - true if built and custom properties in Word documents should be compared, otherwise falsepublic void setCompareVariableProperty(boolean value)
Sets a flag that indicates whether variables properties in Word documents should be compared.
value - true if variables properties in Word documents should be compared, otherwise falsepublic void setComparisonType(ComparisonType comparisonType)
Sets a type of source and target documents as ComparisonType object so that Comparison will know how to compare them.
LoadOptions.setFileType(FileType) option will be omitted.comparisonType - The type of source and target documentspublic final void setDeletedItemStyle(StyleSettings value)
Sets a style settings that will be applied to deleted items.
value - Style settings of deleted itemsIllegalArgumentException - if value is nullpublic final void setDetalisationLevel(DetalisationLevel value)
Sets a level of comparison detalization represented as DetalisationLevel.
DetalisationLevel.LOWvalue - The level of comparison detalizationIllegalArgumentException - if value is nullpublic final void setDetectStyleChanges(boolean value)
Sets a flag that indicates whether to detect style changes or not.
value - true if style changes should be detected, otherwise falsepublic final void setDiagramMasterSetting(DiagramMasterSetting value)
Sets a setting of master page for Diagram documents represented by DiagramMasterSetting object.
value - The diagram master page settingIllegalArgumentException - if value is nullpublic void setDirectoryCompare(boolean directoryCompare)
Sets a flag that indicates whether directory comparison should be enabled.
directoryCompare - true if directory comparison should be enabled, otherwise falsepublic void setExtendedSummaryPage(boolean value)
Sets a flag that indicates whether to add extended file comparison information to the summary page or not.
value - true if extended file comparison information should be added to summary page, otherwise falsepublic void setFolderComparisonExtension(com.groupdocs.comparison.options.enums.FolderComparisonExtension folderComparisonExtension)
folderComparisonExtension - the FolderComparisonExtension representing the format of the resulting folder comparison filepublic final void setGenerateSummaryPage(boolean value)
Sets a flag that indicates whether to add summary page with detected changes statistics to resultant document or not.
value - true if summary page should be added, otherwise falsepublic final void setHeaderFootersComparison(boolean value)
Sets a flag that indicates whether to compare header/footer contents.
value - true if header/footer contents should be compared, otherwise falsepublic final void setInsertedItemStyle(StyleSettings value)
Sets a style settings that will be applied to inserted items.
value - Style settings of inserted itemsIllegalArgumentException - if value is nullpublic void setLeaveGaps(boolean value)
Sets a flag that determines whether to leave empty lines instead of inserted/deleted components or not.
Whether to display empty lines instead of inserted/deleted components in the final document or not. Used withisShowInsertedContent() or isShowDeletedContent() properties.value - true if empty lines should be displayed instead of inserted/deleted components, otherwise falsepublic final void setMarkChangedContent(boolean value)
Sets a flag that indicates whether frames for shapes in Word Processing and for rectangles in Image documents will be used.
value - true if frames should be used, otherwise falsepublic final void setMarkLineBreaks(boolean value)
Set a value indicating whether to mark line breaks.
value - Style settings of changed itemsIllegalArgumentException - if value is nullpublic final void setMarkNestedContent(boolean value)
Sets a flag that indicates whether to mark the children of the deleted or inserted elements as deleted or inserted.
value - true if the children of the deleted or inserted elements should be marked as deleted or inserted, otherwise falsepublic final void setOriginalSize(OriginalSize value)
Sets an original sizes of compared documents represented by OriginalSize object.
value - The original size of documentsIllegalArgumentException - if value is nullpublic final void setPaperSize(PaperSize value)
Sets a size of a paper in result document as PaperSize object.
value - The size of a paper in result documentpublic final void setPasswordSaveOption(PasswordSaveOption value)
Sets a password save option represented by PasswordSaveOption object.
value - The password save optionIllegalArgumentException - if value is nullpublic void setRevisionAuthorName(String revisionAuthorName)
Sets the revision author name. Enabled if not null.
revisionAuthorName - The new revision author name to be set.public final void setSensitivityOfComparison(int value)
Sets a sensitivity of comparison.
The percentage of deleted and inserted elements of two compared objects in relation to all elements of these objects.value - The sensitivity of comparisonpublic final void setShowDeletedContent(boolean value)
Sets a flag that indicates whether to show deleted components in resultant document or not.
value - true if deleted components in resultant document should be shown, otherwise falsepublic final void setShowInsertedContent(boolean value)
Sets a flag that indicates whether to show inserted components in resultant document or not.
value - true if inserted components in resultant document should be shown, otherwise falsepublic void setShowOnlyChanged(boolean showOnlyChanged)
Sets the value indicating whether only changed items should be displayed.
showOnlyChanged - the boolean value indicating whether only changed items should be displayedpublic void setShowOnlySummaryPage(boolean value)
Sets a flag that indicates whether to leave in the resulting document only a page with statistics of detected changes or not.
value - true if in the resulting document only a page with statistics of detected changes should be left, otherwise falsepublic void setShowRevisions(boolean value)
Sets a flag that indicates whether others revisions in the resulting document should be displayed.
value - true if others revisions in the resulting document should be displayed, otherwise falsepublic void setUserMasterPath(String userMasterPath)
Sets the path to the user master's template for Diagrams.
userMasterPath - The path to the user master's template for Diagrams.public final void setWordsSeparatorChars(char[] value)
Sets an array of delimiters which will be used to split text into words.
value - The array of delimiters to split text into wordsIllegalArgumentException - if value is nullpublic void setWordTrackChanges(boolean value)
Sets a flag that indicates whether Words Track Revisions should be compared.
value - true if Words Track Revisions should be compared, otherwise falseCopyright © 2024. All rights reserved.