Tabnine Logo
TextEditUtil.merge
Code IndexAdd Tabnine to your IDE (free)

How to use
merge
method
in
org.eclipse.jdt.internal.corext.refactoring.util.TextEditUtil

Best Java code snippets using org.eclipse.jdt.internal.corext.refactoring.util.TextEditUtil.merge (Showing top 8 results out of 315)

origin: org.eclipse.jdt/org.eclipse.jdt.core.manipulation

/**
 * Create an edit which contains <code>edit1</code> and <code>edit2</code>
 * <p>If <code>edit1</code> overlaps <code>edit2</code> this method fails with a {@link MalformedTreeException}</p>
 * <p><strong>The given edits are modified and they can no longer be used.</strong></p>
 *
 * @param edit1 the edit to merge with edit2
 * @param edit2 the edit to merge with edit1
 * @return the merged tree
 * @throws MalformedTreeException if {@link #overlaps(TextEdit, TextEdit)} returns <b>true</b>
 * @see #overlaps(TextEdit, TextEdit)
 * @since 3.4
 */
public static TextEdit merge(TextEdit edit1, TextEdit edit2) {
  if (edit1 instanceof MultiTextEdit && !edit1.hasChildren()) {
    return edit2;
  }
  if (edit2 instanceof MultiTextEdit && !edit2.hasChildren()) {
    return edit1;
  }
  MultiTextEdit result= new MultiTextEdit();
  merge(edit1, edit2, result);
  return result;
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

/**
 * Create an edit which contains <code>edit1</code> and <code>edit2</code>
 * <p>If <code>edit1</code> overlaps <code>edit2</code> this method fails with a {@link MalformedTreeException}</p>
 * <p><strong>The given edits are modified and they can no longer be used.</strong></p>
 *
 * @param edit1 the edit to merge with edit2
 * @param edit2 the edit to merge with edit1
 * @return the merged tree
 * @throws MalformedTreeException if {@link #overlaps(TextEdit, TextEdit)} returns <b>true</b>
 * @see #overlaps(TextEdit, TextEdit)
 * @since 3.4
 */
public static TextEdit merge(TextEdit edit1, TextEdit edit2) {
  if (edit1 instanceof MultiTextEdit && !edit1.hasChildren()) {
    return edit2;
  }
  if (edit2 instanceof MultiTextEdit && !edit2.hasChildren()) {
    return edit1;
  }
  MultiTextEdit result= new MultiTextEdit();
  merge(edit1, edit2, result);
  return result;
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

} else {
  CleanUpChange merge= new CleanUpChange(FixMessages.CleanUpRefactoring_clean_up_multi_chang_name, context.getCompilationUnit());
  merge.setEdit(TextEditUtil.merge(currentEdit, solution.getEdit()));
origin: org.eclipse.jdt/org.eclipse.jdt.ui

} else {
  CleanUpChange merge= new CleanUpChange(FixMessages.CleanUpRefactoring_clean_up_multi_chang_name, context.getCompilationUnit());
  merge.setEdit(TextEditUtil.merge(currentEdit, solution.getEdit()));
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

TextEdit resultEdit= TextEditUtil.merge(formatEdit, otherEdit);
if (!resultEdit.hasChildren())
  return null;
origin: org.eclipse.jdt/org.eclipse.jdt.core.manipulation

  merge(children1[i1], children2[i2], result);
merge(children[i], edit2, result);
i++;
while (i < children.length) {
merge(edit1, children[i], result);
i++;
while (i < children.length) {
origin: org.eclipse.jdt/org.eclipse.jdt.ui

TextEdit resultEdit= TextEditUtil.merge(formatEdit, otherEdit);
if (!resultEdit.hasChildren())
  return null;
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

  merge(children1[i1], children2[i2], result);
merge(children[i], edit2, result);
i++;
while (i < children.length) {
merge(edit1, children[i], result);
i++;
while (i < children.length) {
org.eclipse.jdt.internal.corext.refactoring.utilTextEditUtilmerge

Javadoc

Create an edit which contains edit1 and edit2

If edit1 overlaps edit2 this method fails with a MalformedTreeException

The given edits are modified and they can no longer be used.

Popular methods of TextEditUtil

  • flatten
  • isPacked
    Returns true if the given edit is minimal. That is if: * true if edit is a leaf * if edit is a inne
  • overlaps
    Does any node in edit1 overlap with any other node in edit2.If this returns true then the two edit t

Popular in Java

  • Finding current android device location
  • setRequestProperty (URLConnection)
  • onRequestPermissionsResult (Fragment)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now