The View Classes
Now that we have an overview of what views are and how they fit
together, we’ll take a closer look at each of the public view
classes, starting with the abstract base class,
View.
The View Class
This
abstract class represents how a single Element is
displayed within a document. It defines properties and behavior
common to different types of views. As we showed in Figure 23.2, all other view classes extend from
View.
Properties
The View class defines the properties shown in
Table 23.2. The attributes
property defines the AttributeSet used by the view
to render an Element. By default, the
Element’s attributes are used. However, view
objects should access the attributes through the
getAttributes() accessor, to allow view-specific
attributes to be added to the Element’s
attributes or to allow the attributes to be converted in some way by
the view subclasses.
Table 23-2. View Properties
|
Property |
Data Type |
get |
is |
set |
bound |
Default Value |
|---|---|---|---|---|---|---|
|
|
|
• |
| |||
|
|
|
• |
from the | |||
|
|
|
• |
from | |||
|
|
|
• |
from the | |||
|
|
|
• |
from constructor | |||
|
|
|
• |
from the | |||
|
|
|
• |
if | |||
|
|
|
• |
if | |||
|
|
|
• ... |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access