Examples of replace()


Examples of org.eclipse.jdt.core.dom.rewrite.ASTRewrite.replace()

      /*
       * TODO: Need to remove resulting unused imports, but I am unsure of
       * how to do that.
       */

      astRewrite.replace(oldEnumDeclaration, newEnumDeclaration, null);
      this.rewriteAST(newEnumType.getCompilationUnit(), astRewrite,
          importRewrite);
    }

    return status;
View Full Code Here

Examples of org.eclipse.jdt.core.dom.rewrite.ListRewrite.replace()

        MethodDeclaration method = getMethodDeclaration(type, bug.getPrimaryMethod());
        Modifier originalModifier = getPublicModifier(method);

        ListRewrite listRewrite = rewrite.getListRewrite(method, MethodDeclaration.MODIFIERS2_PROPERTY);
        Modifier protectedModifier = workingUnit.getAST().newModifier(PROTECTED_KEYWORD);
        listRewrite.replace(originalModifier, protectedModifier, null);
    }

    private Modifier getPublicModifier(MethodDeclaration method) {
        List<?> list = method.modifiers();
        for (Object o : list) {
View Full Code Here

Examples of org.eclipse.jface.text.Document.replace()

    final IDocument buffer = new Document(document.get());
    int index = offset - 1;
    while (index >= 0 && Character.isJavaIdentifierPart(buffer.getChar(index)))
      index--;
    final int length = offset - index - 1;
    buffer.replace(index + 1, length, " "); //$NON-NLS-1$
    return true;
  }

  public boolean isAutoInsertable() {
    return false;
View Full Code Here

Examples of org.eclipse.jface.text.FindReplaceDocumentAdapter.replace()

        final String template = codeTemplate.get(htmlSnippet);
        if (template == null) {
          return;
        }
        String replace = (superRegion != null ? ";" : "{") + lineDelimiter + "add(new " + template + "(\"" + wicketId + "\"));";
        frda.replace(replace, false);
        marker.delete();
      }
    } catch (Exception e) {
    }
  }
View Full Code Here

Examples of org.eclipse.jface.text.IDocument.replace()

        IDocument doc = getEditor().getDocumentProvider().getDocument(getEditor().getEditorInput());
        try
        {
            // Repace the selection with the subroutine call
            doc.replace(selection.getOffset(), selection.getLength(), result[0]);

            int offset = -1;

            FindReplaceDocumentAdapter docFind = new FindReplaceDocumentAdapter(doc);
View Full Code Here

Examples of org.eclipse.jface.text.ILineTracker.replace()

        // replace \t character with spaces
        newText.replace(index, index + 1, indent);
        if (lineTracker != null) {
          try {
            lineTracker.replace(index, 1, indent);
          } catch (BadLocationException e) {
            // if something goes wrong with replacing text, just
            // reset to current string
            lineTracker.set(newText.toString());
            Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
View Full Code Here

Examples of org.eclipse.ocl.EvaluationEnvironment.replace()

      }
      EvaluationEnvironment evalEnv = oclQuery.getEvaluationEnvironment();
      // init environment
      for (Iterator it = env.entrySet().iterator(); it.hasNext();) {
        Map.Entry nextEntry = (Map.Entry) it.next();
        evalEnv.replace((String) nextEntry.getKey(), nextEntry
            .getValue());
      }
      try {
        initExtentMap(context);
        Object result = oclQuery.evaluate(context);
View Full Code Here

Examples of org.eclipse.php.internal.core.ast.rewrite.ASTRewrite.replace()

      } else {
        if(!createdMethodBody) {
          addReturnStatement(ast, extractedMethodBody, ASTNode.copySubtree(ast, selectedNodeOccurence.get(0)));
          createdMethodBody = true;
        }
        rewriter.replace( selectedNodeOccurence.get(0), inlineMethodCall, inlineReplacementEditGroup);
      }
    }
   

    classListRewrite.insertAfter(method, fCoveringDeclarationFinder.getCoveringMethodDeclaration(), newMethodEdit);
View Full Code Here

Examples of org.eclipse.php.internal.core.ast.rewrite.ListRewrite.replace()

              Assignment.OP_EQUAL, inlineMethodCall));
        } else {
          inlineReplacement = ast.newExpressionStatement(inlineMethodCall);
        }
       
        lrw.replace(selectedNodeOccurence.get(0),inlineReplacement, inlineReplacementEditGroup);
 
        for (int i = 1; i < selectedNodeOccurence.size(); ++i) {
          lrw.remove(selectedNodeOccurence.get(i), inlineReplacementEditGroup);
        }
       
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument.replace()

                                                            + phpToken
                                                                    .getStart()) == document
                                                    .getLineOfOffset(startOffset
                                                            + twigTokens[j + 1]
                                                                    .getStart())) {
                                        document.replace(
                                                startOffset + phpToken.getEnd(),
                                                0, newline);
                                        endLineIndex++;
                                    }
                                }
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.