Package at.bestsolution.efxclipse.styledtext

Examples of at.bestsolution.efxclipse.styledtext.StyleRange


    if (window != null) {
      int end= window.getOffset() + window.getLength();
      int i= -1, j= fRanges.size();
      while (j - i > 1) {
        int k= (i + j) >> 1;
        StyleRange r= (StyleRange) fRanges.get(k);
        if (r.start < end)
          i= k;
        else
          j= k;
      }
View Full Code Here


    int rangeEnd= range.start + range.length;
    int windowEnd= window.getOffset() + window.getLength();
    int end= (rangeEnd > windowEnd ? windowEnd : rangeEnd);
    end -= window.getOffset();

    StyleRange newRange= (StyleRange) range.clone();
    newRange.start= start;
    newRange.length= end - start;
    return newRange;
  }
View Full Code Here

   * @return the style range with the smallest offset different from the default style range
   */
  public StyleRange getFirstStyleRange() {
    try {

      StyleRange range= (StyleRange) fRanges.get(getFirstIndexInWindow(fResultWindow));
      return createWindowRelativeRange(fResultWindow, range);

    } catch (NoSuchElementException x) {
    } catch (IndexOutOfBoundsException x) {
    }
View Full Code Here

   * @return the style range with the highest offset different from the default style range
   */
  public StyleRange getLastStyleRange() {
    try {

      StyleRange range=  (StyleRange) fRanges.get(getFirstIndexAfterWindow(fResultWindow) - 1);
      return createWindowRelativeRange(fResultWindow, range);

    } catch (NoSuchElementException x) {
      return null;
    } catch (IndexOutOfBoundsException x) {
View Full Code Here

   * @return the coverage of this presentation
   */
  public IRegion getCoverage() {

    if (fDefaultRange != null) {
      StyleRange range= getDefaultStyleRange();
      return new Region(range.start, range.length);
    }

    StyleRange first= getFirstStyleRange();
    StyleRange last= getLastStyleRange();

    if (first == null || last == null)
      return null;

    return new Region(first.start, last.start - first. start + last.length);
View Full Code Here

    /*
     * @see Iterator#next()
     */
    public StyleRange next() {
      try {
        StyleRange r= (StyleRange) fRanges.get(fIndex++);
        return createWindowRelativeRange(fWindow, r);
      } catch (ArrayIndexOutOfBoundsException x) {
        throw new NoSuchElementException();
      } finally {
        if (fSkipDefaults)
View Full Code Here

     *
     * @param o the object to be checked
     * @return <code>true</code> if the object should be skipped by the iterator
     */
    protected boolean skip(Object o) {
      StyleRange r= (StyleRange) o;
      return r.similarTo(fDefaultRange);
    }
View Full Code Here

    }
    return -(low + 1); // key not found.
  }

  private StyleRange createStyleRange(int start, int end, Styler style) {
    StyleRange styleRange = new StyleRange();
    styleRange.start = start;
    styleRange.length = end - start;
    style.applyStyles(styleRange);
    return styleRange;
  }
View Full Code Here

TOP

Related Classes of at.bestsolution.efxclipse.styledtext.StyleRange

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.