Represents a source of Saveable objects (units of saveability). Workbench parts that show more than one unit of saveability, or whose units of saveability change over time, should implement this interface in order to provide better integration with workbench facilities like the Save command, prompts to save on part close or shutdown, etc.
IMPORTANT: As of 3.2, implementers of ISaveablesSource
must satisfy the following conditions:
- If ISaveablesSource is implemented by an IWorkbenchPart:
- the part must implement
ISaveablePart
- if any of its Saveable objects are dirty, the part must return
true
from {@link ISaveablePart#isDirty()} - the part must return
true
from {@link ISaveablePart#isSaveOnCloseNeeded()} if it is dirty (the defaultbehaviour implemented by {@link EditorPart}) - the part must not implement {@link ISaveablePart2}
- If ISaveablesSource is implemented by a non-part (possible as of 3.2.1 and 3.3):
- the Workbench's {@link ISaveablesLifecycleListener} (obtained from theWorkbench by calling
workbench.getService(ISaveablesLifecycleListener.class)
) must be notified of any change to the result of {@link #getSaveables()} - getActiveSaveables() should be implemented to return an empty array
If any of these conditions are not met, it is undefined whether the Workbench will prompt to save dirty Saveables when closing parts or the Workbench.
These conditions may be relaxed in future releases.
@since 3.2