KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > wings > style > CSSProperty


1 /*
2  * $Id: CSSProperty.java,v 1.1 2005/05/27 09:17:35 blueshift Exp $
3  * Copyright 2000,2005 wingS development team.
4  *
5  * This file is part of wingS (http://www.j-wings.org).
6  *
7  * wingS is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU Lesser General Public License
9  * as published by the Free Software Foundation; either version 2.1
10  * of the License, or (at your option) any later version.
11  *
12  * Please see COPYING for the complete licence.
13  */

14
15 package org.wings.style;
16
17 /**
18  * A CSS attribute is a property on any abritriary HTML element which can be set via CSS.
19  *
20  * You use CSS selectors ({@link CSSSelector}) to define <b>which</b> elements you want to modify and define
21  * with CSS properties {@link CSSProperty} <b>what</b> visual property you want to modify.
22  *
23  * {@see http://www.w3.org/TR/REC-CSS2/selector.html}
24  *
25  * @author bschmid
26  */

27 public class CSSProperty {
28
29     public final static CSSProperty BACKGROUND = new CSSProperty("background");
30
31     public final static CSSProperty BACKGROUND_ATTACHMENT = new CSSProperty("background-attachment");
32
33     public final static CSSProperty BACKGROUND_COLOR = new CSSProperty("background-color");
34
35     public final static CSSProperty BACKGROUND_IMAGE = new CSSProperty("background-image");
36
37     public final static CSSProperty BACKGROUND_POSITION = new CSSProperty("background-position");
38
39     public final static CSSProperty BACKGROUND_REPEAT = new CSSProperty("background-repeat");
40
41     public final static CSSProperty BORDER = new CSSProperty("border");
42
43     public final static CSSProperty BORDER_BOTTOM = new CSSProperty("border-bottom");
44
45     public final static CSSProperty BORDER_BOTTOM_WIDTH = new CSSProperty("border-bottom-width");
46
47     public final static CSSProperty BORDER_COLOR = new CSSProperty("border-color");
48
49     public final static CSSProperty BORDER_LEFT = new CSSProperty("border-left");
50
51     public final static CSSProperty BORDER_LEFT_WIDTH = new CSSProperty("border-left-width");
52
53     public final static CSSProperty BORDER_RIGHT = new CSSProperty("border-right");
54
55     public final static CSSProperty BORDER_RIGHT_WIDTH = new CSSProperty("border-right-width");
56
57     public final static CSSProperty BORDER_STYLE = new CSSProperty("border-style");
58
59     public final static CSSProperty BORDER_TOP = new CSSProperty("border-top");
60
61     public final static CSSProperty BORDER_TOP_WIDTH = new CSSProperty("border-top-width");
62
63     public final static CSSProperty BORDER_WIDTH = new CSSProperty("border-width");
64
65     public final static CSSProperty CLEAR = new CSSProperty("clear");
66
67     public final static CSSProperty COLOR = new CSSProperty("color");
68
69     public final static CSSProperty DISPLAY = new CSSProperty("display");
70
71     public final static CSSProperty FLOAT = new CSSProperty("float");
72
73     public final static CSSProperty FONT = new CSSProperty("font");
74
75     public final static CSSProperty FONT_COLOR = new CSSProperty("font-color");
76
77     public final static CSSProperty FONT_FAMILY = new CSSProperty("font-family");
78
79     public final static CSSProperty FONT_SIZE = new CSSProperty("font-size");
80
81     public final static CSSProperty FONT_STYLE = new CSSProperty("font-style");
82
83     public final static CSSProperty FONT_VARIANT = new CSSProperty("font-variant");
84
85     public final static CSSProperty FONT_WEIGHT = new CSSProperty("font-weight");
86
87     public final static CSSProperty HEIGHT = new CSSProperty("height");
88
89     public final static CSSProperty LETTER_SPACING = new CSSProperty("letter-spacing");
90
91     public final static CSSProperty LINE_HEIGHT = new CSSProperty("line-height");
92
93     public final static CSSProperty LIST_STYLE = new CSSProperty("list-style");
94
95     public final static CSSProperty LIST_STYLE_IMAGE = new CSSProperty("list-style-image");
96
97     public final static CSSProperty LIST_STYLE_POSITION = new CSSProperty("list-style-position");
98
99     public final static CSSProperty LIST_STYLE_TYPE = new CSSProperty("list-style-type");
100
101     public final static CSSProperty MARGIN = new CSSProperty("margin");
102
103     public final static CSSProperty MARGIN_BOTTOM = new CSSProperty("margin-bottom");
104
105     public final static CSSProperty MARGIN_LEFT = new CSSProperty("margin-left");
106
107     public final static CSSProperty MARGIN_RIGHT = new CSSProperty("margin-right");
108
109     public final static CSSProperty MARGIN_TOP = new CSSProperty("margin-top");
110
111     public final static CSSProperty PADDING = new CSSProperty("padding");
112
113     public final static CSSProperty PADDING_BOTTOM = new CSSProperty("padding-bottom");
114
115     public final static CSSProperty PADDING_LEFT = new CSSProperty("padding-left");
116
117     public final static CSSProperty PADDING_RIGHT = new CSSProperty("padding-right");
118
119     public final static CSSProperty PADDING_TOP = new CSSProperty("padding-top");
120
121     public final static CSSProperty TEXT_ALIGN = new CSSProperty("text-align");
122
123     public final static CSSProperty TEXT_DECORATION = new CSSProperty("text-decoration");
124
125     public final static CSSProperty TEXT_INDENT = new CSSProperty("text-indent");
126
127     public final static CSSProperty TEXT_TRANSFORM = new CSSProperty("text-transform");
128
129     public final static CSSProperty VERTICAL_ALIGN = new CSSProperty("vertical-align");
130
131     public final static CSSProperty WORD_SPACING = new CSSProperty("word-spacing");
132
133     public final static CSSProperty WHITE_SPACE = new CSSProperty("white-space");
134
135     public final static CSSProperty WIDTH = new CSSProperty("width");
136
137     public final static CSSProperty BORDER_SPACING = new CSSProperty("border-spacing");
138
139     public final static CSSProperty CAPTION_SIDE = new CSSProperty("caption-side");
140
141     private final String JavaDoc name;
142
143     public CSSProperty(String JavaDoc cssAttributeName) {
144         this.name = cssAttributeName;
145     }
146
147     public String JavaDoc getName() {
148         return name;
149     }
150
151     public boolean equals(Object JavaDoc o) {
152         if (this == o) return true;
153         if (!(o instanceof CSSProperty)) return false;
154         final CSSProperty cssProperty = (CSSProperty) o;
155
156         // CSS properties are CASE INSENSITIVE!
157
return (name.equalsIgnoreCase(cssProperty.name));
158     }
159
160     public int hashCode() {
161         return name.hashCode();
162     }
163
164     public String JavaDoc toString() {
165         return getName();
166     }
167
168 }
169
Popular Tags