Examples of TextStyle


Examples of org.eclipse.xtext.ui.editor.utils.TextStyle

    textStyle.setColor(new RGB(0, 0, 0));
    return textStyle;
  }
 
  public TextStyle errorTextStyle() {
    TextStyle textStyle = defaultTextStyle().copy();
//    textStyle.setColor(new RGB(255, 0, 0));
    return textStyle;
  }
View Full Code Here

Examples of org.eclipse.xtext.ui.editor.utils.TextStyle

//    textStyle.setColor(new RGB(255, 0, 0));
    return textStyle;
  }
 
  public TextStyle numberTextStyle() {
    TextStyle textStyle = defaultTextStyle().copy();
    textStyle.setColor(new RGB(128, 0, 0));
    return textStyle;
  }
View Full Code Here

Examples of org.eclipse.xtext.ui.editor.utils.TextStyle

    textStyle.setColor(new RGB(128, 0, 0));
    return textStyle;
  }

  public TextStyle stringTextStyle() {
    TextStyle textStyle = defaultTextStyle().copy();
    textStyle.setColor(new RGB(42, 0, 255));
    return textStyle;
  }
View Full Code Here

Examples of org.eclipse.xtext.ui.editor.utils.TextStyle

    textStyle.setColor(new RGB(42, 0, 255));
    return textStyle;
  }

  public TextStyle commentTextStyle() {
    TextStyle textStyle = defaultTextStyle().copy();
    textStyle.setColor(new RGB(127, 127, 127));
    return textStyle;
  }
View Full Code Here

Examples of org.eclipse.xtext.ui.editor.utils.TextStyle

    textStyle.setColor(new RGB(127, 127, 127));
    return textStyle;
  }

  public TextStyle keywordTextStyle() {
    TextStyle textStyle = defaultTextStyle().copy();
    textStyle.setColor(new RGB(63, 127, 63));
    textStyle.setStyle(SWT.BOLD);
    return textStyle;
  }
View Full Code Here

Examples of org.eclipse.xtext.ui.editor.utils.TextStyle

    textStyle.setStyle(SWT.BOLD);
    return textStyle;
  }

  public TextStyle punctuationTextStyle() {
    TextStyle textStyle = defaultTextStyle().copy();
    return textStyle;
  }
View Full Code Here

Examples of org.jitterbit.ui.style.TextStyle

        c.setOpaque(false);
        return c;
    }

    private static TextStyle createTitleStyle() {
        TextStyle style = TextStyle.adjustSize(TextStyles.InfoText, 2);
        style = TextStyle.newStyle(style, Font.BOLD);
        return style;
    }
View Full Code Here

