Package org.eclipse.swt.custom

Examples of org.eclipse.swt.custom.StyleRange.clone()


        for (StyleRange highlightStyle : highlights) {
          int start = nonHighlightStyle.start;

          if ((start >= highlightStyle.start)
              && (start < (highlightStyle.start + highlightStyle.length))) {
            newStyle = (StyleRange) newStyle.clone();
            newStyle.background = HIGHLIGHTED_BACKGROUND_COLOR;
          }
        }

        nonHighlightStyles.add(newStyle);
View Full Code Here


     * @see org.xml.sax.helpers.DefaultHandler#startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)
     */
    @Override
    public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
      StyleRange range = styleStack.get(styleStack.size()-1);
      range = (StyleRange)range.clone();
      styleStack.add(range);
     
      String style = attributes.getValue("", "style");
      if(style != null) {
        String[] styles = style.split("\\s*;\\s*");
 
View Full Code Here

       
        offset += addToOffset;
               
        styleRanges.add(current);
       
        current = (StyleRange)current.clone();
       
        if(bold != oldBold) {
          if(bold) current.fontStyle |= SWT.BOLD;
          else current.fontStyle &= ~SWT.BOLD;
        }
View Full Code Here

   */
  public StyleRange getDefaultStyleRange() {
    StyleRange range= createWindowRelativeRange(fResultWindow, fDefaultRange);
    if (range == null)
      return null;
    return (StyleRange)range.clone();

  }

  /**
   * Add the given range to the presentation. The range must be a
View Full Code Here

    StyleRange[] ranges= getStyledRanges(item, index);
    if (ranges != null) {
      for (int i= 0; i < ranges.length; i++) {
        StyleRange curr= ranges[i];
        if (isSelected) {
          curr= (StyleRange) curr.clone();
          curr.foreground= null;
          curr.background= null;
        }
        fLayout.setStyle(curr, curr.start, curr.start + curr.length - 1);
      }
View Full Code Here

    StyleRange[] ranges= getStyledRanges(item, index);
    if (ranges != null) {
      for (int i= 0; i < ranges.length; i++) {
        StyleRange curr= ranges[i];
        if (isSelected) {
          curr= (StyleRange) curr.clone();
          curr.foreground= null;
          curr.background= null;
        }
        fLayout.setStyle(curr, curr.start, curr.start + curr.length - 1);
      }
View Full Code Here

      int caretOffset = text.getCaretOffset();
      style = null;
      if (caretOffset < text.getCharCount())
        style = text.getStyleRangeAtOffset(caretOffset);
      if (style != null) {
        style = (StyleRange) style.clone();
        style.start = event.start;
        style.length = event.length;
      } else
        style = new StyleRange(event.start, event.length, null, null, SWT.NORMAL);
      if (boldButton.getSelection())
View Full Code Here

      return;
    StyleRange style;
    for (int i = sel.x; i < sel.x + sel.y; i++) {
      StyleRange range = text.getStyleRangeAtOffset(i);
      if (range != null) {
        style = (StyleRange) range.clone();
        style.start = i;
        style.length = 1;
      } else
        style = new StyleRange(i, 1, null, null, SWT.NORMAL);
      if (widget == boldButton)
View Full Code Here

          return;
        StyleRange style;
        for (int i = sel.x; i < sel.x + sel.y; i++) {
          StyleRange range = styledText.getStyleRangeAtOffset(i);
          if (range != null) {
            style = (StyleRange) range.clone();
            style.start = i;
            style.length = 1;
          } else
            style = new StyleRange(i, 1, null, null, SWT.NORMAL);
          if (e.widget == boldButton)
View Full Code Here

          bg = display.getSystemColor(SWT.COLOR_YELLOW);
        StyleRange style;
        for (int i = sel.x; i < sel.x + sel.y; i++) {
          StyleRange range = styledText.getStyleRangeAtOffset(i);
          if (range != null) {
            style = (StyleRange) range.clone();
            style.start = i;
            style.length = 1;
            style.foreground = style.foreground != null ? null : fg;
            style.background = style.background != null ? null : bg;
          } else
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.