Examples of BadLocationException


Examples of javax.swing.text.BadLocationException

            throws BadLocationException {
        if (pos < 0) {
            throw new RuntimeException(Messages.getString("swing.A2")); //$NON-NLS-1$
        }
        if (pos > doc.getLength()) {
            throw new BadLocationException(Messages.getString("swing.98"), pos); //$NON-NLS-1$
        }
        if (doc.getLength() != 0) {
            Element body = doc.getElement(doc.getDefaultRootElement(),
                                          StyleConstants.NameAttribute,
                                          HTML.Tag.BODY);
View Full Code Here

Examples of javax.swing.text.BadLocationException

  public void insertString(int offs, String str, AttributeSet a) throws BadLocationException {
    if (getLength() + str.length() <= maxLength) {
      super.insertString(offs, str, a);
    } else {
      throw new BadLocationException("Too long", offs);
    }
  }
View Full Code Here

Examples of javax.swing.text.BadLocationException

    public void insertHTML(final HTMLDocument doc, final int offset,
                           final String html, final int popDepth,
                           final int pushDepth, final HTML.Tag insertTag)
            throws BadLocationException, IOException {
        if (offset > doc.getLength()) {
            throw new BadLocationException(Messages.getString("swing.98"), offset); //$NON-NLS-1$
        }

        ParserCallback htmlReader = doc.getReader(offset, popDepth,
                                                  pushDepth, insertTag);
        StringReader in = new StringReader(html);
View Full Code Here

Examples of javax.swing.text.BadLocationException

            throws BadLocationException {
        if (pos < 0) {
            throw new RuntimeException(Messages.getString("swing.A2")); //$NON-NLS-1$
        }
        if (pos > doc.getLength()) {
            throw new BadLocationException(Messages.getString("swing.98"), pos); //$NON-NLS-1$
        }
        if (doc.getLength() != 0) {
            Element body = doc.getElement(doc.getDefaultRootElement(),
                                          StyleConstants.NameAttribute,
                                          HTML.Tag.BODY);
View Full Code Here

Examples of org.eclipse.jface.text.BadLocationException

    Node node = null;
    if ((0 <= offset) && (offset <= getDocument().getLength())) {
      node = (Node) fTextEditor.getModel().getIndexedRegion(offset);
    }
    else {
      throw new BadLocationException();
    }
    return node;
  }
View Full Code Here

Examples of org.eclipse.jface.text.BadLocationException

    Position[] positions= getPositions(fDocument);

    if (positions != null) {
      for (int i = 0; i < positions.length; i++)
        if (collides(positions[i], offset, length))
          throw new BadLocationException(LinkedPositionMessages.getString(("LinkedPositionManager.error.position.collision"))); //$NON-NLS-1$
    }
   
    String type= fDocument.get(offset, length);   

    if (containsLineDelimiters(type))
      throw new BadLocationException(LinkedPositionMessages.getString(("LinkedPositionManager.error.contains.line.delimiters"))); //$NON-NLS-1$

    try {
      fDocument.addPosition(LINKED_POSITION, new TypedPosition(offset, length, type));
    } catch (BadPositionCategoryException e) {
      //PHPeclipsePlugin.log(e);
View Full Code Here

Examples of org.eclipse.jface.text.BadLocationException

  /*
   * @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

Examples of org.eclipse.jface.text.BadLocationException

  /*
   * @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

Examples of org.eclipse.jface.text.BadLocationException

  /*
   * @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

Examples of org.eclipse.jface.text.BadLocationException

  /*
   * @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
TOP
Copyright © 2018 www.massapi.com. 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.