@@ -35,20 +35,33 @@ public class CSSStyleRuleImpl extends AbstractCSSRuleImpl {
35
35
private SelectorList selectors_ ;
36
36
private CSSStyleDeclarationImpl style_ ;
37
37
38
+ /**
39
+ * Ctor.
40
+ * @param parentStyleSheet the parent style sheet
41
+ * @param parentRule the parent rule
42
+ * @param selectors the selectors
43
+ */
44
+ public CSSStyleRuleImpl (final CSSStyleSheetImpl parentStyleSheet ,
45
+ final AbstractCSSRuleImpl parentRule , final SelectorList selectors ) {
46
+ super (parentStyleSheet , parentRule );
47
+ setSelectors (selectors );
48
+ }
49
+
50
+ /**
51
+ * @return all selectors
52
+ */
38
53
public SelectorList getSelectors () {
39
54
return selectors_ ;
40
55
}
41
56
57
+ /**
58
+ * Updates the selectors.
59
+ * @param selectors the new selectors
60
+ */
42
61
public void setSelectors (final SelectorList selectors ) {
43
62
selectors_ = selectors ;
44
63
}
45
64
46
- public CSSStyleRuleImpl (final CSSStyleSheetImpl parentStyleSheet ,
47
- final AbstractCSSRuleImpl parentRule , final SelectorList selectors ) {
48
- super (parentStyleSheet , parentRule );
49
- selectors_ = selectors ;
50
- }
51
-
52
65
/**
53
66
* {@inheritDoc}
54
67
*/
@@ -68,8 +81,13 @@ public String getCssText() {
68
81
return selectorText + " { " + styleText + " }" ;
69
82
}
70
83
84
+ /**
85
+ * Sets the css text.
86
+ * @param cssText the new css text
87
+ * @throws DOMException in case of error
88
+ */
71
89
public void setCssText (final String cssText ) throws DOMException {
72
- final CSSStyleSheetImpl parentStyleSheet = getParentStyleSheetImpl ();
90
+ final CSSStyleSheetImpl parentStyleSheet = getParentStyleSheet ();
73
91
if (parentStyleSheet != null && parentStyleSheet .isReadOnly ()) {
74
92
throw new DOMExceptionImpl (
75
93
DOMException .NO_MODIFICATION_ALLOWED_ERR ,
@@ -106,12 +124,20 @@ public void setCssText(final String cssText) throws DOMException {
106
124
}
107
125
}
108
126
127
+ /**
128
+ * @return the selector text
129
+ */
109
130
public String getSelectorText () {
110
131
return selectors_ .toString ();
111
132
}
112
133
134
+ /**
135
+ * Sets the selector text.
136
+ * @param selectorText the new selector text
137
+ * @throws DOMException in clase of error
138
+ */
113
139
public void setSelectorText (final String selectorText ) throws DOMException {
114
- final CSSStyleSheetImpl parentStyleSheet = getParentStyleSheetImpl ();
140
+ final CSSStyleSheetImpl parentStyleSheet = getParentStyleSheet ();
115
141
if (parentStyleSheet != null && parentStyleSheet .isReadOnly ()) {
116
142
throw new DOMExceptionImpl (
117
143
DOMException .NO_MODIFICATION_ALLOWED_ERR ,
@@ -137,10 +163,17 @@ public void setSelectorText(final String selectorText) throws DOMException {
137
163
}
138
164
}
139
165
166
+ /**
167
+ * @return the style
168
+ */
140
169
public CSSStyleDeclarationImpl getStyle () {
141
170
return style_ ;
142
171
}
143
172
173
+ /**
174
+ * Replaces the style.
175
+ * @param style the new style
176
+ */
144
177
public void setStyle (final CSSStyleDeclarationImpl style ) {
145
178
style_ = style ;
146
179
}
0 commit comments