- java.lang.Object
-
- javax.swing.text.html.CSS
-
- All Implemented Interfaces:
- Serializable
public class CSS extends Object implements Serializable
Defines a set of CSS attributes as a typesafe enumeration. The HTML View implementations use CSS attributes to determine how they will render. This also defines methods to map between CSS/HTML/StyleConstants. Any shorthand properties, such as font, are mapped to the intrinsic properties.The following describes the CSS properties that are suppored by the rendering engine:
- font-family
- font-style
- font-size (supports relative units)
- font-weight
- font
- color
- background-color (with the exception of transparent)
- background-image
- background-repeat
- background-position
- background
- text-decoration (with the exception of blink and overline)
- vertical-align (only sup and super)
- text-align (justify is treated as center)
- margin-top
- margin-right
- margin-bottom
- margin-left
- margin
- padding-top
- padding-right
- padding-bottom
- padding-left
- padding
- border-top-style
- border-right-style
- border-bottom-style
- border-left-style
- border-style (only supports inset, outset and none)
- border-top-color
- border-right-color
- border-bottom-color
- border-left-color
- border-color
- list-style-image
- list-style-type
- list-style-position
- font-variant
- background-attachment (background always treated as scroll)
- word-spacing
- letter-spacing
- text-indent
- text-transform
- line-height
- border-top-width (this is used to indicate if a border should be used)
- border-right-width
- border-bottom-width
- border-left-width
- border-width
- border-top
- border-right
- border-bottom
- border-left
- border
- width
- height
- float
- clear
- display
- white-space
- list-style
Note: for the time being we do not fully support relative units, unless noted, so that p { margin-top: 10% } will be treated as if no margin-top was specified.
- See Also:
StyleSheet
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static class
CSS.Attribute
Definitions to be used as a key on AttributeSet's that might hold CSS attributes.
-
Constructor Summary
Constructors Constructor and Description CSS()
-
Method Summary
Methods Modifier and Type Method and Description static CSS.Attribute[]
getAllAttributeKeys()
Return the set of all possible CSS attribute keys.static CSS.Attribute
getAttribute(String name)
Translates a string to aCSS.Attribute
object.
-
-
-
Method Detail
-
getAllAttributeKeys
public static CSS.Attribute[] getAllAttributeKeys()
Return the set of all possible CSS attribute keys.
-
getAttribute
public static final CSS.Attribute getAttribute(String name)
Translates a string to aCSS.Attribute
object. This will returnnull
if there is no attribute by the given name.- Parameters:
name
- the name of the CSS attribute to fetch the typesafe enumeration for- Returns:
- the
CSS.Attribute
object, ornull
if the string doesn't represent a valid attribute key
-
-
Document created the 11/06/2005, last modified the 04/03/2020
Source of the printed document:https://www.gaudry.be/en/java-api-rf-javax/swing/text/html/CSS.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.
References
These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.