Search in sources :

Example 1 with IReleasable

use of org.eclipse.wst.sse.ui.internal.IReleasable in project webtools.sourceediting by eclipse.

the class DocumentRegionProcessor method uninstall.

/**
 * @see org.eclipse.wst.sse.ui.internal.reconcile.DirtyRegionProcessor#uninstall()
 */
public void uninstall() {
    if (isInstalled()) {
        IReconcilingStrategy validatorStrategy = getValidatorStrategy();
        if (validatorStrategy != null) {
            if (validatorStrategy instanceof IReleasable)
                ((IReleasable) validatorStrategy).release();
        }
        if (fSpellcheckStrategy != null) {
            fSpellcheckStrategy.setDocument(null);
            fSpellcheckStrategy = null;
        }
        fReconcileListeners = new ISourceReconcilingListener[0];
        if (getDocument() instanceof IStructuredDocument) {
            RegionParser parser = ((IStructuredDocument) getDocument()).getParser();
            if (parser instanceof StructuredDocumentRegionParser) {
                ((StructuredDocumentRegionParser) parser).removeStructuredDocumentRegionHandler(fResetHandler);
            }
        }
    }
    super.uninstall();
}
Also used : IReconcilingStrategy(org.eclipse.jface.text.reconciler.IReconcilingStrategy) IReleasable(org.eclipse.wst.sse.ui.internal.IReleasable) IStructuredDocument(org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument) StructuredDocumentRegionParser(org.eclipse.wst.sse.core.internal.ltk.parser.StructuredDocumentRegionParser) RegionParser(org.eclipse.wst.sse.core.internal.ltk.parser.RegionParser) StructuredDocumentRegionParser(org.eclipse.wst.sse.core.internal.ltk.parser.StructuredDocumentRegionParser)

Example 2 with IReleasable

use of org.eclipse.wst.sse.ui.internal.IReleasable in project webtools.sourceediting by eclipse.

the class JSPContentAssistProcessor method releaseMap.

protected void releaseMap(HashMap map) {
    if (map != null) {
        if (!map.isEmpty()) {
            Iterator it = map.keySet().iterator();
            Object key = null;
            while (it.hasNext()) {
                key = it.next();
                if (map.get(key) instanceof IReleasable) {
                    ((IReleasable) map.get(key)).release();
                }
            }
        }
        map.clear();
        map = null;
    }
}
Also used : Iterator(java.util.Iterator) IReleasable(org.eclipse.wst.sse.ui.internal.IReleasable)

Example 3 with IReleasable

use of org.eclipse.wst.sse.ui.internal.IReleasable in project webtools.sourceediting by eclipse.

the class NoRegionContentAssistProcessor method releaseMap.

protected void releaseMap(HashMap map) {
    if ((map != null) && !map.isEmpty()) {
        Iterator it = map.keySet().iterator();
        Object key = null;
        while (it.hasNext()) {
            key = it.next();
            if (map.get(key) instanceof IReleasable) {
                ((IReleasable) map.get(key)).release();
            }
        }
        map.clear();
        map = null;
    }
}
Also used : Iterator(java.util.Iterator) IReleasable(org.eclipse.wst.sse.ui.internal.IReleasable)

Example 4 with IReleasable

use of org.eclipse.wst.sse.ui.internal.IReleasable 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

IReleasable (org.eclipse.wst.sse.ui.internal.IReleasable)4 Iterator (java.util.Iterator)3 IReconcileStep (org.eclipse.jface.text.reconciler.IReconcileStep)1 IReconcilingStrategy (org.eclipse.jface.text.reconciler.IReconcilingStrategy)1 RegionParser (org.eclipse.wst.sse.core.internal.ltk.parser.RegionParser)1 StructuredDocumentRegionParser (org.eclipse.wst.sse.core.internal.ltk.parser.StructuredDocumentRegionParser)1 IStructuredDocument (org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument)1