下面列出了javax.swing.text.html.ParagraphView#javax.swing.text.html.InlineView 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
@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;
}
@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;
}