org.eclipse.tigerstripe.workbench
Interface IWorkingCopy

All Known Subinterfaces:
IAbstractTigerstripeProject, ITigerstripeGeneratorProject, ITigerstripeM0GeneratorProject, ITigerstripeM1GeneratorProject, ITigerstripeModelProject

public interface IWorkingCopy

Generic interface used to provide a way to edit an object in a "working copy" and commit all changes in a

Author:
erdillon

Method Summary
 void addOriginalChangeListener(IOriginalChangeListener listener)
          This call-back mechanism can be used by the client to be notified when the original object has changed.
 void commit(IProgressMonitor monitor)
          Commits the changes in this "working copy" to the original.
 void dispose()
          Disposes of this working copy.
 java.lang.Object getOriginal()
          Returns the original object that was used to create this working copy Note that this is the original object in its current state, not in necessarily in the state it was at the time the working copy was created
 boolean isDirty()
           
 boolean isWorkingCopy()
           
 IWorkingCopy makeWorkingCopy(IProgressMonitor monitor)
          Creates a deep-clone of the original object to return a "working copy" that can be used for editing.
 void removeOriginalChangeListener(IOriginalChangeListener listener)
          Removes a listener from the list.
 

Method Detail

isWorkingCopy

boolean isWorkingCopy()

isDirty

boolean isDirty()

makeWorkingCopy

IWorkingCopy makeWorkingCopy(IProgressMonitor monitor)
                             throws TigerstripeException
Creates a deep-clone of the original object to return a "working copy" that can be used for editing. If called on a "working copy" returns a new deep-cloned version of the original. Note that if the original had changed, the original in is current state is used to perform the deep-clone, i.e. it is equivalent to getOriginal().makeWorkingCopy(...)

Parameters:
monitor -
Returns:
Throws:
TigerstripeException

getOriginal

java.lang.Object getOriginal()
                             throws TigerstripeException
Returns the original object that was used to create this working copy Note that this is the original object in its current state, not in necessarily in the state it was at the time the working copy was created

Returns:
Throws:
TigerstripeException

addOriginalChangeListener

void addOriginalChangeListener(IOriginalChangeListener listener)
This call-back mechanism can be used by the client to be notified when the original object has changed.

Parameters:
listener - - the listener to register, if already registered it will be ignored

removeOriginalChangeListener

void removeOriginalChangeListener(IOriginalChangeListener listener)
Removes a listener from the list. If not in the list, this method call is ignored.

Parameters:
listener -

commit

void commit(IProgressMonitor monitor)
            throws TigerstripeException
Commits the changes in this "working copy" to the original. This will perform all the necessary steps to persist the values in the "working copy" to the original. If

Parameters:
monitor -
Throws:
TigerstripeException

dispose

void dispose()
Disposes of this working copy. Clients MUST call this method when they are done using a working copy to avoid that these copies all remain in memory