Examples of StyleRange


Examples of org.eclipse.swt.custom.StyleRange

    int offset,
    int length,
    TextAttribute attr) {
    if (attr != null)
      presentation.addStyleRange(
        new StyleRange(
          offset,
          length,
          attr.getForeground(),
          attr.getBackground(),
          attr.getStyle()));
View Full Code Here

Examples of org.eclipse.swt.custom.StyleRange

    int offset,
    int length,
    TextAttribute attr) {
    if (attr != null)
      presentation.addStyleRange(
        new StyleRange(
          offset,
          length,
          attr.getForeground(),
          attr.getBackground(),
          attr.getStyle()));
View Full Code Here

Examples of org.eclipse.swt.custom.StyleRange

                color = Colors.red;
              }

              if ( color != Colors.black ){
               
                StyleRange styleRange = new StyleRange();
                styleRange.start = start;
                styleRange.length = str.length();
                styleRange.foreground = color;
                log.setStyleRange(styleRange);
              }
View Full Code Here

Examples of org.eclipse.swt.custom.StyleRange

     
      log.append( me  );
     
      if ( colour != Colors.black ){
       
        StyleRange styleRange = new StyleRange();
        styleRange.start = start;
        styleRange.length = me.length();
        styleRange.foreground = colour;
        log.setStyleRange(styleRange);
      }
     
      log.append( "\n" );
     
    }else{
      String says = lu.getLocalisedMessageText( "azbuddy.chat.says", new String[]{ buddy_name }) + "\n";
     
      log.append( says );
     
      if ( colour != Colors.black ){
       
        StyleRange styleRange = new StyleRange();
        styleRange.start = start;
        styleRange.length = says.length();
        styleRange.foreground = colour;
        log.setStyleRange(styleRange);
      }
View Full Code Here

Examples of org.eclipse.swt.custom.StyleRange

              }else{
               
                color = Colors.red;
              }
             
              StyleRange styleRange = new StyleRange();
              styleRange.start = start;
              styleRange.length = str.length();
              styleRange.foreground = color;
              log.setStyleRange(styleRange);
             
View Full Code Here

Examples of org.eclipse.swt.custom.StyleRange

            //          System.out.println("Got Linecount " + lineCount + ", Charcount " + charCount);

            int lineOfs = helpPanel.getOffsetAtLine(lineCount - 1);
            int lineLen = charCount - lineOfs;
            //          System.out.println("Setting Style : " + lineOfs + ", " + lineLen);
            helpPanel.setStyleRange(new StyleRange(lineOfs, lineLen, fg, bg,
                style));
            helpPanel.setLineBackground(lineCount - 1, 1, bg);
          }
        }
View Full Code Here

Examples of org.eclipse.swt.custom.StyleRange

              }else{
               
                color = Colors.red;
              }
             
              StyleRange styleRange = new StyleRange();
              styleRange.start = start;
              styleRange.length = str.length();
              styleRange.foreground = color;
              log.setStyleRange(styleRange);
             
View Full Code Here

Examples of org.eclipse.swt.custom.StyleRange

            + TimeFormatter
                .twoDigits(calendar.get(Calendar.SECOND));
        date = "[" + date + "]";
        log_content.append(date);
               
        StyleRange date_style = new StyleRange();
        date_style.start = date_begin;
        date_style.length = date.length();
        date_style.foreground = date_foreground;
        log_content.setStyleRange(date_style);
       
        log_content.append("  ");
        int style_begin = log_content.getText().length();
        log_content.append(text);
        log_content.append(System.getProperty("line.separator"));
   
        StyleRange style = new StyleRange();
        style.start = style_begin;
        style.length = text.length();
        style.foreground = foreground;
        log_content.setStyleRange(style);
       
View Full Code Here

Examples of org.eclipse.swt.custom.StyleRange

    /* Old Version */
    if (StringUtils.isSet(oldVer)) {
      int offset = fUpdateInfoTextLeft.getText().length();
      fUpdateInfoTextLeft.append(Messages.UpdateDialog_CURRENT_VERSION);
      fUpdateInfoTextLeft.setStyleRange(new StyleRange(offset, fUpdateInfoTextLeft.getText().length() - offset, null, null, SWT.BOLD));
      fUpdateInfoTextRight.append(oldVer);
      fUpdateInfoTextLeft.append("\n"); //$NON-NLS-1$
      fUpdateInfoTextRight.append("\n"); //$NON-NLS-1$
    }

    /* New Version */
    if (StringUtils.isSet(newVer)) {
      int offset = fUpdateInfoTextLeft.getText().length();
      fUpdateInfoTextLeft.append(Messages.UpdateDialog_NEW_VERSION);
      fUpdateInfoTextLeft.setStyleRange(new StyleRange(offset, fUpdateInfoTextLeft.getText().length() - offset, null, null, SWT.BOLD));
      fUpdateInfoTextRight.append(newVer);
      fUpdateInfoTextLeft.append("\n"); //$NON-NLS-1$
      fUpdateInfoTextRight.append("\n"); //$NON-NLS-1$
    }

    /* Provider */
    if (StringUtils.isSet(provider)) {
      int offset = fUpdateInfoTextLeft.getText().length();
      fUpdateInfoTextLeft.append(Messages.UpdateDialog_UPDATE_PROVIDER);
      fUpdateInfoTextLeft.setStyleRange(new StyleRange(offset, fUpdateInfoTextLeft.getText().length() - offset, null, null, SWT.BOLD));
      fUpdateInfoTextRight.append(provider);
      fUpdateInfoTextLeft.append("\n"); //$NON-NLS-1$
      fUpdateInfoTextRight.append("\n"); //$NON-NLS-1$
    }

    /* Size */
    if (dlSize > 0) {
      int offset = fUpdateInfoTextLeft.getText().length();
      fUpdateInfoTextLeft.append(Messages.UpdateDialog_DL_SIZE);
      fUpdateInfoTextLeft.setStyleRange(new StyleRange(offset, fUpdateInfoTextLeft.getText().length() - offset, null, null, SWT.BOLD));
      fUpdateInfoTextRight.append(OwlUI.getSize((int) dlSize));
      fUpdateInfoTextLeft.append("\n"); //$NON-NLS-1$
      fUpdateInfoTextRight.append("\n"); //$NON-NLS-1$
    }

    /* Description */
    if (StringUtils.isSet(description)) {
      int offset = fUpdateInfoTextBottom.getText().length();
      fUpdateInfoTextBottom.append(Messages.UpdateDialog_DESCRIPTION);
      fUpdateInfoTextBottom.append("\n"); //$NON-NLS-1$
      fUpdateInfoTextBottom.setStyleRange(new StyleRange(offset, fUpdateInfoTextBottom.getText().length() - offset, null, null, SWT.BOLD));
      fUpdateInfoTextBottom.append(description);
    }
  }
View Full Code Here

Examples of org.eclipse.swt.custom.StyleRange

        }

        /* Bold End */
        else if (character == BOLD && inBold) {
          inBold = false;
          ranges.add(new StyleRange(boldStartIndex, index - boldStartIndex, null, null, SWT.BOLD));
        }

        /* Blue Start */
        else if (character == BLUE && !inBlue) {
          inBlue = true;
          blueStartIndex = index;
        }

        /* Blue End */
        else if (character == BLUE && inBlue) {
          inBlue = false;
          StyleRange range = new StyleRange();
          range.foreground = widget.getDisplay().getSystemColor(SWT.COLOR_DARK_BLUE);
          range.start = blueStartIndex;
          range.length = index - blueStartIndex;

          ranges.add(range);
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.