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

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

Best Java code snippets using org.eclipse.jface.text.source.projection.IProjectionPosition.computeCaptionOffset (Showing top 6 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.scout.sdk.deps/org.eclipse.jface.text

private boolean isCaptionLine(Position position, IDocument document, int line) {
  if (position.getOffset() > -1 && position.getLength() > -1) {
    try {
      int captionOffset;
      if (position instanceof IProjectionPosition)
        captionOffset= ((IProjectionPosition) position).computeCaptionOffset(document);
      else
        captionOffset= 0;
      int startLine= document.getLineOfOffset(position.getOffset() + captionOffset);
      return line == startLine;
    } catch (BadLocationException x) {
    }
  }
  return false;
}
origin: org.eclipse.platform/org.eclipse.jface.text

private boolean isCaptionLine(Position position, IDocument document, int line) {
  if (position.getOffset() > -1 && position.getLength() > -1) {
    try {
      int captionOffset;
      if (position instanceof IProjectionPosition)
        captionOffset= ((IProjectionPosition) position).computeCaptionOffset(document);
      else
        captionOffset= 0;
      int startLine= document.getLineOfOffset(position.getOffset() + captionOffset);
      return line == startLine;
    } catch (BadLocationException x) {
    }
  }
  return false;
}
origin: org.eclipse.platform/org.eclipse.jface.text

/**
 * Computes the collapsed region anchor for the given position. Assuming
 * that the position is the position of an expanded projection annotation,
 * the anchor is the region that is still visible after the projection
 * annotation has been collapsed.
 *
 * @param position the position
 * @return the collapsed region anchor
 */
public Position computeCollapsedRegionAnchor(Position position) {
  try {
    IDocument document= getDocument();
    if (document == null)
      return null;
    int captionOffset= position.getOffset();
    if (position instanceof IProjectionPosition)
      captionOffset+= ((IProjectionPosition) position).computeCaptionOffset(document);
    IRegion lineInfo= document.getLineInformationOfOffset(captionOffset);
    return new Position(lineInfo.getOffset() + lineInfo.getLength(), 0);
  } catch (BadLocationException x) {
  }
  return null;
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text

/**
 * Computes the collapsed region anchor for the given position. Assuming
 * that the position is the position of an expanded projection annotation,
 * the anchor is the region that is still visible after the projection
 * annotation has been collapsed.
 *
 * @param position the position
 * @return the collapsed region anchor
 */
public Position computeCollapsedRegionAnchor(Position position) {
  try {
    IDocument document= getDocument();
    if (document == null)
      return null;
    int captionOffset= position.getOffset();
    if (position instanceof IProjectionPosition)
      captionOffset+= ((IProjectionPosition) position).computeCaptionOffset(document);
    IRegion lineInfo= document.getLineInformationOfOffset(captionOffset);
    return new Position(lineInfo.getOffset() + lineInfo.getLength(), 0);
  } catch (BadLocationException x) {
  }
  return null;
}
origin: org.eclipse.platform/org.eclipse.jface.text

int captionOffset;
if (position instanceof IProjectionPosition)
  captionOffset= ((IProjectionPosition) position).computeCaptionOffset(document);
else
  captionOffset= 0;
origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text

int captionOffset;
if (position instanceof IProjectionPosition)
  captionOffset= ((IProjectionPosition) position).computeCaptionOffset(document);
else
  captionOffset= 0;
org.eclipse.jface.text.source.projectionIProjectionPositioncomputeCaptionOffset

Javadoc

Returns the offset of the caption (the anchor region) of this projection position. The returned offset is relative to the receivers offset into the document.

Popular methods of IProjectionPosition

  • computeProjectionRegions
    Returns an array of regions that should be collapsed when the annotation belonging to this position

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