org.eclipse.tigerstripe.profile
Interface IWorkbenchProfileSession


public interface IWorkbenchProfileSession

Session facade to access IWorkbenchProfiles, edit and create them This session is available from the API (@see API) There is only one active IWorkbenchProfile per runtime. (@see #getActiveProfile()) It is possible for any object to register interest in changes of the active profile by implementing the IActiveWorkbenchProfileChangeListener interface

Since:
1.2
Author:
Eric Dillon

Method Summary
 void addActiveProfileListener(org.eclipse.tigerstripe.internal.api.profile.IActiveWorkbenchProfileChangeListener listener)
          Registers a listener that will be called back each time the active profile changes
 boolean canRollback()
          Returns true if a rollback file can be found to perform a rollback
 IWorkbenchProfile getActiveProfile()
          Returns the active profile for this runtime.
 IWorkbenchProfile getWorkbenchProfileFor(java.lang.String pathname)
           
 IWorkbenchProfile makeWorkbenchProfile()
          Factory method for IWorkbenchProfiles
 void reloadActiveProfile()
          Loads the active profile from the default Workbench profile location for this install.
 void removeActiveProfileListener(org.eclipse.tigerstripe.internal.api.profile.IActiveWorkbenchProfileChangeListener listener)
          Un-registers the given listener from the list of active profile listeners
 IWorkbenchProfile rollbackActiveProfile()
          Rolls back the active profile to its previous version.
 boolean saveAsActiveProfile(IWorkbenchProfile profile)
          Sets the given profile as the active profile by saving it as such.
 boolean setDefaultActiveProfile()
          Sets the active profile to the factory defaults.
 

Method Detail

getActiveProfile

IWorkbenchProfile getActiveProfile()
Returns the active profile for this runtime.

Returns:
IWorkbenchProfile - the active IWorkbenchProfile

reloadActiveProfile

void reloadActiveProfile()
Loads the active profile from the default Workbench profile location for this install.


setDefaultActiveProfile

boolean setDefaultActiveProfile()
                                throws TigerstripeException
Sets the active profile to the factory defaults. If a factory.wbp file is found, it will be used as default. If not a simple default profile is set

Returns:
true if a rollback file was created to enable a rollback
Throws:
TigerstripeException

makeWorkbenchProfile

IWorkbenchProfile makeWorkbenchProfile()
Factory method for IWorkbenchProfiles

Returns:
IWorkbenchProfile - returns a new empty IWorkbenchProfile

getWorkbenchProfileFor

IWorkbenchProfile getWorkbenchProfileFor(java.lang.String pathname)
                                         throws TigerstripeException
Throws:
TigerstripeException

saveAsActiveProfile

boolean saveAsActiveProfile(IWorkbenchProfile profile)
                            throws TigerstripeException
Sets the given profile as the active profile by saving it as such. A rollback file is created to rollback to the current active profile.

Note: the profile is NOT reloaded, the action only sets up the given profile as the active profile. A reloadActiveProfile() is required.

Parameters:
profile -
Returns:
boolean - true if a rollback file was created.
Throws:
TigerstripeException

rollbackActiveProfile

IWorkbenchProfile rollbackActiveProfile()
                                        throws TigerstripeException
Rolls back the active profile to its previous version. If no rollback file is available, no action is performed.

Note: the profile is NOT reloaded, the rollback action only sets up the previous profile as the active profile. A reloadActiveProfile() is required.

Returns:
IWorkbenchProfile - the profile that was rolled back to.
Throws:
TigerstripeException

canRollback

boolean canRollback()
Returns true if a rollback file can be found to perform a rollback

Returns:
true if it is possible to rollback to the previous active profile

addActiveProfileListener

void addActiveProfileListener(org.eclipse.tigerstripe.internal.api.profile.IActiveWorkbenchProfileChangeListener listener)
Registers a listener that will be called back each time the active profile changes

Parameters:
listener -

removeActiveProfileListener

void removeActiveProfileListener(org.eclipse.tigerstripe.internal.api.profile.IActiveWorkbenchProfileChangeListener listener)
Un-registers the given listener from the list of active profile listeners

Parameters:
listener -