return new WrapLabelView(elem); } else if (kind.equals(AbstractDocument.ParagraphElementName)) { return new ParagraphView(elem); } else if (kind.equals(AbstractDocument.SectionElementName)) { return new BoxView(elem, View.Y_AXIS);
/** * @see javax.swing.text.ViewFactory#create(javax.swing.text.Element) */ public View create(Element elem) { String kind = elem.getName(); if (kind != null) { if (kind.equals(AbstractDocument.ContentElementName)) { return new TwoToneLabelView(elem); } else if (kind.equals(AbstractDocument.ParagraphElementName)) { return new ParagraphView(elem); } else if (kind.equals(AbstractDocument.SectionElementName)) { return new BoxView(elem, View.Y_AXIS); } else if (kind.equals(StyleConstants.ComponentElementName)) { return new ComponentView(elem); } else if (kind.equals(StyleConstants.IconElementName)) { return new IconView(elem); } // endif } // endif // default to text display return new TwoToneLabelView(elem); } }
@Override public View create(Element elem) { String kind = elem.getName(); if (kind != null) { if (kind.equals(AbstractDocument.ContentElementName)) { return new WrapLabelView(elem); } else if (kind.equals(AbstractDocument.ParagraphElementName)) { return new ParagraphView(elem); } else if (kind.equals(AbstractDocument.SectionElementName)) { return new BoxView(elem, View.Y_AXIS); } else if (kind.equals(StyleConstants.ComponentElementName)) { return new ComponentView(elem); } else if (kind.equals(StyleConstants.IconElementName)) { return new IconView(elem); } } return new LabelView(elem); } }
@Override public View create(Element elem) { String kind = elem.getName(); if (kind != null) { if (kind.equals(AbstractDocument.ContentElementName)) { return new WrapLabelView(elem); } else if (kind.equals(AbstractDocument.ParagraphElementName)) { return new ParagraphView(elem); } else if (kind.equals(AbstractDocument.SectionElementName)) { return new BoxView(elem, View.Y_AXIS); } else if (kind.equals(StyleConstants.ComponentElementName)) { return new ComponentView(elem); } else if (kind.equals(StyleConstants.IconElementName)) { return new IconView(elem); } } // default to text display return new LabelView(elem); } }
@Override public View create(Element elem) { String kind = elem.getName(); View view = null; if (kind == null) { // default to text display view = new LabelView(elem); } else if (kind.equals(AbstractDocument.ContentElementName)) { view = new LabelView(elem); } else if (kind.equals(AbstractDocument.ParagraphElementName)) { view = new ParagraphView(elem); } else if (kind.equals(AbstractDocument.SectionElementName)) { view = new BoxView(elem, View.Y_AXIS); } else if (kind.equals(StyleConstants.ComponentElementName)) { view = new ComponentView(elem); } else if (kind.equals(StyleConstants.IconElementName)) { view = new IconView(elem); } return view; } }
@Override public View create(Element elem) { String kind = elem.getName(); View view = null; if (kind == null) { // default to text display view = new LabelView(elem); } else if (kind.equals(AbstractDocument.ContentElementName)) { view = new LabelView(elem); } else if (kind.equals(AbstractDocument.ParagraphElementName)) { view = new ParagraphView(elem); } else if (kind.equals(AbstractDocument.SectionElementName)) { view = new BoxView(elem, View.Y_AXIS); } else if (kind.equals(StyleConstants.ComponentElementName)) { view = new ComponentView(elem); } else if (kind.equals(StyleConstants.IconElementName)) { view = new IconView(elem); } return view; } }
public View create(Element elem) { String kind = elem.getName(); View view = null; if (kind == null) { // default to text display view = new LabelView(elem); } else if (kind.equals(AbstractDocument.ContentElementName)) { view = new LabelView(elem); } else if (kind.equals(AbstractDocument.ParagraphElementName)) { view = new ParagraphView(elem); } else if (kind.equals(AbstractDocument.SectionElementName)) { view = new BoxView(elem, View.Y_AXIS); } else if (kind.equals(StyleConstants.ComponentElementName)) { view = new ComponentView(elem); } else if (kind.equals(StyleConstants.IconElementName)) { view = new IconView(elem); } return view; } }
@Override public View create(Element elem) { String kind = elem.getName(); View view = null; if (kind == null) { // default to text display view = new LabelView(elem); } else if (kind.equals(AbstractDocument.ContentElementName)) { view = new LabelView(elem); } else if (kind.equals(AbstractDocument.ParagraphElementName)) { view = new ParagraphView(elem); } else if (kind.equals(AbstractDocument.SectionElementName)) { view = new BoxView(elem, View.Y_AXIS); } else if (kind.equals(StyleConstants.ComponentElementName)) { view = new ComponentView(elem); } else if (kind.equals(StyleConstants.IconElementName)) { view = new IconView(elem); } return view; } }
@Override public View create(Element elem) { String kind = elem.getName(); View view = null; if (kind == null) { // default to text display view = new LabelView(elem); } else if (kind.equals(AbstractDocument.ContentElementName)) { view = new LabelView(elem); } else if (kind.equals(AbstractDocument.ParagraphElementName)) { view = new ParagraphView(elem); } else if (kind.equals(AbstractDocument.SectionElementName)) { view = new BoxView(elem, View.Y_AXIS); } else if (kind.equals(StyleConstants.ComponentElementName)) { view = new ComponentView(elem); } else if (kind.equals(StyleConstants.IconElementName)) { view = new IconView(elem); } return view; } }
/** * This works the same as original view factory, except the * use of a middle aligned icon view. * * {@inheritDoc} */ @Override public View create(final Element elem) { final String kind = elem.getName(); if (kind != null) { if (kind.equals(AbstractDocument.ContentElementName)) { return new LabelView(elem); } else if (kind.equals(AbstractDocument.ParagraphElementName)) { return new ParagraphView(elem); } else if (kind.equals(AbstractDocument.SectionElementName)) { return new BoxView(elem, View.Y_AXIS); } else if (kind.equals(StyleConstants.ComponentElementName)) { return new ComponentView(elem); } else if (kind.equals(StyleConstants.IconElementName)) { return new MiddleAlignedIconView(elem); // Overridden icon view } } // Default is text display return new LabelView(elem); } }
return new WrapLabelView(elem); case AbstractDocument.ParagraphElementName: return new ParagraphView(elem); case AbstractDocument.SectionElementName: return new BoxView(elem, View.Y_AXIS);
return new WrapLabelView(elem); case AbstractDocument.ParagraphElementName: return new ParagraphView(elem); case AbstractDocument.SectionElementName: return new BoxView(elem, View.Y_AXIS);
return new MyLabelView(elem); } else if (kind.equals(AbstractDocument.ParagraphElementName)) { return new ParagraphView(elem); } else if (kind.equals(AbstractDocument.SectionElementName)) { return new BoxView(elem, View.Y_AXIS);
result = new MyLabelView(elem); } else if(kind.equals(AbstractDocument.ParagraphElementName)){ result = new ParagraphView(elem); }else if(kind.equals(AbstractDocument.SectionElementName)){ result = new BoxView(elem, View.Y_AXIS);
return new ParagraphView(elem);
return new ParagraphView(elem);
return new WrapLabelView(elem); } else if (kind.equals(AbstractDocument.ParagraphElementName)) { return new ParagraphView(elem); } else if (kind.equals(AbstractDocument.SectionElementName)) { return new BoxView(elem, View.Y_AXIS);
public View create( Element elem ) { String kind = elem.getName(); if ( kind != null ) { switch ( kind ) { case AbstractDocument.ContentElementName: return new WrapLabelView( elem ); case AbstractDocument.ParagraphElementName: return new ParagraphView( elem ); case AbstractDocument.SectionElementName: return new BoxView( elem, View.Y_AXIS ); case StyleConstants.ComponentElementName: return new ComponentView( elem ); case StyleConstants.IconElementName: return new IconView( elem ); } } // default to text display return new LabelView( elem ); } }
return new WrapLabelView(element); case AbstractDocument.ParagraphElementName: return new ParagraphView(element); case AbstractDocument.SectionElementName: return new BoxView(element, View.Y_AXIS);