Examples of MutableAttributeSet


Examples of javax.swing.text.MutableAttributeSet

        if ( headFlag )
        {
            return;
        }

        MutableAttributeSet att = new SinkEventAttributeSet();

        if ( DoxiaUtils.isExternalLink( href  ) )
        {
            att.addAttribute( Attribute.CLASS, "externalLink" );
        }

        att.addAttribute( Attribute.HREF, HtmlTools.escapeHTML( href  ) );

        if ( target != null )
        {
            att.addAttribute( Attribute.TARGET, target );
        }

        if ( attributes != null )
        {
            attributes.removeAttribute( Attribute.HREF.toString() );
            attributes.removeAttribute( Attribute.TARGET.toString() );
            att.addAttributes( attributes );
        }

        writeStartTag( HtmlMarkup.A, att );
    }
View Full Code Here

Examples of javax.swing.text.MutableAttributeSet

        {
            getTextBuffer().append( EOL );
        }
        else
        {
            MutableAttributeSet atts = SinkUtils.filterAttributes(
                attributes, SinkUtils.SINK_BR_ATTRIBUTES  );

            writeSimpleTag( HtmlMarkup.BR, atts );
        }
    }
View Full Code Here

Examples of javax.swing.text.MutableAttributeSet

    /** {@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.MutableAttributeSet

        setHeadFlag( true );

        write( "<!DOCTYPE html PUBLIC \"" + XHTML_TRANSITIONAL_PUBLIC_ID + "\" \"" + XHTML_TRANSITIONAL_SYSTEM_ID
            + "\">" );

        MutableAttributeSet atts = new SinkEventAttributeSet();
        atts.addAttribute( "xmlns", XHTML_NAMESPACE );

        if ( languageId != null )
        {
            atts.addAttribute( Attribute.LANG.toString(), languageId );
            atts.addAttribute( "xml:lang", languageId );
        }

        writeStartTag( HTML, atts );

        writeStartTag( HEAD );
View Full Code Here

Examples of javax.swing.text.MutableAttributeSet

     */
    public void author_()
    {
        if ( getTextBuffer().length() > 0 )
        {
            MutableAttributeSet att = new SinkEventAttributeSet();
            att.addAttribute( Attribute.NAME, "author" );
            String text = HtmlTools.escapeHTML( getTextBuffer().toString() );
            // hack: un-escape numerical entities that have been escaped above
            // note that numerical entities should really be added as one unicode character in the first place
            text = StringUtils.replace( text, "&amp;#", "&#" );
            att.addAttribute( Attribute.CONTENT, text );

            writeSimpleTag( META, att );

            resetTextBuffer();
        }
View Full Code Here

Examples of javax.swing.text.MutableAttributeSet

     */
    public void date_()
    {
        if ( getTextBuffer().length() > 0 )
        {
            MutableAttributeSet att = new SinkEventAttributeSet();
            att.addAttribute( Attribute.NAME, "date" );
            att.addAttribute( Attribute.CONTENT, getTextBuffer().toString() );

            writeSimpleTag( META, att );

            resetTextBuffer();
        }
View Full Code Here

Examples of javax.swing.text.MutableAttributeSet

    }

    /** {@inheritDoc} */
    public void verbatim( SinkEventAttributes attributes )
    {
        MutableAttributeSet atts = SinkUtils.filterAttributes( attributes, SinkUtils.SINK_VERBATIM_ATTRIBUTES );

        if ( atts == null )
        {
            atts = new SinkEventAttributeSet();
        }

        boolean boxed = false;

        if ( atts.isDefined( SinkEventAttributes.DECORATION ) )
        {
            boxed = "boxed".equals( atts.getAttribute( SinkEventAttributes.DECORATION ).toString() );
        }

        if ( boxed )
        {
            atts.addAttribute( Attribute.CLASS, "source" );
        }

        atts.removeAttribute( SinkEventAttributes.DECORATION );

        String width = (String) atts.getAttribute( Attribute.WIDTH.toString() );
        atts.removeAttribute( Attribute.WIDTH.toString() );

        writeStartTag( Tag.DIV, atts );
        writeEOL( true );

        if ( width != null )
        {
            atts.addAttribute( Attribute.WIDTH.toString(), width );
        }

        atts.removeAttribute( Attribute.ALIGN.toString() );
        atts.removeAttribute( Attribute.CLASS.toString() );

        writeStartTag( VERBATIM_TAG, atts );
    }
View Full Code Here

Examples of javax.swing.text.MutableAttributeSet

        assertTrue(StyleConstants.isSubscript(getCharacterAttributes(1)));
        assertFalse(StyleConstants.isSubscript(getCharacterAttributes(19)));
    }

    public void testGetInputAttributes() {
        MutableAttributeSet inpAttr = ((StyledEditorKit) textPane.getEditorKit())
                .getInputAttributes();
        assertSame(textPane.getInputAttributes(), inpAttr);
    }
View Full Code Here

Examples of javax.swing.text.MutableAttributeSet

        public void handleSimpleTag(final Tag tag,
                                    final MutableAttributeSet attr,
                                    final int pos) {
            final TagAction action = getAction(tag);
            MutableAttributeSet tagAttr = handleStyleAttribute(attr);
            if (action != emptyAction || !getPreservesUnknownTags()) {
                action.start(tag, tagAttr);
                action.end(tag);
            } else {
                addSpecialElement(tag, tagAttr);
View Full Code Here

Examples of javax.swing.text.MutableAttributeSet

            blockOpen(Tag.IMPLIED, new SimpleAttributeSet());
            impliedBlockOpen = true;
        }

        private MutableAttributeSet createMutableSet(final Object key, final Object value) {
            MutableAttributeSet specAttr = new SimpleAttributeSet();
            specAttr.addAttribute(key, value);
            return specAttr;
        }
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.