Search in sources :

Example 1 with IReconcileStep

use of org.eclipse.jface.text.reconciler.IReconcileStep in project webtools.sourceediting by eclipse.

the class ValidatorStrategy method setDocument.

/**
 * @see org.eclipse.wst.sse.ui.internal.reconcile.AbstractStructuredTextReconcilingStrategy#setDocument(org.eclipse.jface.text.IDocument)
 */
public void setDocument(IDocument document) {
    super.setDocument(document);
    fFile = null;
    try {
        fValidatorsSuspended = false;
        if (document != null) {
            IFile file = getFile();
            if (file != null) {
                // Validation is suspended for this resource, do nothing
                fValidatorsSuspended = !file.isAccessible() || ValidationFramework.getDefault().isSuspended(file.getProject()) || ValidationFramework.getDefault().getProjectSettings(file.getProject()).getSuspend();
            }
        }
    } catch (Exception e) {
        fValidatorsSuspended = true;
        Logger.logException(e);
    }
    // validator steps are in "fVIdToVStepMap" (as opposed to fFirstStep >
    // next step etc...)
    Iterator it = fVidToVStepMap.values().iterator();
    IReconcileStep step = null;
    while (it.hasNext()) {
        step = (IReconcileStep) it.next();
        step.setInputModel(new DocumentAdapter(document));
    }
}
Also used : IFile(org.eclipse.core.resources.IFile) IReconcileStep(org.eclipse.jface.text.reconciler.IReconcileStep) Iterator(java.util.Iterator) DocumentAdapter(org.eclipse.wst.sse.ui.internal.reconcile.DocumentAdapter)

Example 2 with IReconcileStep

use of org.eclipse.jface.text.reconciler.IReconcileStep in project webtools.sourceediting by eclipse.

the class ValidatorStrategy method release.

public void release() {
    super.release();
    fIsCancelled = true;
    Iterator it = fVidToVStepMap.values().iterator();
    IReconcileStep step = null;
    while (it.hasNext()) {
        step = (IReconcileStep) it.next();
        if (step instanceof IReleasable)
            ((IReleasable) step).release();
    }
    fFile = null;
}
Also used : IReconcileStep(org.eclipse.jface.text.reconciler.IReconcileStep) Iterator(java.util.Iterator) IReleasable(org.eclipse.wst.sse.ui.internal.IReleasable)

Aggregations

Iterator (java.util.Iterator)2 IReconcileStep (org.eclipse.jface.text.reconciler.IReconcileStep)2 IFile (org.eclipse.core.resources.IFile)1 IReleasable (org.eclipse.wst.sse.ui.internal.IReleasable)1 DocumentAdapter (org.eclipse.wst.sse.ui.internal.reconcile.DocumentAdapter)1