Search in sources :

Example 1 with AbstractReconciler

use of org.eclipse.jface.text.reconciler.AbstractReconciler in project eclipse.platform.text by eclipse.

the class AbstractReconcilerTest method setUp.

@Before
public void setUp() {
    fBarrier = new Barrier();
    fCallLog = Collections.synchronizedList(new ArrayList<String>());
    fReconciler = new AbstractReconciler() {

        @Override
        protected void initialProcess() {
            fCallLog.add("initialProcess");
            fBarrier.await();
        }

        @Override
        protected void process(DirtyRegion dirtyRegion) {
            fCallLog.add("process");
            fBarrier.await();
        }

        @Override
        protected void reconcilerDocumentChanged(IDocument newDocument) {
            fCallLog.add("reconcilerDocumentChanged");
        }

        @Override
        protected void aboutToBeReconciled() {
            fCallLog.add("aboutToBeReconciled");
        }

        @Override
        protected void reconcilerReset() {
            fCallLog.add("reconcilerReset");
        }

        @Override
        public IReconcilingStrategy getReconcilingStrategy(String contentType) {
            return null;
        }
    };
    fReconciler.setIsIncrementalReconciler(false);
    // make tests run faster
    fReconciler.setDelay(50);
    fProgressMonitor = new NullProgressMonitor();
    fReconciler.setProgressMonitor(fProgressMonitor);
    fViewer = new TestTextViewer();
    fReconciler.install(fViewer);
    fAccessor = new Accessor(fReconciler, AbstractReconciler.class);
    Object object = fAccessor.get("fThread");
    fAccessor = new Accessor(object, object.getClass());
}
Also used : NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) IReconcilingStrategy(org.eclipse.jface.text.reconciler.IReconcilingStrategy) TestTextViewer(org.eclipse.jface.text.tests.TestTextViewer) ArrayList(java.util.ArrayList) DirtyRegion(org.eclipse.jface.text.reconciler.DirtyRegion) Accessor(org.eclipse.text.tests.Accessor) IDocument(org.eclipse.jface.text.IDocument) AbstractReconciler(org.eclipse.jface.text.reconciler.AbstractReconciler) Before(org.junit.Before)

Example 2 with AbstractReconciler

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

the class AbstractReconcilerTest method setUp.

protected void setUp() {
    fBarrier = new Barrier();
    fCallLog = Collections.synchronizedList(new ArrayList());
    fReconciler = new AbstractReconciler() {

        protected void initialProcess() {
            fCallLog.add("initialProcess");
            fBarrier.await();
        }

        protected void process(DirtyRegion dirtyRegion) {
            fCallLog.add("process");
            fBarrier.await();
        }

        protected void reconcilerDocumentChanged(IDocument newDocument) {
            fCallLog.add("reconcilerDocumentChanged");
        }

        protected void aboutToBeReconciled() {
            fCallLog.add("aboutToBeReconciled");
        }

        protected void reconcilerReset() {
            fCallLog.add("reconcilerReset");
        }

        public IReconcilingStrategy getReconcilingStrategy(String contentType) {
            return null;
        }
    };
    fReconciler.setIsIncrementalReconciler(false);
    // make tests run faster
    fReconciler.setDelay(50);
    fViewer = new TestTextViewer();
    fReconciler.install(fViewer);
    fAccessor = new Accessor(fReconciler, AbstractReconciler.class);
    Object object = fAccessor.get("fThread");
    fAccessor = new Accessor(object, object.getClass());
}
Also used : IReconcilingStrategy(org.eclipse.jface.text.reconciler.IReconcilingStrategy) TestTextViewer(org.eclipse.jface.text.tests.TestTextViewer) ArrayList(java.util.ArrayList) DirtyRegion(org.eclipse.jface.text.reconciler.DirtyRegion) Accessor(org.eclipse.text.tests.Accessor) IDocument(org.eclipse.jface.text.IDocument) AbstractReconciler(org.eclipse.jface.text.reconciler.AbstractReconciler)

Aggregations

ArrayList (java.util.ArrayList)2 IDocument (org.eclipse.jface.text.IDocument)2 AbstractReconciler (org.eclipse.jface.text.reconciler.AbstractReconciler)2 DirtyRegion (org.eclipse.jface.text.reconciler.DirtyRegion)2 IReconcilingStrategy (org.eclipse.jface.text.reconciler.IReconcilingStrategy)2 TestTextViewer (org.eclipse.jface.text.tests.TestTextViewer)2 Accessor (org.eclipse.text.tests.Accessor)2 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)1 Before (org.junit.Before)1