com.ibm.lab.soln.resources
Class WorkspaceSaveParticipant

java.lang.Object
  |
  +--com.ibm.lab.soln.resources.WorkspaceSaveParticipant
All Implemented Interfaces:
java.util.EventListener, org.eclipse.core.resources.ISaveParticipant

public class WorkspaceSaveParticipant
extends java.lang.Object
implements org.eclipse.core.resources.ISaveParticipant

Resource programming demonstration of the structure of a participant in Workspace save events. Tied to logic in the plug-in's startup() method that adds a save participant to the workspace.

Tools that need to save project-specific information should consider using a save participant so that you can be notified when new projects are created and when changes that trigger a save event have occurred. This allows your tool logic to save any information that may be required to support the operation of your tool.

See Also:
ISaveParticipant, ISaveContext

Constructor Summary
WorkspaceSaveParticipant()
          Custom constructor to set an alternate prefix mode that will be used for console message tagging.
 
Method Summary
 void doneSaving(org.eclipse.core.resources.ISaveContext context)
          Tells this participant that the workspace save operation is now complete and it is free to go about its normal business.
 void prepareToSave(org.eclipse.core.resources.ISaveContext context)
          Tells this participant that the workspace is about to be saved.
 void rollback(org.eclipse.core.resources.ISaveContext context)
          Tells this participant to rollback its important state.
 void saveFile(java.io.File f)
          Tells this participant that the workspace is about to be saved.
 void saving(org.eclipse.core.resources.ISaveContext context)
          Tells this participant that the workspace is about to be saved.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WorkspaceSaveParticipant

public WorkspaceSaveParticipant()
Custom constructor to set an alternate prefix mode that will be used for console message tagging.
Method Detail

doneSaving

public void doneSaving(org.eclipse.core.resources.ISaveContext context)
Tells this participant that the workspace save operation is now complete and it is free to go about its normal business.
Specified by:
doneSaving in interface org.eclipse.core.resources.ISaveParticipant
Parameters:
context - the save context object
See Also:
ISaveParticipant.doneSaving(org.eclipse.core.resources.ISaveContext)

prepareToSave

public void prepareToSave(org.eclipse.core.resources.ISaveContext context)
                   throws org.eclipse.core.runtime.CoreException
Tells this participant that the workspace is about to be saved. Local count of how many times this process is called is incremented.
Specified by:
prepareToSave in interface org.eclipse.core.resources.ISaveParticipant
Parameters:
context - the save context object
Throws:
org.eclipse.core.runtime.CoreException - if this method fails to snapshot the state of this workspace
See Also:
ISaveParticipant.prepareToSave(org.eclipse.core.resources.ISaveContext)

rollback

public void rollback(org.eclipse.core.resources.ISaveContext context)
Tells this participant to rollback its important state.
Specified by:
rollback in interface org.eclipse.core.resources.ISaveParticipant
Parameters:
context - the save context object
See Also:
ISaveParticipant.rollback(org.eclipse.core.resources.ISaveContext), ISaveContext.getPreviousSaveNumber()

saveFile

public void saveFile(java.io.File f)
              throws org.eclipse.core.runtime.CoreException
Tells this participant that the workspace is about to be saved. In preparation, the participant is expected to suspend

saving

public void saving(org.eclipse.core.resources.ISaveContext context)
            throws org.eclipse.core.runtime.CoreException
Tells this participant that the workspace is about to be saved.
Specified by:
saving in interface org.eclipse.core.resources.ISaveParticipant
Parameters:
context - the save context object
Throws:
org.eclipse.core.runtime.CoreException - if this method fails to snapshot the state of this workspace
See Also:
ISaveParticipant.saving(org.eclipse.core.resources.ISaveContext)