01: /*
02: ItsNat Java Web Application Framework
03: Copyright (C) 2007 Innowhere Software Services S.L., Spanish Company
04: Author: Jose Maria Arranz Santamaria
05:
06: This program is free software: you can redistribute it and/or modify
07: it under the terms of the GNU Affero General Public License as published by
08: the Free Software Foundation, either version 3 of the License, or
09: (at your option) any later version. See the GNU Affero General Public
10: License for more details. See the copy of the GNU Affero General Public License
11: included in this program. If not, see <http://www.gnu.org/licenses/>.
12: */
13:
14: package org.itsnat.impl.core.css;
15:
16: import org.w3c.dom.DOMException;
17: import org.itsnat.impl.core.css.lex.SourceCode;
18:
19: /**
20: *
21: * @author jmarranz
22: */
23: public class CSSValueInheritImpl extends CSSValueImpl {
24:
25: /** Creates a new instance of CSSValueInheritImpl */
26: public CSSValueInheritImpl(SourceCode cssTextCode, int code,
27: ObjectValueParent parent) {
28: super (cssTextCode, code, parent);
29: }
30:
31: public static boolean isCSSValueInherit(SourceCode cssTextCode) {
32: String cssText = cssTextCode.toString();
33: cssText = cssText.trim();
34: return cssText.equals("inherit");
35: }
36:
37: public short getCssValueType() {
38: return CSS_INHERIT;
39: }
40:
41: public void setCssText(String cssText) throws DOMException {
42: String cssTextTmp = cssText.trim();
43: if (!cssTextTmp.equals("inherit"))
44: throw new DOMException(DOMException.INVALID_ACCESS_ERR,
45: "Only \"inherit\" value is valid");
46:
47: super .setCssText(cssText);
48: }
49:
50: public void rebuild(SourceCode cssText) {
51: }
52:
53: public Object getUpdatedChildObjectValueFromElement(
54: Object requester, int requesterCode) {
55: // "No tiene hijos"
56: throw new DOMException(DOMException.INVALID_ACCESS_ERR,
57: "INTERNAL ERROR");
58: }
59:
60: public void notifyToElementChangedCSSText(SourceCode cssTextCode,
61: Object requester) {
62: // "No tiene hijos"
63: throw new DOMException(DOMException.INVALID_ACCESS_ERR,
64: "INTERNAL ERROR");
65: }
66: }
|