Examples of StyleRange


Examples of org.eclipse.swt.custom.StyleRange

        + Options.getSchemaVersion() + "\n" +
        "SVN: \t" + getSVNVersion()   
    );
    dialog.setContent(message, SWT.CENTER);
    dialog.getStyledText().setEditable(false);
    StyleRange bold = new StyleRange();
    bold.start = 0;
    bold.length = message.lastIndexOf("\n");
   
    bold.fontStyle = SWT.BOLD;
    //dialog.getStyledText().setStyleRange(bold);
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

        new Color(display, new RGB(0, 128, 0)),   // Green
        new Color(display, new RGB(128, 128, 128))   // Gray
    };
   
    styles = new StyleRange[] {
      new StyleRange(0, 0, null, null, SWT.NORMAL),
      new StyleRange(0, 0, colors[COLOR_RED], null, SWT.NORMAL),
      new StyleRange(0, 0, colors[COLOR_ORANGE], null, SWT.NORMAL),
      new StyleRange(0, 0, colors[COLOR_BLUE], null, SWT.BOLD),
      new StyleRange(0, 0, colors[COLOR_GREEN], null, SWT.NORMAL),
      new StyleRange(0, 0, colors[COLOR_GREEN], null, SWT.NORMAL),
      new StyleRange(0, 0, colors[COLOR_GRAY], null, SWT.BOLD),
      new StyleRange(0, 0, colors[COLOR_GREENISH], null, SWT.ITALIC),
      new StyleRange(0, 0, colors[COLOR_GRAY], null, SWT.BOLD),
      new StyleRange(0, 0, colors[COLOR_GRAY], null, SWT.NORMAL)
    };

    // -- lexer for finding language parts --
    lexer = new RubyYaccLexer();
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

   * @param attr the attribute describing the style of the range to be styled
   */
  protected void addRange(TextPresentation presentation, 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

      for (int i = 0; i < matches.length; i++) {
        int color = 0;
        for (int j = 1; j <= re.getNumSubs(); j++) {

          StyleRange styleRange = new StyleRange();

          styleRange.start = matches[i].getStartIndex(j);
          styleRange.length = matches[i].getEndIndex(j)
              - matches[i].getStartIndex(j);
View Full Code Here

Examples of org.eclipse.swt.custom.StyleRange

    REMatch[] matches = debugInfo.getMatches(position - 1);

    debugPosition = position;

    StyleRange styleRangeRegExp = new StyleRange();

    Display display = panel.getDisplay();
    styleRangeRegExp.background = display.getSystemColor(SWT.COLOR_BLUE);
    styleRangeRegExp.foreground = display.getSystemColor(SWT.COLOR_WHITE);

    // Colour the regexp
    SubexpressionPos pos = debugInfo.getSubexpressionPosition(position - 1);
    //Reset style
    regExpText.setStyleRange(null);

    styleRangeRegExp.start = pos.getStart();
    styleRangeRegExp.length = pos.getEnd() - pos.getStart();

    regExpText.setStyleRange(styleRangeRegExp);

    //  Update text position
    regExpText.setTopIndex(styleRangeRegExp.start);
    regExpText.setCaretOffset(styleRangeRegExp.start);
    int offsetFromLine = styleRangeRegExp.start
        - regExpText.getOffsetAtLine(regExpText
            .getLineAtOffset(styleRangeRegExp.start));
    regExpText.setHorizontalIndex(offsetFromLine);
    regExpText.redraw();

    // Colour the matching text
    matchText.setStyleRange(null);

    if (position <= debugInfo.geMatchingBracketsCount()) {
      setResultLabelImage(RegExpImages.RESULT_GREEN);
      for (int i = 0; i < matches.length; i++) {

        StyleRange styleRangeMatch = new StyleRange();
        styleRangeMatch.background = display
            .getSystemColor(SWT.COLOR_BLUE);
        styleRangeMatch.foreground = display
            .getSystemColor(SWT.COLOR_WHITE);
View Full Code Here

Examples of org.eclipse.swt.custom.StyleRange

    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

Examples of org.eclipse.swt.custom.StyleRange

            }
            if (end == start) {
                break;
            }
            lastIndex = end;
            presentation.addStyleRange(new StyleRange(start, end - start, null, null,
                    SWT.BOLD));
        }

        // return the input (this one doesn't change the string)
        return str;
View Full Code Here

Examples of org.eclipse.swt.custom.StyleRange

        yoursEnd = Math.max(yoursStart, yoursEnd);

        final Iterator<StyleRange> e = presentation.getAllStyleRangeIterator();
        while (e.hasNext()) {

            final StyleRange range = e.next();

            final int myStart = range.start;
            int myEnd = range.start + range.length - 1;
            myEnd = Math.max(myStart, myEnd);
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.