Package org.eclipse.xtext.ui.editor.model

Examples of org.eclipse.xtext.ui.editor.model.IXtextDocument.modify()


      /*
       * Textual and semantic updates cannot be done in the same IUnitOfWork (throws an
       * IllegalStateException), so index updates (semantic) are done first and tracked in the
       * commentsToUpdate list, then a 2nd IUnitOfWork processes the comment updates (textual).
       */
      document.modify(new IUnitOfWork.Void<XtextResource>() {
        @Override public void process(XtextResource resource) {
          Protobuf root = resources.rootOf(resource);
          if (!protobufs.isProto2(root) /*|| !resource.getErrors().isEmpty()*/) {
            return;
          }
View Full Code Here


          }
        }
      });

      if (!commentsToUpdate.isEmpty()) {
        document.modify(new IUnitOfWork.Void<XtextResource>() {
          @Override public void process(XtextResource resource) {
            for (Pair<EObject, Long> updateInfo : commentsToUpdate) {
              updateIndexInCommentOfParent(updateInfo.getFirst(), updateInfo.getSecond(), document);
            }
          }
View Full Code Here

    final XtextEditor xtextEditor = EditorUtils.getActiveXtextEditor(event);
    if (xtextEditor == null) {
      return null;
    }
    final IXtextDocument document = xtextEditor.getDocument();
    document.modify(new IUnitOfWork.Void<XtextResource>() {
      @Override
      public void process(XtextResource state) throws Exception {
        doExecute(xtextEditor, state);
      }
View Full Code Here

public class ContentFormatterFactory implements IContentFormatterFactory {

  public class ContentFormatter implements IContentFormatter {
    public void format(IDocument document, IRegion region) {
      IXtextDocument doc = (IXtextDocument) document;
      doc.modify(new FormattingUnitOfWork(doc, region));
    }

    public IFormattingStrategy getFormattingStrategy(String contentType) {
      return null;
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.