Examples of org.openoffice.xmerge.converter.xml.TextStyle

           
            do {
                ParagraphTextSegment pts = (ParagraphTextSegment)paraData.nextElement();
                Element span = doc.createElement(OfficeConstants.TAG_SPAN);
               
                TextStyle ts = pts.getStyle();
               
                if (ts != null) {
                    ts.setName(new String("TS" + textStyles++));
                    span.setAttribute(ATTRIBUTE_TEXT_STYLE_NAME, ts.getName());
                    styleCat.add(ts);
                }
                else {
                    span.setAttribute(ATTRIBUTE_TEXT_STYLE_NAME,
                                        PocketWordConstants.DEFAULT_STYLE);
View Full Code Here

Examples of org.openoffice.xmerge.converter.xml.TextStyle

           
            do {
                ParagraphTextSegment pts = (ParagraphTextSegment)paraData.nextElement();
                Element span = doc.createElement(OfficeConstants.TAG_SPAN);
               
                TextStyle ts = pts.getStyle();
               
                if (ts != null) {
                    ts.setName(new String("TS" + textStyles++));
                    span.setAttribute(ATTRIBUTE_TEXT_STYLE_NAME, ts.getName());
                    styleCat.add(ts);
                }
                else {
                    span.setAttribute(ATTRIBUTE_TEXT_STYLE_NAME,
                                        PocketWordConstants.DEFAULT_STYLE);
View Full Code Here

Examples of org.openoffice.xmerge.converter.xml.TextStyle

        int fontSize = 0;
        Color textColour = null;
        Color backColour = null;
        int modifiers = 0;
       
        TextStyle ts = null;
       
        int attrsSet = 0;   // If this is 0, we have no extra style
        boolean inSequence = false;
        boolean sawText = false;
           
        String s = new String()// For debugging
       
        // Start from the very beginning
        for (int i = 0; i < totalLength; i++) {           
            // Will encounter at least two codes first
            if ((byte)(data[i] & 0xF0) == FORMATTING_TAG) {  
                if (sawText) {
                    // Style change so dump previous segment and style info
                    addTextSegment(sb.toString(), ts);
                    sb = new StringBuffer("");
                    sawText = false;
                }
               
                switch (data[i]) {
                    case FONT_TAG:
                        int index = EndianConverter.readShort(
                                        new byte[] { data[i + 1], data[i + 2] } );
                       
                        /*
                         * Standard font.
                         *
                         * Should really be one, but as the only supported font
                         * currently is Courier New, want to leave it at Courier
                         * New for round trip conversions.
                         *
                         * Also need to account for the fact that Tahoma is the
                         * correct standard font.
                         */
                        if (fontName == null || fontName.equals("2")) {
                            if (index != 2 && index != 1) {
                                fontName = String.valueOf(index);
                                attrsSet++;
                            }
                        }
                        else {
                            // Font is set, but not the default
                            if (index == 2 || index == 1) {
                                fontName = "2";
                                attrsSet--;
                            }
                            else {
                                fontName = String.valueOf(index);
                            }
                        }
                        i += 2;
                        break;
                       
                       
                    case FONT_SIZE_TAG:
                        int size = EndianConverter.readShort(
                                        new byte[] { data[i + 1], data[i + 2] } );
                       
                        if (size == 0) {
                            // Flags the end of the last paragraph
                            isLastParagraph = true;
                            i += 2;
                            break;
                        }
                       
                        // Standard size
                        if (fontSize == 0 || fontSize == 10) {
                            if (size != 10) {
                                fontSize = size;
                                attrsSet++;
                            }
                        }
                        else {
                            // Font size is set, but not to standard
                            if (size == 10) {
                                fontSize = 10;
                                attrsSet--;
                            }
                            else {
                                fontSize = size;
                            }
                        }
                        i += 2;
                        break;
                       
                       
                    case COLOUR_TAG:
                        if (data[i + 1] != 0) {
              ColourConverter cc = new ColourConverter();
                            textColour = cc.convertToRGB(
                                EndianConverter.readShort(new byte[] { data[i + 1],
                                                                    data[i + 2] } ));                                      
                            attrsSet++;           
                        }
                        else {
                            textColour = null;
                            attrsSet--;
                        }
                        i += 2;
                        break;
                       
                       
                    case FONT_WEIGHT_TAG:
                        if (data[i + 1] == FONT_WEIGHT_BOLD
                                || data[i + 1] == FONT_WEIGHT_THICK) {
                            modifiers |= TextStyle.BOLD;
                            attrsSet++;
                        }
                        else {
                            // Its a bit field so subtracting should work okay.
                            modifiers ^= TextStyle.BOLD;
                            attrsSet--;
                        }
                        i += 2;
                        break;
                       
                       
                    case ITALIC_TAG:
                        if (data[i + 1] == (byte)0x01) {
                            modifiers |= TextStyle.ITALIC;
                            attrsSet++;
                        }
                        else {
                            modifiers ^= TextStyle.ITALIC;
                            attrsSet--;
                        }
                        i++;
                        break;
                       
                       
                    case UNDERLINE_TAG:
                        if (data[i + 1] == (byte)0x01) {
                            modifiers |= TextStyle.UNDERLINE;
                            attrsSet++;
                        }
                        else {
                            modifiers ^= TextStyle.UNDERLINE;
                            attrsSet--;
                        }
                        i++;
                        break;
                       
                       
                    case STRIKETHROUGH_TAG:
                        if (data[i + 1] == (byte)0x01) {
                            modifiers |= TextStyle.STRIKETHRU;
                            attrsSet++;
                        }
                        else {
                            modifiers ^= TextStyle.STRIKETHRU;
                            attrsSet--;
                        }
                        i++;
                        break;
                       
                    case HIGHLIGHT_TAG:
                        /*
                         * Highlighting is treated by OpenOffice as a
                         * background colour.
                         */
                        if (data[i + 1] == (byte)0x01) {
                            backColour =  Color.yellow;
                            attrsSet++;
                        }
                        else {
                            backColour = null;
                            attrsSet--;
                        }
                        i++;
                        break;
                }
               
                inSequence = true;
                continue;
            }
           
            if (inSequence) {                              
                // Style information has been changed.  Create new style here
                               
                inSequence = false;
                if (attrsSet > 0) {
                    ts = new TextStyle(null, TEXT_STYLE_FAMILY, DEFAULT_STYLE,
                                        mask, modifiers, fontSize, fontName, null);
                    ts.setColors(textColour, backColour);
                }
                else {
                    ts = null;
                }
            }
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.