public abstract class SaveableComparison extends Saveable
Clients may subclass this class.
Modifier and Type | Field and Description |
---|---|
static int |
PROP_DIRTY
The property id for
isDirty . |
Constructor and Description |
---|
SaveableComparison() |
Modifier and Type | Method and Description |
---|---|
void |
addPropertyListener(IPropertyListener listener)
Add a property change listener.
|
void |
doRevert(IProgressMonitor monitor)
Revert any changes in the buffer back to the last saved state.
|
void |
doSave(IProgressMonitor monitor)
Saves the contents of this saveable.
|
protected void |
firePropertyChange(int property)
Fire a property change event for this buffer.
|
boolean |
isDirty()
Returns whether the contents of this saveable have changed since the last
save operation.
|
protected abstract void |
performRevert(IProgressMonitor monitor)
Method invoked from
doRevert(IProgressMonitor) to discard the
changes in the buffer. |
protected abstract void |
performSave(IProgressMonitor monitor)
Method invoked from
doSave(IProgressMonitor) to write
out the buffer. |
void |
removePropertyListener(IPropertyListener listener)
Remove a property change listener.
|
protected void |
setDirty(boolean dirty)
Set the dirty state of this buffer.
|
disableUI, doSave, enableUI, equals, getAdapter, getImageDescriptor, getName, getToolTipText, hashCode, show
public static final int PROP_DIRTY
isDirty
.public boolean isDirty()
Note: this method is called frequently, for example by actions to determine their enabled status.
public void doSave(IProgressMonitor monitor) throws CoreException
If the save is cancelled through user action, or for any other reason,
the part should invoke setCancelled
on the
IProgressMonitor
to inform the caller.
This method is long-running; progress and cancellation are provided by the given progress monitor.
doSave
in class Saveable
monitor
- the progress monitorCoreException
- if the save fails; it is the caller's responsibility to
report the failure to the userpublic void doRevert(IProgressMonitor monitor)
monitor
- a progress monitor on null
if progress feedback is not requiredpublic void addPropertyListener(IPropertyListener listener)
listener
- the listenerpublic void removePropertyListener(IPropertyListener listener)
listener
- the listenerprotected void setDirty(boolean dirty)
dirty
- the dirty stateprotected void firePropertyChange(int property)
property
- the property that changedprotected abstract void performSave(IProgressMonitor monitor) throws CoreException
doSave(IProgressMonitor)
to write
out the buffer. By default, this method invokes doSave
on the buffers saveable model.monitor
- a progress monitorCoreException
- if errors occurprotected abstract void performRevert(IProgressMonitor monitor)
doRevert(IProgressMonitor)
to discard the
changes in the buffer.monitor
- a progress monitor
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.