@Override public void changed(Object element) { fParentProvider.changed(element); }
public void changed(Object element) { fParentProvider.changed(element); }
@Override public void changed(Object element) { FileInfo info= fFileInfoMap.get(element); if (info == null) getParentProvider().changed(element); }
public void changed(Object element) { FileInfo info= (FileInfo) fFileInfoMap.get(element); if (info == null) getParentProvider().changed(element); }
/** * A helper method to save a document. * * @param provider the document provider * @param documentKey the document key * @param document the document * @param overwrite indicates whether overwrite should be performed * while saving the given element if necessary * @param monitor a progress monitor * @throws CoreException */ protected void saveDocument(IDocumentProvider provider, IEditorInput documentKey, IDocument document, boolean overwrite, IProgressMonitor monitor) throws CoreException { try { provider.aboutToChange(documentKey); provider.saveDocument(monitor, documentKey, document, overwrite); } finally { provider.changed(documentKey); } }
/** * A helper method to save a document. * * @param provider the document provider * @param documentKey the document key * @param document the document * @param overwrite indicates whether overwrite should be performed * while saving the given element if necessary * @param monitor a progress monitor * @throws CoreException */ protected void saveDocument(IDocumentProvider provider, IEditorInput documentKey, IDocument document, boolean overwrite, IProgressMonitor monitor) throws CoreException { try { provider.aboutToChange(documentKey); provider.saveDocument(monitor, documentKey, document, overwrite); } finally { provider.changed(documentKey); } }
public void flushEditorInput() { if (!fEditOperations.isEmpty()) { IDocument doc = fDocumentProvider.getDocument(fEditorInput); fDocumentProvider.aboutToChange(fEditorInput); flushModel(doc); fDocumentProvider.changed(fEditorInput); fValidated = false; } else if ((fModel instanceof IEditable) && ((IEditable) fModel).isDirty()) { // When text edit operations are made that cancel each other out, // the editor is not undirtied // e.g. Extensions page: Move an element up and then move it down // back in the same position: Bug # 197831 ((IEditable) fModel).setDirty(false); } }
public void doSave(IProgressMonitor monitor) { try { IDocument doc = fDocumentProvider.getDocument(fEditorInput); fDocumentProvider.aboutToChange(fEditorInput); flushModel(doc); fDocumentProvider.saveDocument(monitor, fEditorInput, doc, true); fDocumentProvider.changed(fEditorInput); fValidated = false; } catch (CoreException e) { PDEPlugin.logException(e); } }
public boolean flush() throws CoreException { if (fDocumentProvider != null) { IEditorInput input = getDocumentKey(); IDocument document = fDocumentProvider.getDocument(input); if (document != null) { final ISharedDocumentAdapter sda = Adapters.adapt(fElement, ISharedDocumentAdapter.class); if (sda != null) { sda.flushDocument(fDocumentProvider, input, document, false); return true; } try { fDocumentProvider.aboutToChange(input); fDocumentProvider.saveDocument(new NullProgressMonitor(), input, document, false); return true; } finally { fDocumentProvider.changed(input); } } } return false; }
@Override public void flushEditorInput() { // Override parent, since this editor does not utilize edit operations IDocumentProvider provider = getDocumentProvider(); IEditorInput input = getInput(); IDocument doc = provider.getDocument(input); provider.aboutToChange(input); flushModel(doc); provider.changed(input); setValidated(false); }
public boolean flush() throws CoreException { if (fDocumentProvider != null) { IEditorInput input = getDocumentKey(); IDocument document = fDocumentProvider.getDocument(input); if (document != null) { final ISharedDocumentAdapter sda = (ISharedDocumentAdapter) Utilities.getAdapter(fElement, ISharedDocumentAdapter.class); if (sda != null) { sda.flushDocument(fDocumentProvider, input, document, false); return true; } try { fDocumentProvider.aboutToChange(input); fDocumentProvider.saveDocument(new NullProgressMonitor(), input, document, false); return true; } finally { fDocumentProvider.changed(input); } } } return false; }
/** * Performs revert and handles errors appropriately. * <p> * Subclasses may extend. * </p> * * @since 3.0 */ protected void performRevert() { IDocumentProvider provider= getDocumentProvider(); if (provider == null) return; try { provider.aboutToChange(getEditorInput()); provider.resetDocument(getEditorInput()); editorSaved(); } catch (CoreException x) { IStatus status= x.getStatus(); if (status == null || status.getSeverity() != IStatus.CANCEL ) { Shell shell= getSite().getShell(); String title= EditorMessages.Editor_error_revert_title; String msg= EditorMessages.Editor_error_revert_message; ErrorDialog.openError(shell, title, msg, x.getStatus()); } } finally { provider.changed(getEditorInput()); } }
/** * Performs revert and handles errors appropriately. * <p> * Subclasses may extend. * </p> * * @since 3.0 */ protected void performRevert() { IDocumentProvider provider= getDocumentProvider(); if (provider == null) return; try { provider.aboutToChange(getEditorInput()); provider.resetDocument(getEditorInput()); editorSaved(); } catch (CoreException x) { IStatus status= x.getStatus(); if (status == null || status.getSeverity() != IStatus.CANCEL ) { Shell shell= getSite().getShell(); String title= EditorMessages.Editor_error_revert_title; String msg= EditorMessages.Editor_error_revert_message; ErrorDialog.openError(shell, title, msg, x.getStatus()); } } finally { provider.changed(getEditorInput()); } }
/** * Performs revert and handles errors appropriately. * <p> * Subclasses may extend. * </p> * * @since 3.0 */ protected void performRevert() { IDocumentProvider provider= getDocumentProvider(); if (provider == null) return; try { provider.aboutToChange(getEditorInput()); provider.resetDocument(getEditorInput()); editorSaved(); } catch (CoreException x) { IStatus status= x.getStatus(); if (status == null || status.getSeverity() != IStatus.CANCEL ) { Shell shell= getSite().getShell(); String title= EditorMessages.Editor_error_revert_title; String msg= EditorMessages.Editor_error_revert_message; ErrorDialog.openError(shell, title, msg, x.getStatus()); } } finally { provider.changed(getEditorInput()); } }
/** * Performs the save and handles errors appropriately. * * @param overwrite indicates whether or not overwriting is allowed * @param progressMonitor the monitor in which to run the operation * @since 3.0 */ protected void performSave(boolean overwrite, IProgressMonitor progressMonitor) { IDocumentProvider provider= getDocumentProvider(); if (provider == null) return; try { provider.aboutToChange(getEditorInput()); IEditorInput input= getEditorInput(); provider.saveDocument(progressMonitor, input, getDocumentProvider().getDocument(input), overwrite); editorSaved(); } catch (CoreException x) { IStatus status= x.getStatus(); if (status == null || status.getSeverity() != IStatus.CANCEL) handleExceptionOnSave(x, progressMonitor); } finally { provider.changed(getEditorInput()); } }
/** * Performs the save and handles errors appropriately. * * @param overwrite indicates whether or not overwriting is allowed * @param progressMonitor the monitor in which to run the operation * @since 3.0 */ protected void performSave(boolean overwrite, IProgressMonitor progressMonitor) { IDocumentProvider provider= getDocumentProvider(); if (provider == null) return; fHandleActivation= false; try { provider.aboutToChange(getEditorInput()); IEditorInput input= getEditorInput(); provider.saveDocument(progressMonitor, input, getDocumentProvider().getDocument(input), overwrite); editorSaved(); } catch (CoreException x) { IStatus status= x.getStatus(); if (status == null || status.getSeverity() != IStatus.CANCEL) handleExceptionOnSave(x, progressMonitor); } finally { provider.changed(getEditorInput()); fHandleActivation= true; } }
/** * Performs the save and handles errors appropriately. * * @param overwrite indicates whether or not overwriting is allowed * @param progressMonitor the monitor in which to run the operation * @since 3.0 */ protected void performSave(boolean overwrite, IProgressMonitor progressMonitor) { IDocumentProvider provider= getDocumentProvider(); if (provider == null) return; fHandleActivation= false; try { provider.aboutToChange(getEditorInput()); IEditorInput input= getEditorInput(); provider.saveDocument(progressMonitor, input, getDocumentProvider().getDocument(input), overwrite); editorSaved(); } catch (CoreException x) { IStatus status= x.getStatus(); if (status == null || status.getSeverity() != IStatus.CANCEL) handleExceptionOnSave(x, progressMonitor); } finally { provider.changed(getEditorInput()); fHandleActivation= true; } }
throw e; } finally { fDocumentProvider.changed(newInput);
MessageDialog.openError(shell, title, msg); } finally { getDocumentProvider().changed(newInput); if (success) { setInput(newInput);
provider.changed(newInput); if (success)