Codota Logo
IProjectionPosition.computeProjectionRegions
Code IndexAdd Codota to your IDE (free)

How to use
computeProjectionRegions
method
in
org.eclipse.jface.text.source.projection.IProjectionPosition

Best Java code snippets using org.eclipse.jface.text.source.projection.IProjectionPosition.computeProjectionRegions (Showing top 2 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
StringBuilder s =
  • Codota Iconnew StringBuilder()
  • Codota Iconnew StringBuilder(32)
  • Codota IconString str;new StringBuilder(str)
  • Smart code suggestions by Codota
}
origin: org.eclipse.platform/org.eclipse.jface.text

/**
 * Computes the regions that must be collapsed when the given position is
 * the position of an expanded projection annotation.
 *
 * @param position the position
 * @return the ranges that must be collapsed, or <code>null</code> if
 *         there are none
 * @since 3.1
 */
IRegion[] computeCollapsedRegions(Position position) {
  try {
    IDocument document= getDocument();
    if (document == null)
      return null;
    if (position instanceof IProjectionPosition) {
      IProjectionPosition projPosition= (IProjectionPosition) position;
      return projPosition.computeProjectionRegions(document);
    }
    int line= document.getLineOfOffset(position.getOffset());
    int offset= document.getLineOffset(line + 1);
    int length= position.getLength() - (offset - position.getOffset());
    if (length > 0)
      return new IRegion[] {new Region(offset, length)};
    return null;
  } catch (BadLocationException x) {
    return null;
  }
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text

/**
 * Computes the regions that must be collapsed when the given position is
 * the position of an expanded projection annotation.
 *
 * @param position the position
 * @return the ranges that must be collapsed, or <code>null</code> if
 *         there are none
 * @since 3.1
 */
IRegion[] computeCollapsedRegions(Position position) {
  try {
    IDocument document= getDocument();
    if (document == null)
      return null;
    if (position instanceof IProjectionPosition) {
      IProjectionPosition projPosition= (IProjectionPosition) position;
      return projPosition.computeProjectionRegions(document);
    }
    int line= document.getLineOfOffset(position.getOffset());
    int offset= document.getLineOffset(line + 1);
    int length= position.getLength() - (offset - position.getOffset());
    if (length > 0)
      return new IRegion[] {new Region(offset, length)};
    return null;
  } catch (BadLocationException x) {
    return null;
  }
}
org.eclipse.jface.text.source.projectionIProjectionPositioncomputeProjectionRegions

Javadoc

Returns an array of regions that should be collapsed when the annotation belonging to this position is collapsed. May return null instead of an empty array.

Popular methods of IProjectionPosition

  • computeCaptionOffset
    Returns the offset of the caption (the anchor region) of this projection position. The returned offs

Popular in Java

  • Finding current android device location
  • getSupportFragmentManager (FragmentActivity)
  • getExternalFilesDir (Context)
  • putExtra (Intent)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • LogFactory (org.apache.commons.logging)
    A minimal incarnation of Apache Commons Logging's LogFactory API, providing just the common Log look
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
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