|
Eclipse Platform Release 3.2 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Workbench parts that work in terms of units of saveability 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:
ISaveablePart
true
from ISaveablePart.isDirty()
true
from
ISaveablePart.isSaveOnCloseNeeded()
if it is dirty (the default
behaviour implemented by EditorPart
)ISaveablePart2
These conditions may be relaxed in future releases.
Method Summary | |
---|---|
Saveable[] |
getActiveSaveables()
Returns the saveables currently active in the workbench part. |
Saveable[] |
getSaveables()
Returns the saveables presented by the workbench part. |
Method Detail |
public Saveable[] getSaveables()
ISaveablesLifecycleListener.handleLifecycleEvent(SaveablesLifecycleEvent)
.
Additions of saveables to the list of saveables of this part are
announced using an event of type
SaveablesLifecycleEvent.POST_OPEN
. Removals are announced in a
two-stage process, first using an event of type
SaveablesLifecycleEvent.PRE_CLOSE
followed by an event of type
SaveablesLifecycleEvent.POST_CLOSE
. Since firing the
PRE_CLOSE
event may trigger prompts to save dirty
saveables, the cancellation status of the event must be checked by the
part after the notification. When removing only non-dirty saveables,
POST_CLOSE
notification is sufficient.
The listener is obtained from the part site by calling
partSite.getService(ISaveablesLifecycleListener.class)
.
The part must not notify from its initialization method, or from its
dispose method. Parts that implement IReusableEditor
must notify
when their input is changed by calling
IReusableEditor.setInput(IEditorInput)
.
ISaveablesLifecycleListener
public Saveable[] getActiveSaveables()
Certain workbench actions, such as Save, target only the active saveables in the active part. For example, the active saveables could be determined based on the current selection in the part.
|
Eclipse Platform Release 3.2 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.