提交 2bf7ab59 编写于 作者: P peterz

6954231: SynthTextPaneUI.installUI() doesn't set component to opaque even if...

6954231: SynthTextPaneUI.installUI() doesn't set component to opaque even if prop was not set by client progr
Reviewed-by: alexp
上级 9ca80ac5
......@@ -779,20 +779,16 @@ public abstract class BasicTextUI extends TextUI implements ViewFactory {
if (c instanceof JTextComponent) {
editor = (JTextComponent) c;
// common case is background painted... this can
// easily be changed by subclasses or from outside
// of the component.
LookAndFeel.installProperty(editor, "opaque", Boolean.TRUE);
LookAndFeel.installProperty(editor, "autoscrolls", Boolean.TRUE);
// install defaults
installDefaults();
installDefaults2();
// This is a workaround as these should not override what synth has
// set them to
if (! (this instanceof SynthUI)) {
// common case is background painted... this can
// easily be changed by subclasses or from outside
// of the component.
LookAndFeel.installProperty(editor, "opaque", Boolean.TRUE);
LookAndFeel.installProperty(editor, "autoscrolls", Boolean.TRUE);
}
// attach to the model and editor
editor.addPropertyChangeListener(updateHandler);
Document doc = editor.getDocument();
......
......@@ -72,7 +72,28 @@ public class SynthTextPaneUI extends SynthEditorPaneUI {
}
/**
* @inheritDoc
* Installs the UI for a component. This does the following
* things.
* <ol>
* <li>
* Sets opaqueness of the associated component according to its style,
* if the opaque property has not already been set by the client program.
* <li>
* Installs the default caret and highlighter into the
* associated component. These properties are only set if their
* current value is either {@code null} or an instance of
* {@link UIResource}.
* <li>
* Attaches to the editor and model. If there is no
* model, a default one is created.
* <li>
* Creates the view factory and the view hierarchy used
* to represent the model.
* </ol>
*
* @param c the editor component
* @see BasicTextUI#installUI
* @see ComponentUI#installUI
*/
@Override
public void installUI(JComponent c) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册