Class CmsTextDiff
- java.lang.Object
-
- org.opencms.ui.dialogs.history.diff.CmsTextDiff
-
- All Implemented Interfaces:
I_CmsDiffProvider
public class CmsTextDiff extends java.lang.Object implements I_CmsDiffProvider
Interprets two versions of a resource as text files, and shows a diff view for the two texts.This should work for both plaintext files as well as binary documents which from which OpenCms can extract text content.
-
-
Constructor Summary
Constructors Constructor Description CmsTextDiff()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.google.common.base.Optional<com.vaadin.ui.Component>
diff(CmsObject cms, CmsHistoryResourceBean v1, CmsHistoryResourceBean v2)
Optionally returns a comparison component to display for the given resource versions.protected java.lang.String
wrapLinesWithUnchangedStyle(java.lang.String diff)
Returns a diff text wrapped with formatting style.
-
-
-
Constructor Detail
-
CmsTextDiff
public CmsTextDiff()
-
-
Method Detail
-
diff
public com.google.common.base.Optional<com.vaadin.ui.Component> diff(CmsObject cms, CmsHistoryResourceBean v1, CmsHistoryResourceBean v2) throws CmsException
Description copied from interface:I_CmsDiffProvider
Optionally returns a comparison component to display for the given resource versions.If no value is returned, then no widget is displayed.
- Specified by:
diff
in interfaceI_CmsDiffProvider
- Parameters:
cms
- the CMS contextv1
- bean representing the first versionv2
- bean representing the second version- Returns:
- the optional component to display
- Throws:
CmsException
- if something goes wrong- See Also:
I_CmsDiffProvider.diff(org.opencms.file.CmsObject, org.opencms.gwt.shared.CmsHistoryResourceBean, org.opencms.gwt.shared.CmsHistoryResourceBean)
-
wrapLinesWithUnchangedStyle
protected java.lang.String wrapLinesWithUnchangedStyle(java.lang.String diff) throws java.io.IOException
Returns a diff text wrapped with formatting style.- Parameters:
diff
- the text to wrap with CSS formatting- Returns:
- the text with formatting styles wrapped
- Throws:
java.io.IOException
- if something goes wrong
-
-