01: /* *****************************************************************************
02: * StyleMap.java
03: * ****************************************************************************/
04:
05: /* J_LZ_COPYRIGHT_BEGIN *******************************************************
06: * Copyright 2001-2007 Laszlo Systems, Inc. All Rights Reserved. *
07: * Use is subject to license terms. *
08: * J_LZ_COPYRIGHT_END *********************************************************/
09:
10: package org.openlaszlo.css;
11:
12: public class StyleProperty {
13: public StyleProperty(String value, boolean important) {
14: this .value = value;
15: this .important = important;
16: }
17:
18: public String value;
19: public boolean important;
20: public Specificity specificity = null;
21:
22: // This supports ScriptCompiler.writeObject
23: public String toString() {
24: if (important) {
25: // TODO: [2007-01-02 ptw] How do we want to represent important
26: // in JS? For now, we make a string...
27: return "\"" + value + " !\"";
28: } else {
29: // Otherwise, we return the value unquoted. See CSSHandler,
30: // which quotes string and url literals.
31: return value;
32: }
33: }
34: }
|