Search in sources :

Example 1 with TestTextViewer

use of org.eclipse.jface.text.tests.TestTextViewer 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)

Aggregations

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