Package org.eclipse.jface.text

Examples of org.eclipse.jface.text.BadLocationException


      throw new BadLocationException();
  }

  private final void checkImageOffset(int imageOffset) throws BadLocationException {
    if (imageOffset < 0 || imageOffset > getImageLength())
      throw new BadLocationException();
  }
View Full Code Here


    if (fPositions.size() > 0) {
      LinkedPosition groupPosition= (LinkedPosition) fPositions.get(0);
      String groupContent= groupPosition.getContent();
      String positionContent= position.getContent();
      if (!groupContent.equals(positionContent))
        throw new BadLocationException(
            "First position: '" + groupContent + "' at " + groupPosition.getOffset() + //$NON-NLS-1$ //$NON-NLS-2$
            ", this position: '" + positionContent + "' at " + position.getOffset()); //$NON-NLS-1$ //$NON-NLS-2$
    }
  }
View Full Code Here

   */
  private void enforceDisjoint(LinkedPosition position) throws BadLocationException {
    for (Iterator it= fPositions.iterator(); it.hasNext(); ) {
      LinkedPosition p= (LinkedPosition) it.next();
      if (p.overlapsWith(position))
        throw new BadLocationException();
    }
  }
View Full Code Here

        LinkedPosition myPos= (LinkedPosition) it2.next();
        if (myPos.includes(pos)) {
          if (found == null)
            found= myPos;
          else if (found != myPos)
            throw new BadLocationException();
          if (localFound == null)
            localFound= myPos;
        }
      }

      if (localFound != found)
        throw new BadLocationException();
    }
    return found;
  }
View Full Code Here

  /*
   * @see org.eclipse.jface.text.source.ILineDiffer#revertLine(int)
   */
  public synchronized void revertLine(int line) throws BadLocationException {
    if (!isInitialized())
      throw new BadLocationException(QuickDiffMessages.quickdiff_nonsynchronized);

    DiffRegion region= (DiffRegion) getLineInfo(line);
    if (region == null || fRightDocument == null || fLeftDocument == null)
      return;

View Full Code Here

  /*
   * @see org.eclipse.jface.text.source.ILineDiffer#revertBlock(int)
   */
  public synchronized void revertBlock(int line) throws BadLocationException {
    if (!isInitialized())
      throw new BadLocationException(QuickDiffMessages.quickdiff_nonsynchronized);

    DiffRegion region= (DiffRegion) getLineInfo(line);
    if (region == null || fRightDocument == null || fLeftDocument == null)
      return;

View Full Code Here

  /*
   * @see org.eclipse.jface.text.source.ILineDiffer#revertSelection(int, int)
   */
  public synchronized void revertSelection(int line, int nLines) throws BadLocationException {
    if (!isInitialized())
      throw new BadLocationException(QuickDiffMessages.quickdiff_nonsynchronized);

    if (fRightDocument == null || fLeftDocument == null)
      return;

    int rOffset= -1, rLength= -1, lOffset= -1, lLength= -1;
View Full Code Here

  /*
   * @see org.eclipse.jface.text.source.ILineDiffer#restoreAfterLine(int)
   */
  public synchronized int restoreAfterLine(int line) throws BadLocationException {
    if (!isInitialized())
      throw new BadLocationException(QuickDiffMessages.quickdiff_nonsynchronized);

    DiffRegion region= (DiffRegion) getLineInfo(line);
    if (region == null || fRightDocument == null || fLeftDocument == null)
      return 0;

View Full Code Here

   */
  protected synchronized final void checkBadLocation(int offset)
      throws BadLocationException {
    ITextRegion lastRegion = getLastToken();
    if (offset < 0 || lastRegion.getEnd() < offset) {
      throw new BadLocationException(
          "offset " + offset + " is out of [0, " + lastRegion.getEnd() + "]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    }
  }
View Full Code Here

    protected final void checkBadLocation(int offset)
            throws BadLocationException
    {
        ITextRegion lastRegion = getLastToken();
        if (offset < 0 || lastRegion.getEnd() < offset) {
            throw new BadLocationException(
                    "offset " + offset + " is out of [0, " + lastRegion.getEnd() + "]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
        }
    }
View Full Code Here

TOP

Related Classes of org.eclipse.jface.text.BadLocationException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.