Package org.eclipse.ui.internal
Class SaveableHelper
java.lang.Object
org.eclipse.ui.internal.SaveableHelper
Helper class for prompting to save dirty views or editors.
- Since:
- 3.0.1
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic voiddoSaveModel(Saveable model, IProgressMonitor progressMonitor, IShellProvider shellProvider, boolean blockUntilSaved) static ISaveablePartstatic ISaveablePart2static booleanstatic booleanisSaveable(Object o) static booleanstatic booleanneedsSave(ISaveablesSource modelSource) Returns whether the model source needs saving.static booleansavePart(ISaveablePart saveable, IWorkbenchPart part, IWorkbenchWindow window, boolean confirm) Saves the workbench part.static intFOR USE BY THE AUTOMATED TEST HARNESS ONLY.static voidtestSetAutomatedResponse(int response) FOR USE BY THE AUTOMATED TEST HARNESS ONLY.static booleanwaitForBackgroundSaveJobs(List modelsToSave) Waits for the background save jobs (if any) of the given saveables to complete.
- 
Field Details- 
USER_RESPONSEpublic static final int USER_RESPONSEThe helper must prompt.- See Also:
 
 
- 
- 
Constructor Details- 
SaveableHelperpublic SaveableHelper()
 
- 
- 
Method Details- 
testSetAutomatedResponsepublic static void testSetAutomatedResponse(int response) FOR USE BY THE AUTOMATED TEST HARNESS ONLY. Sets the response to use whensavePartis called withconfirm=true.- Parameters:
- response- 0 for yes, 1 for no, 2 for cancel, -1 for default (prompt)
 
- 
testGetAutomatedResponsepublic static int testGetAutomatedResponse()FOR USE BY THE AUTOMATED TEST HARNESS ONLY. Sets the response to use whensavePartis called withconfirm=true.- Returns:
- 0 for yes, 1 for no, 2 for cancel, -1 for default (prompt)
 
- 
savePartpublic static boolean savePart(ISaveablePart saveable, IWorkbenchPart part, IWorkbenchWindow window, boolean confirm) Saves the workbench part.- Parameters:
- saveable- the part
- part- the same part
- window- the workbench window
- confirm- request confirmation
- Returns:
- truefor continue,- falseif the operation was canceled.
 
- 
needsSaveReturns whether the model source needs saving. This is true if any of the active models are dirty. This logic must correspond withsaveModels(org.eclipse.ui.ISaveablesSource, org.eclipse.ui.IWorkbenchWindow, boolean)above.- Parameters:
- modelSource- the model source
- Returns:
- trueif save is required,- falseotherwise
- Since:
- 3.2
 
- 
doSaveModelpublic static void doSaveModel(Saveable model, IProgressMonitor progressMonitor, IShellProvider shellProvider, boolean blockUntilSaved) 
- 
waitForBackgroundSaveJobsWaits for the background save jobs (if any) of the given saveables to complete. This may open a progress dialog with the option to cancel.- Returns:
- true if the user canceled.
 
- 
getSaveable
- 
isSaveable
- 
getSaveable2
- 
isSaveable2
- 
isDirtyStateSupported
 
-