Package de.loskutov.anyedit.compare
Class ExternalFileStreamContent
- java.lang.Object
-
- org.eclipse.compare.BufferedContent
-
- de.loskutov.anyedit.compare.ExternalFileStreamContent
-
- All Implemented Interfaces:
StreamContent
,org.eclipse.compare.IContentChangeNotifier
,org.eclipse.compare.IEditableContent
,org.eclipse.compare.IEditableContentExtension
,org.eclipse.compare.IModificationDate
,org.eclipse.compare.IStreamContentAccessor
,org.eclipse.compare.ITypedElement
,org.eclipse.compare.structuremergeviewer.IStructureComparator
,org.eclipse.core.runtime.IAdaptable
public class ExternalFileStreamContent extends org.eclipse.compare.BufferedContent implements StreamContent, org.eclipse.compare.IEditableContent, org.eclipse.compare.IModificationDate, org.eclipse.compare.IEditableContentExtension
Content for external files without document support.
-
-
Field Summary
Fields Modifier and Type Field Description private ContentWrapper
content
protected boolean
dirty
-
Constructor Summary
Constructors Constructor Description ExternalFileStreamContent(ContentWrapper content)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
commitChanges(org.eclipse.core.runtime.IProgressMonitor pm)
protected java.io.InputStream
createStream()
void
dispose()
java.lang.Object
getAdapter(java.lang.Class adapter)
java.lang.Object[]
getChildren()
java.lang.String
getFullName()
org.eclipse.swt.graphics.Image
getImage()
long
getModificationDate()
java.lang.String
getName()
java.lang.String
getType()
void
init(AnyeditCompareInput input)
boolean
isDirty()
boolean
isDisposed()
boolean
isEditable()
boolean
isReadOnly()
StreamContent
recreate()
org.eclipse.compare.ITypedElement
replace(org.eclipse.compare.ITypedElement dest, org.eclipse.compare.ITypedElement src)
void
setContent(byte[] contents)
void
setDirty(boolean dirty)
org.eclipse.core.runtime.IStatus
validateEdit(org.eclipse.swt.widgets.Shell shell)
-
Methods inherited from class org.eclipse.compare.BufferedContent
addContentChangeListener, discardBuffer, fireContentChanged, getContent, getContents, removeContentChangeListener
-
-
-
-
Field Detail
-
dirty
protected boolean dirty
-
content
private final ContentWrapper content
-
-
Constructor Detail
-
ExternalFileStreamContent
public ExternalFileStreamContent(ContentWrapper content)
-
-
Method Detail
-
setContent
public void setContent(byte[] contents)
- Specified by:
setContent
in interfaceorg.eclipse.compare.IEditableContent
- Overrides:
setContent
in classorg.eclipse.compare.BufferedContent
-
getImage
public org.eclipse.swt.graphics.Image getImage()
- Specified by:
getImage
in interfaceorg.eclipse.compare.ITypedElement
-
commitChanges
public boolean commitChanges(org.eclipse.core.runtime.IProgressMonitor pm) throws org.eclipse.core.runtime.CoreException
- Specified by:
commitChanges
in interfaceStreamContent
- Throws:
org.eclipse.core.runtime.CoreException
-
createStream
protected java.io.InputStream createStream() throws org.eclipse.core.runtime.CoreException
- Specified by:
createStream
in classorg.eclipse.compare.BufferedContent
- Throws:
org.eclipse.core.runtime.CoreException
-
isDirty
public boolean isDirty()
- Specified by:
isDirty
in interfaceStreamContent
-
getName
public java.lang.String getName()
- Specified by:
getName
in interfaceorg.eclipse.compare.ITypedElement
-
getFullName
public java.lang.String getFullName()
- Specified by:
getFullName
in interfaceStreamContent
-
getType
public java.lang.String getType()
- Specified by:
getType
in interfaceorg.eclipse.compare.ITypedElement
-
getChildren
public java.lang.Object[] getChildren()
- Specified by:
getChildren
in interfaceorg.eclipse.compare.structuremergeviewer.IStructureComparator
-
isEditable
public boolean isEditable()
- Specified by:
isEditable
in interfaceorg.eclipse.compare.IEditableContent
-
replace
public org.eclipse.compare.ITypedElement replace(org.eclipse.compare.ITypedElement dest, org.eclipse.compare.ITypedElement src)
- Specified by:
replace
in interfaceorg.eclipse.compare.IEditableContent
-
getModificationDate
public long getModificationDate()
- Specified by:
getModificationDate
in interfaceorg.eclipse.compare.IModificationDate
-
isReadOnly
public boolean isReadOnly()
- Specified by:
isReadOnly
in interfaceorg.eclipse.compare.IEditableContentExtension
-
validateEdit
public org.eclipse.core.runtime.IStatus validateEdit(org.eclipse.swt.widgets.Shell shell)
- Specified by:
validateEdit
in interfaceorg.eclipse.compare.IEditableContentExtension
-
dispose
public void dispose()
- Specified by:
dispose
in interfaceStreamContent
-
isDisposed
public boolean isDisposed()
- Specified by:
isDisposed
in interfaceStreamContent
-
init
public void init(AnyeditCompareInput input)
- Specified by:
init
in interfaceStreamContent
-
recreate
public StreamContent recreate()
- Specified by:
recreate
in interfaceStreamContent
-
getAdapter
public java.lang.Object getAdapter(java.lang.Class adapter)
- Specified by:
getAdapter
in interfaceorg.eclipse.core.runtime.IAdaptable
-
setDirty
public void setDirty(boolean dirty)
- Specified by:
setDirty
in interfaceStreamContent
-
-