Package javax.swing.text

Examples of javax.swing.text.Style.addAttribute()


      attr.addAttribute(
          ATTRIBUTE_TEXT,
          (template.getParameterCount() > 1) ?
              template.getParameterValue(1) : template.getParameterValue(0));
    } else {
      attr.addAttribute(ATTRIBUTE_PAGE_ELEMENT, template);
      attr.addAttribute(ATTRIBUTE_TEMPLATE_MATCHER, matcher);
    }
    doc.setCharacterAttributes(start, end - start, attr, true);
    if (start < secondStartPosition) {
      secondStartPosition = start;
View Full Code Here


          ATTRIBUTE_TEXT,
          (template.getParameterCount() > 1) ?
              template.getParameterValue(1) : template.getParameterValue(0));
    } else {
      attr.addAttribute(ATTRIBUTE_PAGE_ELEMENT, template);
      attr.addAttribute(ATTRIBUTE_TEMPLATE_MATCHER, matcher);
    }
    doc.setCharacterAttributes(start, end - start, attr, true);
    if (start < secondStartPosition) {
      secondStartPosition = start;
      secondEndPosition = end;
View Full Code Here

    // Format template
    int start = template.getBeginIndex();
    int end = template.getEndIndex();
    Style attr = doc.getStyle(ConfigurationValueStyle.TEMPLATE_DAB.getName());
    attr = (Style) attr.copyAttributes();
    attr.addAttribute(ATTRIBUTE_PAGE, link);
    attr.addAttribute(ATTRIBUTE_PAGE_ELEMENT, template);
    attr.addAttribute(ATTRIBUTE_TEMPLATE_MATCHER, matcher);
    attr.addAttribute(ATTRIBUTE_UUID, UUID.randomUUID());
    doc.setCharacterAttributes(start, end - start, attr, true);
    if (start < startPosition) {
View Full Code Here

    int start = template.getBeginIndex();
    int end = template.getEndIndex();
    Style attr = doc.getStyle(ConfigurationValueStyle.TEMPLATE_DAB.getName());
    attr = (Style) attr.copyAttributes();
    attr.addAttribute(ATTRIBUTE_PAGE, link);
    attr.addAttribute(ATTRIBUTE_PAGE_ELEMENT, template);
    attr.addAttribute(ATTRIBUTE_TEMPLATE_MATCHER, matcher);
    attr.addAttribute(ATTRIBUTE_UUID, UUID.randomUUID());
    doc.setCharacterAttributes(start, end - start, attr, true);
    if (start < startPosition) {
      startPosition = start;
View Full Code Here

    int end = template.getEndIndex();
    Style attr = doc.getStyle(ConfigurationValueStyle.TEMPLATE_DAB.getName());
    attr = (Style) attr.copyAttributes();
    attr.addAttribute(ATTRIBUTE_PAGE, link);
    attr.addAttribute(ATTRIBUTE_PAGE_ELEMENT, template);
    attr.addAttribute(ATTRIBUTE_TEMPLATE_MATCHER, matcher);
    attr.addAttribute(ATTRIBUTE_UUID, UUID.randomUUID());
    doc.setCharacterAttributes(start, end - start, attr, true);
    if (start < startPosition) {
      startPosition = start;
      endPosition = end;
View Full Code Here

    Style attr = doc.getStyle(ConfigurationValueStyle.TEMPLATE_DAB.getName());
    attr = (Style) attr.copyAttributes();
    attr.addAttribute(ATTRIBUTE_PAGE, link);
    attr.addAttribute(ATTRIBUTE_PAGE_ELEMENT, template);
    attr.addAttribute(ATTRIBUTE_TEMPLATE_MATCHER, matcher);
    attr.addAttribute(ATTRIBUTE_UUID, UUID.randomUUID());
    doc.setCharacterAttributes(start, end - start, attr, true);
    if (start < startPosition) {
      startPosition = start;
      endPosition = end;
    }
View Full Code Here

        // Foreground
        assertFalse(Color.BLUE.equals(style.getAttribute(StyleConstants.Foreground)));
        textPane.setForeground(Color.BLUE);
        assertEquals(Color.BLUE, style.getAttribute(StyleConstants.Foreground));
        // Document
        style.addAttribute(StyleConstants.Subscript, Boolean.TRUE);
        StyledDocument newDoc = new DefaultStyledDocument();
        Style newStyle = newDoc.getStyle(StyleContext.DEFAULT_STYLE);
        assertNull(newStyle.getAttribute(StyleConstants.FontSize));
        assertNull(newStyle.getAttribute(StyleConstants.FontFamily));
        newStyle.addAttribute(StyleConstants.FontFamily, "family2");
View Full Code Here

        style.addAttribute(StyleConstants.Subscript, Boolean.TRUE);
        StyledDocument newDoc = new DefaultStyledDocument();
        Style newStyle = newDoc.getStyle(StyleContext.DEFAULT_STYLE);
        assertNull(newStyle.getAttribute(StyleConstants.FontSize));
        assertNull(newStyle.getAttribute(StyleConstants.FontFamily));
        newStyle.addAttribute(StyleConstants.FontFamily, "family2");
        newStyle.addAttribute(StyleConstants.FontSize, new Integer(10));
        newStyle.addAttribute(StyleConstants.Italic, Boolean.FALSE);
        newStyle.addAttribute(StyleConstants.StrikeThrough, Boolean.TRUE);
        newStyle.addAttribute(StyleConstants.Subscript, Boolean.FALSE);
        newStyle.addAttribute(StyleConstants.Foreground, Color.RED);
View Full Code Here

        StyledDocument newDoc = new DefaultStyledDocument();
        Style newStyle = newDoc.getStyle(StyleContext.DEFAULT_STYLE);
        assertNull(newStyle.getAttribute(StyleConstants.FontSize));
        assertNull(newStyle.getAttribute(StyleConstants.FontFamily));
        newStyle.addAttribute(StyleConstants.FontFamily, "family2");
        newStyle.addAttribute(StyleConstants.FontSize, new Integer(10));
        newStyle.addAttribute(StyleConstants.Italic, Boolean.FALSE);
        newStyle.addAttribute(StyleConstants.StrikeThrough, Boolean.TRUE);
        newStyle.addAttribute(StyleConstants.Subscript, Boolean.FALSE);
        newStyle.addAttribute(StyleConstants.Foreground, Color.RED);
        textPane.setDocument(newDoc);
View Full Code Here

        Style newStyle = newDoc.getStyle(StyleContext.DEFAULT_STYLE);
        assertNull(newStyle.getAttribute(StyleConstants.FontSize));
        assertNull(newStyle.getAttribute(StyleConstants.FontFamily));
        newStyle.addAttribute(StyleConstants.FontFamily, "family2");
        newStyle.addAttribute(StyleConstants.FontSize, new Integer(10));
        newStyle.addAttribute(StyleConstants.Italic, Boolean.FALSE);
        newStyle.addAttribute(StyleConstants.StrikeThrough, Boolean.TRUE);
        newStyle.addAttribute(StyleConstants.Subscript, Boolean.FALSE);
        newStyle.addAttribute(StyleConstants.Foreground, Color.RED);
        textPane.setDocument(newDoc);
        assertNotSame(style, newStyle);
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.