Package org.eclipse.swt.custom

Examples of org.eclipse.swt.custom.StyleRange


        if (searchText != null && searchText.length() > 0) {
            int intRangesCorrectSize[] =
                SearchResultStyle.getSearchTermOccurrences(searchText, columnText);
            List<StyleRange> styleRange = new ArrayList<StyleRange>();
            for (int i = 0; i < intRangesCorrectSize.length / 2; i++) {
                StyleRange myStyleRange = new StyleRange(0, 0, null, searchColor);
                myStyleRange.start = intRangesCorrectSize[i];
                myStyleRange.length = intRangesCorrectSize[++i];
                styleRange.add(myStyleRange);
            }
            cell.setStyleRanges(styleRange.toArray(new StyleRange[styleRange
View Full Code Here


    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

            String content)
    {
        List<StyleRange> styleRange;
        List<Integer> ranges;
        Display disp = Display.getCurrent();
        StyleRange myStyleRange =
            new StyleRange(0, 0, null, disp.getSystemColor(SWT.COLOR_YELLOW));

        // reset the StyleRange-Array for each new field
        styleRange = new ArrayList<StyleRange>();
        ranges = new ArrayList<Integer>(); // reset the ranges-array
        if (searchTerm.equals("")) {
View Full Code Here

    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

      int endNew = chunkNumbers.get(i + 2).intValue();
      int startNew = startOld - posOld + posNew;

      if (startOld == endOld) {
        // Add
        newPresentation.addStyleRange(new StyleRange(startNew, endNew - startNew,
            null, colors.get(ColorName.ADDED_BACKGROUND)));
      } else if (startNew == endNew) {
        // Remove
        oldPresentation.addStyleRange(new StyleRange(startOld, endOld - startOld,
            null, colors.get(ColorName.ADDED_BACKGROUND)));
      } else {
        // Replace
        newPresentation.addStyleRange(new StyleRange(startNew, endNew - startNew,
            null, colors.get(ColorName.CHANGED_BACKGROUND)));
        oldPresentation.addStyleRange(new StyleRange(startOld, endOld - startOld,
            null, colors.get(ColorName.CHANGED_BACKGROUND)));
      }

      posOld = endOld;
      posNew = endNew;
View Full Code Here

            HaxeTree node = info.getNode();
            int offset = node.getMostLeftPosition();
            int end = node.getMostRightPosition();

            Display display = Display.getDefault();
            StyleRange styleRange = new StyleRange(           
                    offset, end - offset + 1,
                    display.getSystemColor(SWT.COLOR_WHITE),
                    display.getSystemColor(SWT.COLOR_BLUE),
                    SWT.NORMAL);
View Full Code Here

            .getLineInformationOfOffset(offset);
        String string = console.getDocument().get(
            lineInformation.getOffset(),
            lineInformation.getLength());
        if (string.trim().startsWith("at")) {
          return new StyleRange[] { new StyleRange(offset, length,
              Display.getDefault().getSystemColor(SWT.COLOR_RED),
              null) };
        }
      } catch (BadLocationException e) {
        Activator.log(e);
View Full Code Here

    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

        quickStartText.setForeground(this.getForeground());
        quickStartText.setBackground(this.getBackground());
        quickStartText
            .setText("For a quick start we recommend to use Saros's Jabber server: "
                + preferenceUtils.getSarosXMPPServer());
        StyleRange styleRange = new StyleRange();
        styleRange.start = quickStartText.getText().length()
            - preferenceUtils.getSarosXMPPServer().length();
        styleRange.length = preferenceUtils.getSarosXMPPServer().length();
        styleRange.fontStyle = SWT.BOLD;
        quickStartText.setStyleRange(styleRange);
View Full Code Here

    GC gc = event.gc;
    if (fColor != null && !fColor.isDisposed())
      gc.setForeground(fColor);
    else if (fColor == null && !(offset < 0 && offset >= text.getCharCount())) {
      StyleRange style = text.getStyleRangeAtOffset(offset);
      if (style != null)
        gc.setForeground(style.foreground);
    }
    gc.drawLine(x1, y, x2, y);
  }
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.