Codota Logo
TextEditUtil.flatten
Code IndexAdd Codota 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)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Dictionary d =
  • Codota Iconnew Hashtable()
  • Codota IconBundle bundle;bundle.getHeaders()
  • Codota Iconnew Properties()
  • Smart code suggestions by Codota
}
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

  • Making http post requests using okhttp
  • compareTo (BigDecimal)
  • onRequestPermissionsResult (Fragment)
  • getContentResolver (Context)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • Point (java.awt)
    A point representing a location in (x, y) coordinate space, specified in integer precision.
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate(i
  • Permission (java.security)
    Abstract class for representing access to a system resource. All permissions have a name (whose inte
  • DecimalFormat (java.text)
    DecimalFormat is a concrete subclass ofNumberFormat that formats decimal numbers. It has a variety o
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now