public void doSave(IProgressMonitor monitor) { if (_activeEditor != null) { _activeEditor.doSave(monitor); } }
@Override public void doSave(IProgressMonitor monitor) { for (IEditorPart e : innerEditors) { e.doSave(monitor); } }
public void run() { part.doSave(monitor); } });
public void run(IProgressMonitor pm) throws InterruptedException { int count= dirtyEditors.length; pm.beginTask("", count); //$NON-NLS-1$ for (int i= 0; i < count; i++) { IEditorPart editor= dirtyEditors[i]; editor.doSave(new SubProgressMonitor(pm, 1)); if (pm.isCanceled()) throw new InterruptedException(); } pm.done(); } };
void save(IProgressMonitor monitor) { if (editorRef == null) { return; } IEditorPart editor = (IEditorPart) editorRef.getPart(true); if (editor != null) { editor.doSave(monitor); } }
/** * Saves the multi-page editor's document. */ public void doSave(IProgressMonitor monitor) { getEditor(0).doSave(monitor); }
/** * Saves the multi-page editor's document. */ public void doSave(IProgressMonitor monitor) { getEditor(0).doSave(monitor); }
@Override public void run(IProgressMonitor pm) throws InterruptedException { int count= dirtyEditors.length; pm.beginTask("", count); //$NON-NLS-1$ for (int i= 0; i < count; i++) { IEditorPart editor= dirtyEditors[i]; editor.doSave(new SubProgressMonitor(pm, 1)); if (pm.isCanceled()) throw new InterruptedException(); } pm.done(); } };
@Override public void run(IProgressMonitor pm) throws InterruptedException { int count= dirtyEditors.length; pm.beginTask("", count); //$NON-NLS-1$ for (int i= 0; i < count; i++) { IEditorPart editor= dirtyEditors[i]; editor.doSave(new SubProgressMonitor(pm, 1)); if (pm.isCanceled()) throw new InterruptedException(); } pm.done(); } };
@Override public void run(IProgressMonitor pm) throws InterruptedException { int count= dirtyEditors.length; pm.beginTask("", count); //$NON-NLS-1$ for (int i= 0; i < count; i++) { IEditorPart editor= dirtyEditors[i]; editor.doSave(new SubProgressMonitor(pm, 1)); if (pm.isCanceled()) throw new InterruptedException(); } pm.done(); } };
@Override public void run(IProgressMonitor pm) throws InterruptedException { int count= dirtyEditors.length; pm.beginTask("", count); //$NON-NLS-1$ for (int i= 0; i < count; i++) { IEditorPart editor= dirtyEditors[i]; editor.doSave(new SubProgressMonitor(pm, 1)); if (pm.isCanceled()) throw new InterruptedException(); } pm.done(); } };
public void run() { IEditorPart parent = _sqlEditor.getParentEditor(); if (parent != null) { parent.doSave(new NullProgressMonitor()); } else { _sqlEditor.doSave(new NullProgressMonitor()); } }
protected void saveDeclaringEditor(IRenameElementContext context, IWorkbenchPage workbenchPage) { IEditorPart declaringEditor = getOpenEditor(context.getTargetElementURI(), workbenchPage); if (declaringEditor != null && declaringEditor.isDirty()) declaringEditor.doSave(new NullProgressMonitor()); }
public static boolean saveDirtyFiles() { boolean result = true; // TODO (cs) add support for save automatically Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(); IEditorPart[] dirtyEditors = getDirtyEditors(); if (dirtyEditors.length > 0) { result = false; SaveDirtyFilesDialog saveDirtyFilesDialog = new SaveDirtyFilesDialog(shell); saveDirtyFilesDialog.setInput(Arrays.asList(dirtyEditors)); // Save all open editors. if (saveDirtyFilesDialog.open() == Window.OK) { result = true; int numDirtyEditors = dirtyEditors.length; for (int i = 0; i < numDirtyEditors; i++) { dirtyEditors[i].doSave(null); } } } return result; }
editorPart[0].doSave(new SubProgressMonitor(pm, 1)); //avoid showing error marker due to missing/wrong package declaration return cu;
editorPart[0].doSave(new SubProgressMonitor(pm, 1)); //avoid showing error marker due to missing/wrong package declaration return cu;
public void reconcileAllEditors(IWorkbench workbench, final boolean saveAll, IProgressMonitor monitor) { SubMonitor pm0 = SubMonitor.convert(monitor, workbench.getWorkbenchWindowCount()); for (IWorkbenchWindow window : workbench.getWorkbenchWindows()) { SubMonitor pm1 = pm0.newChild(1).setWorkRemaining(window.getPages().length); for (IWorkbenchPage page : window.getPages()) { SubMonitor pm2 = pm1.newChild(1).setWorkRemaining(2 * page.getEditorReferences().length); for (IEditorReference editorReference : page.getEditorReferences()) { if (pm2.isCanceled()) return; IEditorPart editor = editorReference.getEditor(false); if (editor != null) { if (editor instanceof XtextEditor) waitForReconciler((XtextEditor) editor); if (saveAll) editor.doSave(pm2.newChild(1)); } pm2.worked(1); } } } }