Commit 64a529d5 authored by Sebastian Pretscher's avatar Sebastian Pretscher

Merge branch 'master' of git@github.com:jroith/cup-eclipse.git

parents 1deba8b2 edce46be
package de.tum.in.www2.cupplugin.controller;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.text.IDocument;
import org.eclipse.ui.progress.UIJob;
import de.in.tum.www2.cup.CupContext;
import de.in.tum.www2.cup.LALRResult;
import de.tum.in.www2.cupplugin.editors.CupTextEditor;
import de.tum.in.www2.cupplugin.model.Model;
public class LaLrResultJob extends UIJob {
private LALRResult lalrResult;
private long lalrResulRevisionNumber;
private CupContext lalrContext;
private CupTextEditor editor;
public LaLrResultJob(CupTextEditor editor, LALRResult result,
long revisionNumber, CupContext context) {
super("LaLr Result UI Job");
this.editor = editor;
this.lalrResult = result;
this.lalrResulRevisionNumber = revisionNumber;
this.lalrContext = context;
}
@Override
public IStatus runInUIThread(IProgressMonitor monitor) {
IDocument document = editor.getDocument();
if (document != null) {
Model model = Model.getInstanceForDocument(document);
model.setLaLrResultModel(this.lalrResult,
lalrResulRevisionNumber, lalrContext);
return Status.OK_STATUS;
}
return Status.CANCEL_STATUS;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment