Examples of SimpleAttributeSet


Examples of javax.swing.text.SimpleAttributeSet

    protected SimpleAttributeSet keywordAttr;

    public ATESyntaxEngine() {
        lexer = createLexer();
        parser = createParser();
        stringAttr = new SimpleAttributeSet();
        keywordAttr = new SimpleAttributeSet();
        commentAttr = new SimpleAttributeSet();
    }
View Full Code Here

Examples of javax.swing.text.SimpleAttributeSet

  }

  private AttributeSet setStyle (
      String fontFamilyName, int  size, Color color)
  {
    MutableAttributeSet attr = new SimpleAttributeSet();
    if (color!=null)
      StyleConstants.setForeground(attr, color);
    if (fontFamilyName!=null)
      StyleConstants.setFontFamily(attr, fontFamilyName);
    if (size!=-1)
View Full Code Here

Examples of javax.swing.text.SimpleAttributeSet

      boolean bold,
      boolean italic,
      boolean underline
  )
  {
    MutableAttributeSet attr = new SimpleAttributeSet();
    if (color!=null)
      StyleConstants.setForeground(attr, color);
    if (fontFamilyName!=null)
      StyleConstants.setFontFamily(attr, fontFamilyName);
    if (size!=-1)
View Full Code Here

Examples of javax.swing.text.SimpleAttributeSet

        processOutput(response + "\n\n", null);
        processBoldOutput(command + "\n");
    }

    private void processBoldOutput(String text) throws BadLocationException {
        SimpleAttributeSet attribs = new SimpleAttributeSet();
        StyleConstants.setBold(attribs, true);
        processOutput(text, attribs);
    }
View Full Code Here

Examples of javax.swing.text.SimpleAttributeSet

    /**
     * (Re-)initialize the AttributeSet.
     */
    private void reset()
    {
        this.attributeSet = new SimpleAttributeSet();
    }
View Full Code Here

Examples of javax.swing.text.SimpleAttributeSet

        assertNull( "Empty attribute ID should return null AttributeSet!", config.getAttributeSet( "" ) );

        assertNull( "Non existent attribute ID should return null AttributeSet!",
                    config.getAttributeSet( "a.dummy.attribute" ) );

        MutableAttributeSet expected = new SimpleAttributeSet();
        expected.addAttribute( "font-style", "italic" );
        MutableAttributeSet actual = config.getAttributeSet( "italic" );

        assertTrue( "Wrong AttributeSet returned for italic!", expected.isEqual( actual ) );
    }
View Full Code Here

Examples of javax.swing.text.SimpleAttributeSet

    /** {@inheritDoc} */
    protected String getTableBlock( String cell, String caption )
    {
        // Using the same set ordering than the JVM
        MutableAttributeSet att = new SimpleAttributeSet();
        att.addAttribute( "frame", "none" );
        att.addAttribute( "rowsep", "0" );
        att.addAttribute( "colsep", "0" );

        return "<table" + SinkUtils.getAttributeString( att ) + "><title>" + caption
            + "</title>" + "<tgroup cols=\"1\"><colspec align=\"center\" />" + "<tbody><row><entry>"
            + cell  + "</entry>" + "</row>" + "</tbody></tgroup>" + "</table>";
    }
View Full Code Here

Examples of javax.swing.text.SimpleAttributeSet

    public void testReplaceSelectionWithAttributes() {
        if (true) {
            throw new UnsupportedOperationException("Not implemented");
        }
        AbstractDocument doc = new DefaultStyledDocument();
        SimpleAttributeSet as1 = new SimpleAttributeSet();
        as1.addAttribute("key1", "value1");
        SimpleAttributeSet as2 = new SimpleAttributeSet();
        as2.addAttribute("key2", "value2");
        try {
            doc.insertString(0, "testReplaceSelection", as1);
            doc.insertString(4, "INSERT", as2);
        } catch (final BadLocationException e) {
            assertFalse("unexpected exception :" + e.getMessage(), true);
View Full Code Here

Examples of javax.swing.text.SimpleAttributeSet

    @Override
    protected void setUp() throws Exception {
        super.setUp();
        textPane = new JTextPane();
        // init character attributeSet
        attrs = new SimpleAttributeSet();
        StyleConstants.setStrikeThrough(attrs, true);
        StyleConstants.setAlignment(attrs, StyleConstants.ALIGN_CENTER);
        StyleConstants.setUnderline(attrs, true);
        textPane.getDocument().insertString(0, "Hello  !", attrs);
        StyleConstants.setUnderline(attrs, false);
View Full Code Here

Examples of javax.swing.text.SimpleAttributeSet

        textPane.setLogicalStyle(style);
        style = textPane.getLogicalStyle();
        textPane.setCaretPosition(3);
        assertSame(style, textPane.getLogicalStyle());
        assertTrue(((Boolean) style.getAttribute(StyleConstants.Bold)).booleanValue());
        attrs = new SimpleAttributeSet();
        StyleConstants.setBold(attrs, true);
        textPane.setParagraphAttributes(attrs, true);
        assertNull(textPane.getLogicalStyle());
    }
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.