/** * {@inheritDoc} * <p> * The implementation of this method only commits the underlying buffer if * {@link #needsSaving()} and {@link #isDocumentModified()} returns <code>true</code>. * </p> */ @Override protected void commit(IDocument document, IProgressMonitor pm) throws CoreException { if (needsSaving()) { fBuffer.commit(pm, false); } }
/** * {@inheritDoc} * <p> * The implementation of this method only commits the underlying buffer if * {@link #needsSaving()} and {@link #isDocumentModified()} returns <code>true</code>. * </p> */ protected void commit(IDocument document, IProgressMonitor pm) throws CoreException { if (needsSaving()) { fBuffer.commit(pm, false); } }
/** * {@inheritDoc} * <p> * The implementation of this method only commits the underlying buffer if * {@link #needsSaving()} and {@link #isDocumentModified()} returns <code>true</code>. * </p> */ @Override protected void commit(IDocument document, IProgressMonitor pm) throws CoreException { if (needsSaving()) { fBuffer.commit(pm, false); } }
@Override public RefactoringStatus isValid(IProgressMonitor monitor) throws CoreException { if (monitor == null) monitor= new NullProgressMonitor(); try { monitor.beginTask("", 1); //$NON-NLS-1$ if (fValidationState == null) throw new CoreException(new Status(IStatus.ERROR, RefactoringCorePlugin.getPluginId(), "TextFileChange has not been initialialized")); //$NON-NLS-1$ boolean needsSaving= needsSaving(); RefactoringStatus result= fValidationState.isValid(needsSaving); if (needsSaving) { result.merge(Changes.validateModifiesFiles(new IFile[] { fFile})); } else { // we are reading the file. So it should be at least in sync result.merge(Changes.checkInSync(new IFile[] { fFile})); } return result; } finally { monitor.done(); } }
@Override public RefactoringStatus isValid(IProgressMonitor monitor) throws CoreException { if (monitor == null) monitor= new NullProgressMonitor(); try { monitor.beginTask("", 1); //$NON-NLS-1$ if (fValidationState == null) throw new CoreException(new Status(IStatus.ERROR, RefactoringCorePlugin.getPluginId(), "TextFileChange has not been initialialized")); //$NON-NLS-1$ boolean needsSaving= needsSaving(); RefactoringStatus result= fValidationState.isValid(needsSaving); if (needsSaving) { result.merge(Changes.validateModifiesFiles(new IFile[] { fFile})); } else { // we are reading the file. So it should be at least in sync result.merge(Changes.checkInSync(new IFile[] { fFile})); } return result; } finally { monitor.done(); } }
/** * {@inheritDoc} */ public RefactoringStatus isValid(IProgressMonitor monitor) throws CoreException { try { monitor.beginTask("", 1); //$NON-NLS-1$ boolean needsSaving= needsSaving(); RefactoringStatus result= fValidationState.isValid(needsSaving); if (needsSaving) { result.merge(Changes.validateModifiesFiles(new IFile[] { fFile})); } else { // we are reading the file. So it should be at least in sync result.merge(Changes.checkInSync(new IFile[] { fFile})); } return result; } finally { monitor.done(); } }