Package org.eclipse.text.edits

Examples of org.eclipse.text.edits.MultiTextEdit.addChild()


   
    Object o = this.fSearchDocPath2JavaEditMap.get(searchDocPath);
    if(o != null) {

      MultiTextEdit multi = (MultiTextEdit)o;
      multi.addChild(javaEdit);
    }
    else {
      // use a multi edit so doc position offsets get updated automatically
      // when adding multiple child edits
      MultiTextEdit multi = new MultiTextEdit();
View Full Code Here


    }
    else {
      // use a multi edit so doc position offsets get updated automatically
      // when adding multiple child edits
      MultiTextEdit multi = new MultiTextEdit();
      multi.addChild(javaEdit);
      this.fSearchDocPath2JavaEditMap.put(searchDocPath, multi);
    }
  }
 
  /**
 
View Full Code Here

                defaultValue = ""; //$NON-NLS-1$
              String nameAndDefaultValue = " "; //$NON-NLS-1$
              if (i == 0 && lastRegion.getLength() > lastRegion.getTextLength())
                nameAndDefaultValue = ""; //$NON-NLS-1$
              nameAndDefaultValue += requiredAttributeName + "=\"" + defaultValue + "\""; //$NON-NLS-1$ //$NON-NLS-2$
              multiTextEdit.addChild(new InsertEdit(index, nameAndDefaultValue));
              // BUG3381: MultiTextEdit applies all child
              // TextEdit's basing on offsets
              //          in the document before the first TextEdit, not
              // after each
              //          child TextEdit. Therefore, do not need to
View Full Code Here

      // insert new element
      MultiTextEdit multiTextEdit = new MultiTextEdit();
      // element tag name cannot be DBCS, do not translate "<element>"
      // and "</element>"
      final String startElement = "<" + ELEMENT_NAME + ">"; //$NON-NLS-1$ //$NON-NLS-2$
      multiTextEdit.addChild(new InsertEdit(startTagOffset, startElement));
      multiTextEdit.addChild(new InsertEdit(endTagOffset, "</"+ELEMENT_NAME +">")); //$NON-NLS-1$ //$NON-NLS-2$
      multiTextEdit.apply(viewer.getDocument());
      Position start = new Position(startTagOffset);
      Position end = new Position(endTagOffset + startElement.length());
View Full Code Here

      MultiTextEdit multiTextEdit = new MultiTextEdit();
      // element tag name cannot be DBCS, do not translate "<element>"
      // and "</element>"
      final String startElement = "<" + ELEMENT_NAME + ">"; //$NON-NLS-1$ //$NON-NLS-2$
      multiTextEdit.addChild(new InsertEdit(startTagOffset, startElement));
      multiTextEdit.addChild(new InsertEdit(endTagOffset, "</"+ELEMENT_NAME +">")); //$NON-NLS-1$ //$NON-NLS-2$
      multiTextEdit.apply(viewer.getDocument());
      Position start = new Position(startTagOffset);
      Position end = new Position(endTagOffset + startElement.length());

      try {
View Full Code Here

    int endTagOffset = ((Integer) ((Object[]) fAdditionalFixInfo)[2]).intValue();
    int endTagLength = ((Integer) ((Object[]) fAdditionalFixInfo)[3]).intValue();

    MultiTextEdit multiTextEdit = new MultiTextEdit();
    if (endTagOffset != -1) {
      multiTextEdit.addChild(new DeleteEdit(endTagOffset, endTagLength));
      fSelection = new Point(endTagOffset, 0);
    }
    if (startTagOffset != -1) {
      multiTextEdit.addChild(new DeleteEdit(startTagOffset, startTagLength));
      fSelection = new Point(startTagOffset, 0);
View Full Code Here

    if (endTagOffset != -1) {
      multiTextEdit.addChild(new DeleteEdit(endTagOffset, endTagLength));
      fSelection = new Point(endTagOffset, 0);
    }
    if (startTagOffset != -1) {
      multiTextEdit.addChild(new DeleteEdit(startTagOffset, startTagLength));
      fSelection = new Point(startTagOffset, 0);
    }

    try {
      multiTextEdit.apply(viewer.getDocument());
View Full Code Here

              //found ident to change
              ReplaceEdit edit = new ReplaceEdit
                  identNode.getRegion().getOffset(),
                          identNode.getRegion().getLength(),
                          info.getNewName());     
              fileChangeRootEdit.addChild(edit);
              return false;
            }
          }
          return true;
        }
View Full Code Here

              //found token-ident to change
              ReplaceEdit edit = new ReplaceEdit
                  offset,
                  oldJavaName.length(),
                          newJavaName);     
              fileChangeRootEdit.addChild(edit);                         
            }
          }
          return super.visit(node);
        }
      };
View Full Code Here

                production = atgProductionReformatter.reformat();
                ReplaceEdit edit = new ReplaceEdit
                    productionNode.getRegion().getOffset(),
                    productionNode.getRegion().getLength(),
                    production);     
                fileChangeRootEdit.addChild(edit);
              } catch (Exception e) {
                e.printStackTrace();
              }
            } catch (BadLocationException e) {
              e.printStackTrace();
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.