Eclipse Platform
Release 3.2

org.eclipse.ui
Interface ISaveableModelManager

All Superinterfaces:
IModelLifecycleListener

public interface ISaveableModelManager
extends IModelLifecycleListener

The model manager maintains a list of open saveable models.

Since:
3.2
See Also:
SaveableModel, ISaveableModelSource

Method Summary
 void addModelLifecycleListener(IModelLifecycleListener listener)
          Adds the given listener to the list of listeners.
 ISaveableModel[] getOpenModels()
          Returns the list of open models managed by this model manager.
 void handleModelLifecycleEvent(ModelLifecycleEvent event)
          This implementation of handleModelLifecycleEvent must be called by implementers of ISaveableModelSource whenever the list of models of the model source changes, or when the dirty state of models changes.
 void removeModelLifecycleListener(IModelLifecycleListener listener)
          Removes the given listener from the list of listeners.
 

Method Detail

getOpenModels

public ISaveableModel[] getOpenModels()
Returns the list of open models managed by this model manager.

Returns:
a list of models

handleModelLifecycleEvent

public void handleModelLifecycleEvent(ModelLifecycleEvent event)
This implementation of handleModelLifecycleEvent must be called by implementers of ISaveableModelSource whenever the list of models of the model source changes, or when the dirty state of models changes. The ISaveableModelSource instance must be passed as the source of the event object.

This method may also be called by objects that hold on to models but are not workbench parts. In this case, the event source must be set to an object that is not an instanceof IWorkbenchPart.

Corresponding open and close events must originate from the same (identical) event source.

This method must be called on the UI thread.

Specified by:
handleModelLifecycleEvent in interface IModelLifecycleListener
Parameters:
event -

addModelLifecycleListener

public void addModelLifecycleListener(IModelLifecycleListener listener)
Adds the given listener to the list of listeners. Has no effect if the same (identical) listener has already been added. The listener will be notified about changes to the models managed by this model manager. Event types include:
POST_OPEN when models were added to the list of models
POST_CLOSE when models were removed from the list of models
DIRTY_CHANGED when the dirty state of models changed

Listeners should ignore all other event types, including PRE_CLOSE. There is no guarantee that listeners are notified before models are closed.

Parameters:
listener -

removeModelLifecycleListener

public void removeModelLifecycleListener(IModelLifecycleListener listener)
Removes the given listener from the list of listeners. Has no effect if the given listener is not contained in the list.

Parameters:
listener -

Eclipse Platform
Release 3.2

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.