org.eclipse.wst.common.componentcore
Interface IEditModelHandler

All Known Implementing Classes:
ArtifactEdit

public interface IEditModelHandler

Provides a standard interface for managing the lifecycle of an Edit Model. Clients which use instances of this interface are required to invoke dispose() when they have completed their usage. Once clients have disposed that instance, they will not be able to invoke save(IProgressMonitor)or saveIfNecessary(IProgressMonitor) and should be wary of using any model objects acquired from the handler, as they may be or become stale.

Since:
1.0
See Also:
StructureEdit, ArtifactEdit

Method Summary
 void dispose()
           Clients must invoke this method when they have finished using the handler.
 void save(IProgressMonitor aMonitor)
           Force a save of the underlying edit model and keep track of progress using the supplied progress monitor.
 void saveIfNecessary(IProgressMonitor aMonitor)
           Save the underlying edit model, if no other consumers are using the edit model, and keep track of progress using the supplied progress monitor.
 

Method Detail

save

public void save(IProgressMonitor aMonitor)

Force a save of the underlying edit model and keep track of progress using the supplied progress monitor. Clients should avoid calling this version of save unless they are certain they require the model to be saved. Clients are encouraged to use saveIfNecessary(IProgressMonitor) instead.

Parameters:
aMonitor - A valid progress monitor or null

saveIfNecessary

public void saveIfNecessary(IProgressMonitor aMonitor)

Save the underlying edit model, if no other consumers are using the edit model, and keep track of progress using the supplied progress monitor. This version of save will only save if the underlying edit model is not shared with other consumers.

Parameters:
aMonitor - A valid progress monitor or null

dispose

public void dispose()

Clients must invoke this method when they have finished using the handler.