|
Eclipse Platform Release 3.2 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.ui.Saveable
org.eclipse.team.ui.mapping.SaveableComparison
A saveable comparison is used to buffer changes made when comparing or merging model elements. A buffer can be shared between multiple typed elements within a comparison. The saveable is used by the comparison container in order to determine when a save is required.
Clients may subclass this class.
Field Summary | |
---|---|
static int |
PROP_DIRTY
The property id for isDirty . |
Constructor Summary | |
---|---|
SaveableComparison()
|
Method Summary | |
---|---|
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.
If the save is cancelled through user action, or for any other reason,
the part should invoke This method is long-running; progress and cancellation are provided by the given progress monitor. |
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. Note: this method is called frequently, for example by actions to determine their enabled status. |
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. |
Methods inherited from class org.eclipse.ui.Saveable |
---|
equals, getImageDescriptor, getName, getToolTipText, hashCode |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int PROP_DIRTY
isDirty
.
Constructor Detail |
public SaveableComparison()
Method Detail |
public boolean isDirty()
Note: this method is called frequently, for example by actions to determine their enabled status.
isDirty
in class Saveable
true
if the contents have been modified and need
saving, and false
if they have not changed since
the last savepublic 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 monitor
CoreException
- 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 monitor
CoreException
- if errors occurprotected abstract void performRevert(IProgressMonitor monitor)
doRevert(IProgressMonitor)
to discard the
changes in the buffer.
monitor
- a progress monitor
|
Eclipse Platform Release 3.2 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.