Package org.eclipse.swt.custom

Examples of org.eclipse.swt.custom.StyleRange


    if (minStart < maxEnd) {
      IStructuredDocument document = (IStructuredDocument) fSourceViewer.getDocument();
      if (document.containsReadOnly(minStart, maxEnd)) {
        Iterator nonDefaultStyleRangeIterator = textPresentation.getNonDefaultStyleRangeIterator();
        while (nonDefaultStyleRangeIterator.hasNext()) {
          StyleRange styleRange = (StyleRange) nonDefaultStyleRangeIterator.next();
          if (document.containsReadOnly(styleRange.start, styleRange.length)) {
            adjustForeground(styleRange);
          }
        }
      }
View Full Code Here


    if(textEnd < end)
      end = textEnd;
    // instead of end-start?
    if (end > maxOffset)
      end = maxOffset;
    StyleRange result = new StyleRange(start, end - start, attr.getForeground(), attr.getBackground(), attr.getStyle());
    if((attr.getStyle() & TextAttribute.STRIKETHROUGH) != 0) {
      result.strikeout = true;
    }
    if((attr.getStyle() & TextAttribute.UNDERLINE) != 0) {
      result.underline = true;
View Full Code Here

    boolean handled = false;
    final int partitionEndOffset = partitionStartOffset + partitionLength - 1;
    ITextRegion region = null;
    ITextRegionList regions = blockedRegion.getRegions();
    int nRegions = regions.size();
    StyleRange styleRange = null;
    for (int i = 0; i < nRegions; i++) {
      region = regions.get(i);
      TextAttribute attr = null;
      TextAttribute previousAttr = null;
      if (blockedRegion.getStartOffset(region) > partitionEndOffset)
View Full Code Here

    final int partitionEndOffset = partitionStartOffset + partitionLength - 1;
    while (structuredDocumentRegion != null && structuredDocumentRegion.getStartOffset() <= partitionEndOffset) {
      ITextRegion region = null;
      ITextRegionList regions = structuredDocumentRegion.getRegions();
      int nRegions = regions.size();
      StyleRange styleRange = null;
      for (int i = 0; i < nRegions; i++) {
        region = regions.get(i);
        TextAttribute attr = null;
        TextAttribute previousAttr = null;
        if (structuredDocumentRegion.getStartOffset(region) > partitionEndOffset)
View Full Code Here

    try {
      int validLength = Math.min(damage.getLength(), document.getLength() - damage.getOffset());
     
      if (fRepairers == null || fRepairers.isEmpty()) {
        TextPresentation presentation= new TextPresentation(damage, 1);
        presentation.setDefaultStyleRange(new StyleRange(damage.getOffset(), validLength, null, null));
        return presentation;
      }

      TextPresentation presentation= new TextPresentation(damage, 1000);
View Full Code Here

        if (namedStyle == null)
          continue;
        TextAttribute attribute = getAttribute(namedStyle);
        if (attribute == null)
          continue;
        StyleRange style = new StyleRange(node.getStartOffset(currentRegion), currentRegion.getLength(), attribute.getForeground(), attribute.getBackground(), attribute.getStyle());
        fText.setStyleRange(style);
      }
      node = node.getNext();
    }
  }
View Full Code Here

  protected void stopBold() {
    -- fBold;
    if (fBold == 0) {
      if (fTextPresentation != null) {
        fTextPresentation.addStyleRange(new StyleRange(fStartOffset, fCounter - fStartOffset, null, null, SWT.BOLD));
      }
      fStartOffset= -1;
    }
  }
View Full Code Here

    yoursEnd = Math.max(yoursStart, yoursEnd);

    Iterator e = presentation.getAllStyleRangeIterator();
    while (e.hasNext()) {

      StyleRange range = (StyleRange) e.next();

      int myStart = range.start;
      int myEnd = range.start + range.length - 1;
      myEnd = Math.max(myStart, myEnd);
View Full Code Here

        if (namedStyle == null)
          continue;
        TextAttribute attribute = getAttributeFor(namedStyle);
        if (attribute == null)
          continue;
        StyleRange style = new StyleRange(documentRegion.getStartOffset(currentRegion), currentRegion.getTextLength(), attribute.getForeground(), attribute.getBackground(), attribute.getStyle());
        style.strikeout = (attribute.getStyle() & TextAttribute.STRIKETHROUGH) != 0;
        style.underline = (attribute.getStyle() & TextAttribute.UNDERLINE) != 0;
        fText.setStyleRange(style);
      }
      documentRegion = documentRegion.getNext();
View Full Code Here

        len= getLength();

      TextAttribute textAttribute = fStyle.getTextAttribute();
      int style = textAttribute.getStyle();
      int fontStyle = style & (SWT.ITALIC | SWT.BOLD | SWT.NORMAL);
      StyleRange styleRange = new StyleRange(getOffset(), len, textAttribute.getForeground(), textAttribute.getBackground(), fontStyle);
      styleRange.strikeout = (style & TextAttribute.STRIKETHROUGH) != 0;
      styleRange.underline = (style & TextAttribute.UNDERLINE) != 0;

      return styleRange;
    }
View Full Code Here

TOP

Related Classes of org.eclipse.swt.custom.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.