Methods Summary |
---|
public javax.swing.text.View | create(javax.swing.text.Element elem)Creates the view for an element. Returns a WrappedPlainView or
PlainView.
Document doc = elem.getDocument();
Object i18nFlag = doc.getProperty("i18n"/*AbstractDocument.I18NProperty*/);
if ((i18nFlag != null) && i18nFlag.equals(Boolean.TRUE)) {
// build a view that support bidi
return createI18N(elem);
} else {
JTextComponent c = getComponent();
if (c instanceof JTextArea) {
JTextArea area = (JTextArea) c;
View v;
if (area.getLineWrap()) {
v = new WrappedPlainView(elem, area.getWrapStyleWord());
} else {
v = new PlainView(elem);
}
return v;
}
}
return null;
|
javax.swing.text.View | createI18N(javax.swing.text.Element elem)
String kind = elem.getName();
if (kind != null) {
if (kind.equals(AbstractDocument.ContentElementName)) {
return new PlainParagraph(elem);
} else if (kind.equals(AbstractDocument.ParagraphElementName)) {
return new BoxView(elem, View.Y_AXIS);
}
}
return null;
|
public static javax.swing.plaf.ComponentUI | createUI(javax.swing.JComponent ta)Creates a UI for a JTextArea.
return new BasicTextAreaUI();
|
public java.awt.Dimension | getMinimumSize(javax.swing.JComponent c)The method is overridden to take into account caret width.
return super.getMinimumSize(c);
//the fix for 4785160 is undone
|
public java.awt.Dimension | getPreferredSize(javax.swing.JComponent c)The method is overridden to take into account caret width.
return super.getPreferredSize(c);
//the fix for 4785160 is undone
|
protected java.lang.String | getPropertyPrefix()Fetches the name used as a key to look up properties through the
UIManager. This is used as a prefix to all the standard
text properties.
return "TextArea";
|
protected void | installDefaults()
super.installDefaults();
//the fix for 4785160 is undone
|
protected void | propertyChange(java.beans.PropertyChangeEvent evt)This method gets called when a bound property is changed
on the associated JTextComponent. This is a hook
which UI implementations may change to reflect how the
UI displays bound properties of JTextComponent subclasses.
This is implemented to rebuild the View when the
WrapLine or the WrapStyleWord property changes.
if (evt.getPropertyName().equals("lineWrap") ||
evt.getPropertyName().equals("wrapStyleWord") ||
evt.getPropertyName().equals("tabSize")) {
// rebuild the view
modelChanged();
} else if ("editable".equals(evt.getPropertyName())) {
updateFocusTraversalKeys();
}
|