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

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

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

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

/**
 * Degenerates the given edit tree into a list.<br>
 * All nodes of the result are leafs.<br>
 * <strong>The given edit is modified and can no longer be used.</strong>
 *
 * @param edit the edit tree to flatten
 * @return a list of edits
 * @since 3.4
 */
public static MultiTextEdit flatten(TextEdit edit) {
  MultiTextEdit result= new MultiTextEdit();
  flatten(edit, result);
  return result;
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

/**
 * Degenerates the given edit tree into a list.<br>
 * All nodes of the result are leafs.<br>
 * <strong>The given edit is modified and can no longer be used.</strong>
 *
 * @param edit the edit tree to flatten
 * @return a list of edits
 * @since 3.4
 */
public static MultiTextEdit flatten(TextEdit edit) {
  MultiTextEdit result= new MultiTextEdit();
  flatten(edit, result);
  return result;
}
origin: eclipse/eclipse.jdt.ls

private List<org.eclipse.lsp4j.TextEdit> format(ICompilationUnit cu, IDocument document, IRegion region, FormattingOptions options, boolean includeComments, IProgressMonitor monitor) {
  if (cu == null || document == null || region == null || monitor.isCanceled()) {
    return Collections.emptyList();
  }
  CodeFormatter formatter = ToolFactory.createCodeFormatter(getOptions(options, cu));
  String lineDelimiter = TextUtilities.getDefaultLineDelimiter(document);
  String sourceToFormat = document.get();
  int kind = getFormattingKind(cu, includeComments);
  TextEdit format = formatter.format(kind, sourceToFormat, region.getOffset(), region.getLength(), 0, lineDelimiter);
  if (format == null || format.getChildren().length == 0 || monitor.isCanceled()) {
    // nothing to return
    return Collections.<org.eclipse.lsp4j.TextEdit>emptyList();
  }
  MultiTextEdit flatEdit = TextEditUtil.flatten(format);
  return convertEdits(flatEdit.getChildren(), document);
}
origin: org.eclipse.jdt/org.eclipse.jdt.core.manipulation

private static void flatten(TextEdit edit, MultiTextEdit result) {
  if (!edit.hasChildren()) {
    result.addChild(edit);
  } else {
    TextEdit[] children= edit.getChildren();
    for (int i= 0; i < children.length; i++) {
      TextEdit child= children[i];
      child.getParent().removeChild(0);
      flatten(child, result);
    }
  }
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

private static void flatten(TextEdit edit, MultiTextEdit result) {
  if (!edit.hasChildren()) {
    result.addChild(edit);
  } else {
    TextEdit[] children= edit.getChildren();
    for (int i= 0; i < children.length; i++) {
      TextEdit child= children[i];
      child.getParent().removeChild(0);
      flatten(child, result);
    }
  }
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

formatEdit.addChild(edit);
if (!TextEditUtil.isPacked(formatEdit)) {
  formatEdit= TextEditUtil.flatten(formatEdit);
origin: org.eclipse.jdt/org.eclipse.jdt.ui

formatEdit.addChild(edit);
if (!TextEditUtil.isPacked(formatEdit)) {
  formatEdit= TextEditUtil.flatten(formatEdit);
org.eclipse.jdt.internal.corext.refactoring.utilTextEditUtilflatten

Javadoc

Degenerates the given edit tree into a list.
All nodes of the result are leafs.
The given edit is modified and can no longer be used.

Popular methods of TextEditUtil

  • isPacked
    Returns true if the given edit is minimal. That is if: * true if edit is a leaf * if edit is a inne
  • merge
  • 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

  • Reading from database using SQL prepared statement
  • getSupportFragmentManager (FragmentActivity)
  • putExtra (Intent)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • Top plugins for Android Studio
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