javax.swing.text.html.ParagraphView Java Examples

The following examples show how to use javax.swing.text.html.ParagraphView. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: WrapHTMLFactory.java    From SmartIM4IntelliJ with Apache License 2.0 6 votes vote down vote up
@Override public View create(Element elem) {
    View v = super.create(elem);
    if (v instanceof LabelView) {
        // the javax.swing.text.html.BRView (representing <br> tag) is a
        // LabelView but must not be handled
        // by a WrapLabelView. As BRView is private, check the html tag from
        // elem attribute
        Object o = elem.getAttributes().getAttribute(StyleConstants.NameAttribute);
        if ((o instanceof HTML.Tag) && o == HTML.Tag.BR) {
            return new BRView(elem);
        }
    }
    if (v instanceof InlineView) {
        return new WrapInlineView(elem);
    } else if (v instanceof ParagraphView) {
        return new WrapParagraphView(elem);
    }
    return v;
}
 
Example #2
Source File: WrapHTMLFactory.java    From SmartIM with Apache License 2.0 6 votes vote down vote up
@Override
public View create(Element elem) {
    View v = super.create(elem);
    if (v instanceof LabelView) {
        // the javax.swing.text.html.BRView (representing <br> tag) is a
        // LabelView but must not be handled
        // by a WrapLabelView. As BRView is private, check the html tag from
        // elem attribute
        Object o = elem.getAttributes().getAttribute(StyleConstants.NameAttribute);
        if ((o instanceof HTML.Tag) && o == HTML.Tag.BR) {
            return new BRView(elem);
        }
    }
    if (v instanceof InlineView) {
        return new WrapInlineView(elem);
    } else if (v instanceof ParagraphView) {
        return new WrapParagraphView(elem);
    }
    return v;
}
 
Example #3
Source File: SIPCommHTMLEditorKit.java    From jitsi with Apache License 2.0 6 votes vote down vote up
@Override
public View create(Element elem)
{
    View view = super.create(elem);

    viewCreated(this, view);

    if (view instanceof ParagraphView)
    {
        return new ParagraphViewX(elem);
    }
    else if (view instanceof ComponentView)
    {
        return new MyComponentView(elem);
    }

    return view;
}