public class BasicModelSaveablesProvider extends org.eclipse.ui.navigator.SaveablesProvider implements IModelDescriptorChangeListener
saveables provider
for Sphinx-managed shared model instances.Modifier and Type | Class and Description |
---|---|
static class |
BasicModelSaveablesProvider.SiteNotifyingSaveablesLifecycleListener
ISaveablesLifecycleListener implementation to be used in workbench parts s which
want the site-level saveable management to be automatically notified about all changes in
saveables signaled to this listener . |
Modifier and Type | Field and Description |
---|---|
protected boolean |
disposed
Flag indicating if this provider has been disposed yet or not.
|
protected static java.util.Map<IModelDescriptor,BasicModelSaveable> |
saveables
The saveables hold by this provider.
|
Constructor and Description |
---|
BasicModelSaveablesProvider() |
Modifier and Type | Method and Description |
---|---|
protected BasicModelSaveable |
createModelSaveable(IModelDescriptor modelDescriptor) |
protected IModelSaveLifecycleListener |
createModelSaveLifecycleListener()
Creates a new
IModelSaveLifecycleListener . |
void |
dispose() |
protected void |
doInit() |
protected void |
doRun(org.eclipse.ui.Saveable saveable,
int SaveablesLifecycleEventType) |
protected void |
fireSaveablesLifecycleEventUIThread(org.eclipse.ui.Saveable saveable,
int SaveablesLifecycleEventType,
boolean async)
Fires the suitable notification corresponding to the SaveablesLifecycleEventType.
|
java.lang.Object[] |
getElements(org.eclipse.ui.Saveable saveable) |
protected org.eclipse.ui.Saveable |
getSaveable(IModelDescriptor modelDescriptor) |
org.eclipse.ui.Saveable |
getSaveable(java.lang.Object element) |
org.eclipse.ui.Saveable[] |
getSaveables() |
void |
handleModelAdded(IModelDescriptor modelDescriptor)
Nothing to do since Saveable are created lazily.
|
void |
handleModelRemoved(IModelDescriptor modelDescriptor)
Removes Saveable from saveables map and fires SaveablesLifecycleEvent.PRE_CLOSE and
SaveablesLifecycleEvent.POST_CLOSE notification.
|
boolean |
isDirty()
Returns whether at least one saveable is dirty (among saveables managed by this provider).
|
protected static java.util.Map<IModelDescriptor,BasicModelSaveable> saveables
protected boolean disposed
public boolean isDirty()
protected IModelSaveLifecycleListener createModelSaveLifecycleListener()
IModelSaveLifecycleListener
.protected void doInit()
doInit
in class org.eclipse.ui.navigator.SaveablesProvider
public void dispose()
dispose
in interface org.eclipse.ui.services.IDisposable
dispose
in class org.eclipse.ui.navigator.SaveablesProvider
public java.lang.Object[] getElements(org.eclipse.ui.Saveable saveable)
getElements
in class org.eclipse.ui.navigator.SaveablesProvider
protected BasicModelSaveable createModelSaveable(IModelDescriptor modelDescriptor)
modelDescriptor
- The identifier of the model for which a saveable must be created.public org.eclipse.ui.Saveable getSaveable(java.lang.Object element)
getSaveable
in class org.eclipse.ui.navigator.SaveablesProvider
protected org.eclipse.ui.Saveable getSaveable(IModelDescriptor modelDescriptor)
public org.eclipse.ui.Saveable[] getSaveables()
getSaveables
in class org.eclipse.ui.navigator.SaveablesProvider
protected void fireSaveablesLifecycleEventUIThread(org.eclipse.ui.Saveable saveable, int SaveablesLifecycleEventType, boolean async)
Notification is performed inside UI thread.
saveable
- The saveable created inside this provider.protected void doRun(org.eclipse.ui.Saveable saveable, int SaveablesLifecycleEventType)
public void handleModelAdded(IModelDescriptor modelDescriptor)
handleModelAdded
in interface IModelDescriptorChangeListener
modelDescriptor
- The model descriptor
that has been created.public void handleModelRemoved(IModelDescriptor modelDescriptor)
handleModelRemoved
in interface IModelDescriptorChangeListener
modelDescriptor
- The model descriptor
removed.