Basis of a text components look-and-feel. This provides the basic editor view and controller services that may be useful when creating a look-and-feel for an extension of JTextComponent
.
Most state is held in the associated JTextComponent
as bound properties, and the UI installs default values for the various properties. This default will install something for all of the properties. Typically, a LAF implementation will do more however. At a minimum, a LAF would generally install key bindings.
This class also provides some concurrency support if the Document
associated with the JTextComponent is a subclass of AbstractDocument
. Access to the View (or View hierarchy) is serialized between any thread mutating the model and the Swing event thread (which is expected to render, do model/view coordinate translation, etc). Any access to the root view should first acquire a read-lock on the AbstractDocument and release that lock in a finally block.
An important method to define is the {@link #getPropertyPrefix} methodwhich is used as the basis of the keys used to fetch defaults from the UIManager. The string should reflect the type of TextUI (eg. TextField, TextArea, etc) without the particular LAF part of the name (eg Metal, Motif, etc).
To build a view of the model, one of the following strategies can be employed.
Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeans™ has been added to the java.beans
package. Please see {@link java.beans.XMLEncoder}.
@author Timothy Prinzing
@author Shannon Hickey (drag and drop)
|
|
|
|
|
|
|
|
|
|
|
|