Package javax.swing.text

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


            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, "&#", "&#" );
            att.addAttribute( Attribute.CONTENT, text );

            writeSimpleTag( META, att );

            resetTextBuffer();
        }
View Full Code Here


    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

    {
        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

            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() );
View Full Code Here

        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() );
View Full Code Here

            impliedBlockOpen = true;
        }

        private MutableAttributeSet createMutableSet(final Object key, final Object value) {
            MutableAttributeSet specAttr = new SimpleAttributeSet();
            specAttr.addAttribute(key, value);
            return specAttr;
        }

        private boolean paragraphOpened() {
            return openedBlocks.contains(PARAGRAPH_TAG) || openedBlocks.contains(Tag.IMPLIED) && impliedBlockOpen;
View Full Code Here

                    }
                    model = selectModel;
                    openedBlocks.add(Tag.SELECT);
                }
                if (model != null) {
                    specAttr.addAttribute(StyleConstants.ModelAttribute, model);
                    assert currentForm != null : "creating model with getCurrentForm() in constructor assures this";
                    currentForm.addElement(model);
                }
            }
View Full Code Here

    private void processTarget(final Element target, final String src) {
        final MutableAttributeSet targetAttr = (MutableAttributeSet)target.getAttributes();
        writeLock();
        try {
            targetAttr.addAttribute(HTML.Attribute.SRC, src);
        } finally {
            writeUnlock();
        }
        fireChangedUpdate(new DefaultDocumentEvent(target.getStartOffset(), target.getEndOffset() - target.getStartOffset(), EventType.CHANGE));
    }
View Full Code Here

        assertNull(getModelAttribute(elem));

        // Wrong element type name
        createFormView(FormAttributes.INPUT_TYPE_SUBMIT);
        MutableAttributeSet attrs = new SimpleAttributeSet();
        attrs.addAttribute(HTML.Attribute.TYPE, "my_type");
        doc.setCharacterAttributes(22, 1, attrs, false);
        assertEquals("my_type",
                     elem.getAttributes().getAttribute(HTML.Attribute.TYPE));
        assertNull(formView.createComponent());
        assertNull(formView.getComponent());
View Full Code Here

                component.setMaximumSize(new Dimension(30, 30));
                return component;
            };
        };
        MutableAttributeSet attrs = new SimpleAttributeSet();
        attrs.addAttribute(HTML.Attribute.TYPE, "my_type");
        doc.setCharacterAttributes(22, 1, attrs, false);
        assertEquals("my_type",
                     elem.getAttributes().getAttribute(HTML.Attribute.TYPE));
        checkFormViewSpans(0, 0, 0, 0);
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.