| java.lang.Object org.eclipse.ui.internal.SaveableHelper
SaveableHelper | public class SaveableHelper (Code) | | Helper class for prompting to save dirty views or editors.
since: 3.0.1 |
Field Summary | |
final public static int | USER_RESPONSE The helper must prompt. |
Method Summary | |
public static void | doSaveModel(Saveable model, IProgressMonitor progressMonitor, IShellProvider shellProvider, boolean blockUntilSaved) | public static boolean | needsSave(ISaveablesSource modelSource) Returns whether the model source needs saving. | static boolean | runProgressMonitorOperation(String opName, IRunnableWithProgress progressOp, IWorkbenchWindow window) Runs a progress monitor operation. | static boolean | runProgressMonitorOperation(String opName, IRunnableWithProgress progressOp, IRunnableContext runnableContext, IShellProvider shellProvider) Runs a progress monitor operation. | static boolean | savePart(ISaveablePart saveable, IWorkbenchPart part, IWorkbenchWindow window, boolean confirm) Saves the workbench part. | static int | savePart(ISaveablePart2 saveable, IWorkbenchWindow window, boolean confirm) Saves the workbench part ... | public static int | testGetAutomatedResponse() FOR USE BY THE AUTOMATED TEST HARNESS ONLY.
Sets the response to use when savePart is called with confirm=true . | public static void | testSetAutomatedResponse(int response) FOR USE BY THE AUTOMATED TEST HARNESS ONLY.
Sets the response to use when savePart is called with confirm=true . | public static boolean | waitForBackgroundSaveJobs(List modelsToSave) Waits for the background save jobs (if any) of the given saveables to complete. |
USER_RESPONSE | final public static int USER_RESPONSE(Code) | | The helper must prompt.
|
doSaveModel | public static void doSaveModel(Saveable model, IProgressMonitor progressMonitor, IShellProvider shellProvider, boolean blockUntilSaved)(Code) | | Parameters: model - Parameters: progressMonitor - Parameters: shellProvider - Parameters: blockUntilSaved - |
needsSave | public static boolean needsSave(ISaveablesSource modelSource)(Code) | | Returns whether the model source needs saving. This is true if any of
the active models are dirty. This logic must correspond with
SaveableHelper.saveModels above.
Parameters: modelSource - the model source true if save is required, false otherwise since: 3.2 |
runProgressMonitorOperation | static boolean runProgressMonitorOperation(String opName, IRunnableWithProgress progressOp, IWorkbenchWindow window)(Code) | | Runs a progress monitor operation. Returns true if success, false if
canceled.
|
runProgressMonitorOperation | static boolean runProgressMonitorOperation(String opName, IRunnableWithProgress progressOp, IRunnableContext runnableContext, IShellProvider shellProvider)(Code) | | Runs a progress monitor operation.
Returns true if success, false if canceled or an error occurred.
|
savePart | static boolean savePart(ISaveablePart saveable, IWorkbenchPart part, IWorkbenchWindow window, boolean confirm)(Code) | | Saves the workbench part.
Parameters: saveable - the part Parameters: part - the same part Parameters: window - the workbench window Parameters: confirm - request confirmation true for continue, false if the operationwas canceled. |
testGetAutomatedResponse | public static int testGetAutomatedResponse()(Code) | | FOR USE BY THE AUTOMATED TEST HARNESS ONLY.
Sets the response to use when savePart is called with confirm=true .
0 for yes, 1 for no, 2 for cancel, -1 for default (prompt) |
testSetAutomatedResponse | public static void testSetAutomatedResponse(int response)(Code) | | FOR USE BY THE AUTOMATED TEST HARNESS ONLY.
Sets the response to use when savePart is called with confirm=true .
Parameters: response - 0 for yes, 1 for no, 2 for cancel, -1 for default (prompt) |
waitForBackgroundSaveJobs | public static boolean waitForBackgroundSaveJobs(List modelsToSave)(Code) | | Waits for the background save jobs (if any) of the given saveables to complete.
This may open a progress dialog with the option to cancel.
Parameters: modelsToSave - true if the user canceled. |
|
|