|
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.team.ui.mapping.SaveableCompareModel
A saveable model is used to buffer changes made when comparing or merging a model. A buffer can be shared between multiple typed elements within a comparison. The saveable model is used by the comparison container in order to determine when a save is required.
Clients may subclass this class.
| Field Summary |
|---|
| Fields inherited from interface org.eclipse.team.ui.mapping.ISaveableCompareModel |
|---|
PROP_DIRTY |
| Constructor Summary | |
|---|---|
SaveableCompareModel()
|
|
| 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 model. |
protected void |
firePropertyChange(int property)
Fire a property change event for this buffer. |
protected void |
handleException(CoreException exception)
Handle an exception that occurred during a save. |
boolean |
isDirty()
Returns whether the contents of this model 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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.eclipse.ui.ISaveableModel |
|---|
getImageDescriptor, getName, getToolTipText |
| Constructor Detail |
public SaveableCompareModel()
| Method Detail |
public boolean isDirty()
ISaveableModelNote: this method is called frequently, for example by actions to determine their enabled status.
isDirty in interface ISaveableModeltrue if the contents have been modified and need
saving, and false if they have not changed since
the last save
public void doSave(IProgressMonitor monitor)
throws CoreException
ISaveableModel
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 interface ISaveableModelmonitor - 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)
ISaveableCompareModel
doRevert in interface ISaveableCompareModelmonitor - a progress monitor on null
if progress feedback is not requiredpublic void addPropertyListener(IPropertyListener listener)
ISaveableCompareModel
addPropertyListener in interface ISaveableCompareModellistener - the listenerpublic void removePropertyListener(IPropertyListener listener)
ISaveableCompareModel
removePropertyListener in interface ISaveableCompareModellistener - the listenerprotected void setDirty(boolean dirty)
dirty - the dirty stateprotected void firePropertyChange(int property)
property - the property that changed
protected abstract void performSave(IProgressMonitor monitor)
throws CoreException
doSave(IProgressMonitor) to write
out the buffer. By default, this method invokes doSave
on the buffers savable 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 monitorprotected void handleException(CoreException exception)
exception - the exception
|
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.