Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 


Eclipse Platform
Release 3.5

org.eclipse.team.ui.mapping
Class SaveableComparison


java.lang.Object
  extended by org.eclipse.ui.internal.InternalSaveable
      extended by 

org.eclipse.ui.Saveable
          extended by 
org.eclipse.team.ui.mapping.SaveableComparison
All Implemented Interfaces:
IAdaptable

public abstract class SaveableComparison
extends Saveable

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.

Since:
3.2

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.
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.
 
Methods inherited from class org.eclipse.ui. Saveable
disableUI, doSave, enableUI, equals, getAdapter, getImageDescriptor, getName, getToolTipText, hashCode, show
 
Methods inherited from class java.lang. Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROP_DIRTY

public static final int PROP_DIRTY
The property id for isDirty.

See Also:
Constant Field Values
Constructor Detail

SaveableComparison

public SaveableComparison()
Method Detail

isDirty

public 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.

Specified by:
isDirty in class Saveable
Returns:
true if the contents have been modified and need saving, and false if they have not changed since the last save

doSave

public void doSave(
IProgressMonitor monitor)
            throws 
CoreException
Saves the contents of this saveable.

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.

Specified by:
doSave in class Saveable
Parameters:
monitor - the progress monitor
Throws:
CoreException - if the save fails; it is the caller's responsibility to report the failure to the user

doRevert

public void doRevert(
IProgressMonitor monitor)
Revert any changes in the buffer back to the last saved state.

Parameters:
monitor - a progress monitor on null if progress feedback is not required

addPropertyListener

public void addPropertyListener(
IPropertyListener listener)
Add a property change listener. Adding a listener that is already registered has no effect.

Parameters:
listener - the listener

removePropertyListener

public void removePropertyListener(
IPropertyListener listener)
Remove a property change listener. Removing a listener that is not registered has no effect.

Parameters:
listener - the listener

setDirty

protected void setDirty(boolean dirty)
Set the dirty state of this buffer. If the state has changed, a property change event will be fired.

Parameters:
dirty - the dirty state

firePropertyChange

protected void firePropertyChange(int property)
Fire a property change event for this buffer.

Parameters:
property - the property that changed

performSave

protected abstract void performSave(
IProgressMonitor monitor)
                             throws 
CoreException
Method invoked from doSave(IProgressMonitor) to write out the buffer. By default, this method invokes doSave on the buffers saveable model.

Parameters:
monitor - a progress monitor
Throws:
CoreException - if errors occur

performRevert

protected abstract void performRevert(
IProgressMonitor monitor)
Method invoked from doRevert(IProgressMonitor) to discard the changes in the buffer.

Parameters:
monitor - a progress monitor

Eclipse Platform
Release 3.5

Guidelines for using Eclipse APIs.

Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire