Package org.eclipse.xtext.mqrepl.ui.views

Examples of org.eclipse.xtext.mqrepl.ui.views.ModelQueryLanguageView


  public Object execute(ExecutionEvent event) {

    final IWorkbenchPart view = HandlerUtil.getActivePart(event);
    IEditorPart activeEditor = HandlerUtil.getActiveEditor(event);
     if (view instanceof ModelQueryLanguageView) {
      final ModelQueryLanguageView mqlv = (ModelQueryLanguageView) view;
      final Holder<String> ref = new Holder<String>();
      try {
        workbench.getProgressService().run(true, true, new IRunnableWithProgress() {

          @Override
          public void run(final IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
            XtextDocument doc = ((ModelQueryLanguageView) view).getEmbeddedEditor().getDocument();
            String result = doc.readOnly(new IUnitOfWork<String, XtextResource>() {
              @Override
              public String exec(XtextResource r) throws Exception {
                Model m = (Model) r.getContents().get(0);
                return interpret(m, monitor);
              }
            });
            ref.set(result);
          }
        });
        mqlv.getEmbeddedEditorResult().getDocument().set(ref.get());
      } catch (InvocationTargetException e) {
        e.printStackTrace();
      } catch (InterruptedException e) {
        e.printStackTrace();
      }
View Full Code Here

TOP

Related Classes of org.eclipse.xtext.mqrepl.ui.views.ModelQueryLanguageView

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.