@Override public void run() { validateState(input); } });
@Override public boolean validateEditorInputState() { boolean enabled= false; synchronized (this) { enabled= fIsStateValidationEnabled; } if (enabled) { ISourceViewer viewer= fSourceViewer; if (viewer == null) return false; fTextInputListener.inputChanged= false; viewer.addTextInputListener(fTextInputListener); try { final IEditorInput input= getEditorInput(); BusyIndicator.showWhile(getSite().getShell().getDisplay(), () -> validateState(input)); sanityCheckState(input); return !isEditorInputReadOnly() && !fTextInputListener.inputChanged; } finally { viewer.removeTextInputListener(fTextInputListener); } } return !isEditorInputReadOnly(); }
/** * The <code>AbstractTextEditor</code> implementation of this * <code>IEditorPart</code> method may be extended by subclasses. * * @param progressMonitor the progress monitor for communicating result state or <code>null</code> */ public void doSave(IProgressMonitor progressMonitor) { IDocumentProvider p= getDocumentProvider(); if (p == null) return; if (p.isDeleted(getEditorInput())) { if (isSaveAsAllowed()) { /* * 1GEUSSR: ITPUI:ALL - User should never loose changes made in the editors. * Changed Behavior to make sure that if called inside a regular save (because * of deletion of input element) there is a way to report back to the caller. */ performSaveAs(progressMonitor); } else { Shell shell= getSite().getShell(); String title= EditorMessages.Editor_error_save_deleted_title; String msg= EditorMessages.Editor_error_save_deleted_message; MessageDialog.openError(shell, title, msg); } } else { updateState(getEditorInput()); validateState(getEditorInput()); performSave(false, progressMonitor); } }
validateState(getEditorInput()); performSave(false, progressMonitor);
validateState(getEditorInput()); performSave(false, progressMonitor);
validateState(getEditorInput()); d.getDocument(getEditorInput()).set(previousContent); updateStatusField(ITextEditorActionConstants.STATUS_CATEGORY_ELEMENT_STATE);