001: /*
002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003: *
004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005: *
006: * The contents of this file are subject to the terms of either the GNU
007: * General Public License Version 2 only ("GPL") or the Common
008: * Development and Distribution License("CDDL") (collectively, the
009: * "License"). You may not use this file except in compliance with the
010: * License. You can obtain a copy of the License at
011: * http://www.netbeans.org/cddl-gplv2.html
012: * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
013: * specific language governing permissions and limitations under the
014: * License. When distributing the software, include this License Header
015: * Notice in each file and include the License file at
016: * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
017: * particular file as subject to the "Classpath" exception as provided
018: * by Sun in the GPL Version 2 section of the License file that
019: * accompanied this code. If applicable, add the following below the
020: * License Header, with the fields enclosed by brackets [] replaced by
021: * your own identifying information:
022: * "Portions Copyrighted [year] [name of copyright owner]"
023: *
024: * Contributor(s):
025: *
026: * The Original Software is NetBeans. The Initial Developer of the Original
027: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
028: * Microsystems, Inc. All Rights Reserved.
029: *
030: * If you wish your version of this file to be governed by only the CDDL
031: * or only the GPL Version 2, indicate your decision by adding
032: * "[Contributor] elects to include this software in this distribution
033: * under the [CDDL or GPL Version 2] license." If you do not indicate a
034: * single choice of license, a recipient has the option to distribute
035: * your version of this file under either the CDDL, the GPL Version 2 or
036: * to extend the choice of license to its licensees as provided above.
037: * However, if you add GPL Version 2 code and therefore, elected the GPL
038: * Version 2 license, then the option applies only if the new code is
039: * made subject to such option by the copyright holder.
040: */
041:
042: /*
043: * CssProperties.java
044: * Created on December 17, 2004, 11:35 AM
045: */
046:
047: package org.netbeans.modules.css.visual.model;
048:
049: import java.util.ArrayList;
050: import java.util.Collections;
051: import java.util.HashMap;
052: import java.util.List;
053: import java.util.Map;
054: import java.util.Set;
055: import java.util.TreeSet;
056:
057: //XXX May be we should convert this in to a singleton class
058: // Unnecessary static initialization
059:
060: /**
061: * CSS properties information
062: * @author Winston Prakash
063: * @version 1.0
064: */
065: public final class CssProperties {
066:
067: public final static String FONT_FAMILY = "font-family"; //NOI18N
068: public final static String FONT_SIZE = "font-size"; //NOI18N
069: public final static String FONT_STYLE = "font-style"; //NOI18N
070: public final static String FONT_WEIGHT = "font-weight"; //NOI18N
071: public final static String FONT_VARIANT = "font-variant"; //NOI18N
072:
073: public final static String TEXT_DECORATION = "text-decoration"; //NOI18N
074: public final static String TEXT_ALIGN = "text-align"; //NOI18N
075: public final static String TEXT_INDENT = "text-indent"; //NOI18N
076:
077: public final static String COLOR = "color"; //NOI18N
078:
079: public final static String BACKGROUND = "background"; //NOI18N
080: public final static String BACKGROUND_COLOR = "background-color"; //NOI18N
081: public final static String BACKGROUND_IMAGE = "background-image"; //NOI18N
082: public final static String BACKGROUND_REPEAT = "background-repeat"; //NOI18N
083: public final static String BACKGROUND_ATTACHMENT = "background-attachment"; //NOI18N
084: public final static String BACKGROUND_POSITION = "background-position"; //NOI18N
085:
086: public final static String DIRECTION = "direction"; //NOI18N
087: public final static String LINE_HEIGHT = "line-height"; //NOI18N
088: public final static String VERTICAL_ALIGN = "vertical-align"; //NOI18N
089:
090: public final static String WORD_SPACING = "word-spacing"; //NOI18N
091: public final static String LETTER_SPACING = "letter-spacing"; //NOI18N
092:
093: public final static String BORDER = "border"; //NOI18N
094: public final static String BORDER_TOP = "border-top"; //NOI18N
095: public final static String BORDER_BOTTOM = "border-bottom"; //NOI18N
096: public final static String BORDER_LEFT = "border-left"; //NOI18N
097: public final static String BORDER_RIGHT = "border-right"; //NOI18N
098:
099: public final static String BORDER_COLOR = "border-color"; //NOI18N
100: public final static String BORDER_STYLE = "border-style"; //NOI18N
101: public final static String BORDER_WIDTH = "border-width"; //NOI18N
102:
103: public final static String BORDER_TOP_COLOR = "border-top-color"; //NOI18N
104: public final static String BORDER_TOP_STYLE = "border-top-style"; //NOI18N
105: public final static String BORDER_TOP_WIDTH = "border-top-width"; //NOI18N
106:
107: public final static String BORDER_BOTTOM_COLOR = "border-bottom-color"; //NOI18N
108: public final static String BORDER_BOTTOM_STYLE = "border-bottom-style"; //NOI18N
109: public final static String BORDER_BOTTOM_WIDTH = "border-bottom-width"; //NOI18N
110:
111: public final static String BORDER_LEFT_COLOR = "border-left-color"; //NOI18N
112: public final static String BORDER_LEFT_STYLE = "border-left-style"; //NOI18N
113: public final static String BORDER_LEFT_WIDTH = "border-left-width"; //NOI18N
114:
115: public final static String BORDER_RIGHT_COLOR = "border-right-color"; //NOI18N
116: public final static String BORDER_RIGHT_STYLE = "border-right-style"; //NOI18N
117: public final static String BORDER_RIGHT_WIDTH = "border-right-width"; //NOI18N
118:
119: public final static String MARGIN = "margin"; //NOI18N
120: public final static String MARGIN_TOP = "margin-top"; //NOI18N
121: public final static String MARGIN_BOTTOM = "margin-bottom"; //NOI18N
122: public final static String MARGIN_LEFT = "margin-left"; //NOI18N
123: public final static String MARGIN_RIGHT = "margin-right"; //NOI18N
124:
125: public final static String PADDING = "padding"; //NOI18N
126: public final static String PADDING_TOP = "padding-top"; //NOI18N
127: public final static String PADDING_BOTTOM = "padding-bottom"; //NOI18N
128: public final static String PADDING_LEFT = "padding-left"; //NOI18N
129: public final static String PADDING_RIGHT = "padding-right"; //NOI18N
130:
131: public final static String POSITION = "position"; //NOI18N
132: public final static String TOP = "top"; //NOI18N
133: public final static String BOTTOM = "bottom"; //NOI18N
134: public final static String LEFT = "left"; //NOI18N
135: public final static String RIGHT = "right"; //NOI18N
136:
137: public final static String WIDTH = "width"; //NOI18N
138: public final static String HEIGHT = "height"; //NOI18N
139: public final static String MIN_WIDTH = "min-width"; //NOI18N
140: public final static String MAX_WIDTH = "max-width"; //NOI18N
141: public final static String MIN_HEIGHT = "min-height"; //NOI18N
142: public final static String MAX_HEIGHT = "max-height"; //NOI18N
143:
144: public final static String Z_INDEX = "z-index"; //NOI18N
145: public final static String VISIBILITY = "visibility"; //NOI18N
146:
147: public final static String CLIP = "clip"; //NOI18N
148:
149: public final static String STYLE = "style"; //NOI18N
150:
151: private static Set<String> cssPropertyNames = new TreeSet<String>();
152:
153: private static void setCssPropertyNames() {
154: cssPropertyNames.add(BACKGROUND);
155: cssPropertyNames.add(BACKGROUND_ATTACHMENT);
156: cssPropertyNames.add(BACKGROUND_COLOR);
157: cssPropertyNames.add(BACKGROUND_IMAGE);
158: cssPropertyNames.add(BACKGROUND_POSITION);
159: cssPropertyNames.add(BACKGROUND_REPEAT);
160:
161: cssPropertyNames.add(BORDER);
162: cssPropertyNames.add(BORDER_COLOR);
163: cssPropertyNames.add(BORDER_STYLE);
164: cssPropertyNames.add(BORDER_WIDTH);
165:
166: cssPropertyNames.add(BORDER_TOP);
167: cssPropertyNames.add(BORDER_TOP_COLOR);
168: cssPropertyNames.add(BORDER_TOP_STYLE);
169: cssPropertyNames.add(BORDER_TOP_WIDTH);
170:
171: cssPropertyNames.add(BORDER_BOTTOM);
172: cssPropertyNames.add(BORDER_BOTTOM_COLOR);
173: cssPropertyNames.add(BORDER_BOTTOM_STYLE);
174: cssPropertyNames.add(BORDER_BOTTOM_WIDTH);
175:
176: cssPropertyNames.add(BORDER_LEFT);
177: cssPropertyNames.add(BORDER_LEFT_COLOR);
178: cssPropertyNames.add(BORDER_LEFT_STYLE);
179: cssPropertyNames.add(BORDER_LEFT_WIDTH);
180:
181: cssPropertyNames.add(BORDER_TOP);
182: cssPropertyNames.add(BORDER_TOP_COLOR);
183: cssPropertyNames.add(BORDER_TOP_STYLE);
184: cssPropertyNames.add(BORDER_TOP_WIDTH);
185:
186: cssPropertyNames.add(MARGIN);
187: cssPropertyNames.add(MARGIN_TOP);
188: cssPropertyNames.add(MARGIN_BOTTOM);
189: cssPropertyNames.add(MARGIN_LEFT);
190: cssPropertyNames.add(MARGIN_RIGHT);
191:
192: cssPropertyNames.add(PADDING);
193: cssPropertyNames.add(PADDING_TOP);
194: cssPropertyNames.add(PADDING_BOTTOM);
195: cssPropertyNames.add(PADDING_LEFT);
196: cssPropertyNames.add(PADDING_RIGHT);
197:
198: cssPropertyNames.add(POSITION);
199: cssPropertyNames.add(TOP);
200: cssPropertyNames.add(BOTTOM);
201: cssPropertyNames.add(LEFT);
202: cssPropertyNames.add(RIGHT);
203:
204: cssPropertyNames.add(WIDTH);
205: cssPropertyNames.add(HEIGHT);
206: cssPropertyNames.add(MAX_WIDTH);
207: cssPropertyNames.add(MIN_WIDTH);
208: cssPropertyNames.add(MAX_HEIGHT);
209: cssPropertyNames.add(MIN_HEIGHT);
210:
211: cssPropertyNames.add(STYLE);
212: cssPropertyNames.add(CLIP);
213: cssPropertyNames.add(Z_INDEX);
214: cssPropertyNames.add(COLOR);
215: cssPropertyNames.add(DIRECTION);
216: cssPropertyNames.add(LINE_HEIGHT);
217: cssPropertyNames.add(VERTICAL_ALIGN);
218:
219: cssPropertyNames.add(FONT_FAMILY);
220: cssPropertyNames.add(FONT_SIZE);
221: cssPropertyNames.add(FONT_STYLE);
222: cssPropertyNames.add(FONT_WEIGHT);
223: cssPropertyNames.add(FONT_VARIANT);
224:
225: cssPropertyNames.add(TEXT_DECORATION);
226: cssPropertyNames.add(TEXT_ALIGN);
227: cssPropertyNames.add(TEXT_INDENT);
228:
229: cssPropertyNames.add(COLOR);
230: }
231:
232: static List<String> cssLengthUnits = new ArrayList<String>();
233:
234: private static void setCssLengthUnitNames() {
235: cssLengthUnits.add("px"); //NOI18N
236: cssLengthUnits.add("pt"); //NOI18N
237: cssLengthUnits.add("%"); //NOI18N
238: cssLengthUnits.add("in"); //NOI18N
239: cssLengthUnits.add("cm"); //NOI18N
240: cssLengthUnits.add("mm"); //NOI18N
241: cssLengthUnits.add("em"); //NOI18N
242: cssLengthUnits.add("ex"); //NOI18N
243: cssLengthUnits.add("picas"); //NOI18N
244: }
245:
246: private static List<String> backgroundRepeatValues = new ArrayList<String>();
247:
248: private static void setBackgroundRepeatValues() {
249: backgroundRepeatValues.add("repeat"); //NOI18N
250: backgroundRepeatValues.add("repeat-x"); //NOI18N
251: backgroundRepeatValues.add("repeat-y"); //NOI18N
252: backgroundRepeatValues.add("inherit"); //NOI18N
253: }
254:
255: private static List<String> backgroundPositionValues = new ArrayList<String>();
256:
257: private static void setBackgroundPositionValues() {
258: backgroundPositionValues.add("center"); //NOI18N
259: backgroundPositionValues.add("left"); //NOI18N
260: backgroundPositionValues.add("right"); //NOI18N
261: backgroundPositionValues.add("top"); //NOI18N
262: backgroundPositionValues.add("bottom"); //NOI18N
263: backgroundPositionValues.add("inherit"); //NOI18N
264: }
265:
266: private static List<String> backgroundAttachmentValues = new ArrayList<String>();
267:
268: private static void setBackgroundAttachmentValues() {
269: backgroundAttachmentValues.add("none"); //NOI18N
270: backgroundAttachmentValues.add("scroll"); //NOI18N
271: backgroundAttachmentValues.add("fixed"); //NOI18N
272: backgroundAttachmentValues.add("inherit"); //NOI18N
273: }
274:
275: private static List<String> fontStyleValues = new ArrayList<String>();
276:
277: private static void setFontStyleValues() {
278: fontStyleValues.add("normal"); //NOI18N
279: fontStyleValues.add("italic"); //NOI18N
280: fontStyleValues.add("oblique"); //NOI18N
281: fontStyleValues.add("inherit"); //NOI18N
282: }
283:
284: private static List<String> fontVariantValues = new ArrayList<String>();
285:
286: private static void setFontVariantValues() {
287: fontVariantValues.add("normal"); //NOI18N
288: fontVariantValues.add("small-caps"); //NOI18N
289: fontVariantValues.add("inherit"); //NOI18N
290: }
291:
292: private static List<String> fontWeightValues = new ArrayList<String>();
293:
294: private static void setFontWeightValues() {
295: fontWeightValues.add("normal"); //NOI18N
296: fontWeightValues.add("bold"); //NOI18N
297: fontWeightValues.add("bolder"); //NOI18N
298: fontWeightValues.add("lighter"); //NOI18N
299: fontWeightValues.add("100"); //NOI18N
300: fontWeightValues.add("200"); //NOI18N
301: fontWeightValues.add("300"); //NOI18N
302: fontWeightValues.add("400"); //NOI18N
303: fontWeightValues.add("500"); //NOI18N
304: fontWeightValues.add("600"); //NOI18N
305: fontWeightValues.add("700"); //NOI18N
306: fontWeightValues.add("800"); //NOI18N
307: fontWeightValues.add("900"); //NOI18N
308: fontWeightValues.add("inherit"); //NOI18N
309: }
310:
311: private static List<String> directionValues = new ArrayList<String>();
312:
313: private static void setDirectionValues() {
314: directionValues.add("ltr"); //NOI18N
315: directionValues.add("rtl"); //NOI18N
316: directionValues.add("inherit"); //NOI18N
317: }
318:
319: private static List<String> textAlignValues = new ArrayList<String>();
320:
321: private static void setTextAlignValues() {
322: textAlignValues.add("center"); //NOI18N
323: textAlignValues.add("left"); //NOI18N
324: textAlignValues.add("right"); //NOI18N
325: textAlignValues.add("justify"); //NOI18N
326: textAlignValues.add("inherit"); //NOI18N
327: }
328:
329: private static List<String> textDecorationValues = new ArrayList<String>();
330:
331: private static void setTextDecorationValues() {
332: textDecorationValues.add("none"); //NOI18N
333: textDecorationValues.add("underline"); //NOI18N
334: textDecorationValues.add("overline"); //NOI18N
335: textDecorationValues.add("line-through"); //NOI18N
336: textDecorationValues.add("inherit"); //NOI18N
337: }
338:
339: private static List<String> verticalAlignValues = new ArrayList<String>();
340:
341: private static void setVerticalAlignValues() {
342: verticalAlignValues.add("baseline"); //NOI18N
343: verticalAlignValues.add("sub"); //NOI18N
344: verticalAlignValues.add("super"); //NOI18N
345: verticalAlignValues.add("top"); //NOI18N
346: verticalAlignValues.add("text-top"); //NOI18N
347: verticalAlignValues.add("middle"); //NOI18N
348: verticalAlignValues.add("bottom"); //NOI18N
349: verticalAlignValues.add("text-bottom"); //NOI18N
350: verticalAlignValues.add("inherit"); //NOI18N
351: }
352:
353: private static List<String> positionValues = new ArrayList<String>();
354:
355: private static void setPositionValues() {
356: positionValues.add("absolute"); //NOI18N
357: positionValues.add("static"); //NOI18N
358: positionValues.add("relative"); //NOI18N
359: positionValues.add("fixed"); //NOI18N
360: positionValues.add("inherit"); //NOI18N
361: }
362:
363: private static List<String> visiblityValues = new ArrayList<String>();
364:
365: private static void setVisiblityValues() {
366: visiblityValues.add("visible"); //NOI18N
367: visiblityValues.add("hidden"); //NOI18N
368: visiblityValues.add("collapse"); //NOI18N
369: visiblityValues.add("inherit"); //NOI18N
370: }
371:
372: private static List<String> borderStyleValues = new ArrayList<String>();
373:
374: private static void setBorderStyleValues() {
375: borderStyleValues.add("none"); //NOI18N
376: borderStyleValues.add("hidden"); //NOI18N
377: borderStyleValues.add("dotted"); //NOI18N
378: borderStyleValues.add("dashed"); //NOI18N
379: borderStyleValues.add("solid"); //NOI18N
380: borderStyleValues.add("double"); //NOI18N
381: borderStyleValues.add("groove"); //NOI18N
382: borderStyleValues.add("ridge"); //NOI18N
383: borderStyleValues.add("inset"); //NOI18N
384: borderStyleValues.add("outset"); //NOI18N
385: borderStyleValues.add("inherit"); //NOI18N
386: }
387:
388: private static List<String> colorValues = new ArrayList<String>();
389:
390: private static void setColorValues() {
391: colorValues.add("aqua"); //NOI18N
392: colorValues.add("black"); //NOI18N
393: colorValues.add("blue"); //NOI18N
394: colorValues.add("fuchsia"); //NOI18N
395: colorValues.add("gray"); //NOI18N
396: colorValues.add("green"); //NOI18N
397: colorValues.add("lime"); //NOI18N
398: colorValues.add("maroon"); //NOI18N
399: colorValues.add("navy"); //NOI18N
400: colorValues.add("olive"); //NOI18N
401: colorValues.add("orange"); //NOI18N
402: colorValues.add("purple"); //NOI18N
403: colorValues.add("red"); //NOI18N
404: colorValues.add("silver"); //NOI18N
405: colorValues.add("teal"); //NOI18N
406: colorValues.add("white"); //NOI18N
407: colorValues.add("yellow"); //NOI18N
408: }
409:
410: private static Map<String, String> colorNameHexMap = new HashMap<String, String>();
411:
412: private static void setColorNameHexMap() {
413: colorNameHexMap.put("black", "#000000"); //NOI18N
414: colorNameHexMap.put("gray", "#808080"); //NOI18N
415: colorNameHexMap.put("white", "#FFFFFF"); //NOI18N
416: colorNameHexMap.put("maroon", "#800000"); //NOI18N
417: colorNameHexMap.put("red", "#FF0000"); //NOI18N
418: colorNameHexMap.put("purple", "#800080"); //NOI18N
419: colorNameHexMap.put("fuchsia", "#FF00FF"); //NOI18N
420: colorNameHexMap.put("green", "#008000"); //NOI18N
421: colorNameHexMap.put("lime", "#00FF00"); //NOI18N
422: colorNameHexMap.put("olive", "#808000"); //NOI18N
423: colorNameHexMap.put("orange", "#FFA500"); //NOI18N
424: colorNameHexMap.put("yellow", "#FFFF00"); //NOI18N
425: colorNameHexMap.put("navy", "#000080"); //NOI18N
426: colorNameHexMap.put("blue", "#0000FF"); //NOI18N
427: colorNameHexMap.put("silver", "#C0C0C0"); //NOI18N
428: colorNameHexMap.put("teal", "#008080"); //NOI18N
429: colorNameHexMap.put("aqua", "#00FFFF"); //NOI18N
430: }
431:
432: private static List<String> fontFamilyValues = new ArrayList<String>();
433:
434: private static void setFontFamilyValues() {
435: fontFamilyValues.add("serif"); //NOI18N
436: fontFamilyValues.add("sans-serif"); //NOI18N
437: fontFamilyValues.add("monospace"); //NOI18N
438: fontFamilyValues.add("fantasy"); //NOI18N
439: }
440:
441: private static List<String> webFontValues = new ArrayList<String>();
442:
443: private static void setWebFontValues() {
444: webFontValues.add("Arial Black"); //NOI18N
445: webFontValues.add("Cosmic Sans"); //NOI18N
446: webFontValues.add("Impact"); //NOI18N
447: webFontValues.add("Veranda"); //NOI18N
448: webFontValues.add("Webdings"); //NOI18N
449: webFontValues.add("Trebuchet"); //NOI18N
450: webFontValues.add("Georgia"); //NOI18N
451: webFontValues.add("Minion Web"); //NOI18N
452: }
453:
454: private static List<String> fontFamiliySetValues = new ArrayList<String>();
455:
456: private static void setFontFamiliySetValues() {
457: // Do not keep spaces between commas. Batik parser automatically
458: // removes the spaces.
459: fontFamiliySetValues.add("Arial,Helvetica,sans-serif"); //NOI18N
460: fontFamiliySetValues.add("\'Times New Roman\',Times,serif"); //NOI18N
461: fontFamiliySetValues.add("\'Courier New\',Courier,monospace"); //NOI18N
462: fontFamiliySetValues
463: .add("Georgia,\'Times New Roman\',times,serif"); //NOI18N
464: fontFamiliySetValues.add("Verdana,Arial,Helvetica,sans-serif"); //NOI18N
465: fontFamiliySetValues.add("Geneva,Arial,Helvetica,sans-serif"); //NOI18N
466: fontFamiliySetValues.add("serif"); //NOI18N
467: fontFamiliySetValues.add("sans-serif"); //NOI18N
468: fontFamiliySetValues.add("monospace"); //NOI18N
469: fontFamiliySetValues.add("cursive"); //NOI18N
470: fontFamiliySetValues.add("fantasy"); //NOI18N
471: }
472:
473: private static List<String> fontSizeValues = new ArrayList<String>();
474:
475: private static void setFontSizeValues() {
476: fontSizeValues.add("8"); //NOI18N
477: fontSizeValues.add("10"); //NOI18N
478: fontSizeValues.add("12"); //NOI18N
479: fontSizeValues.add("14"); //NOI18N
480: fontSizeValues.add("18"); //NOI18N
481: fontSizeValues.add("24"); //NOI18N
482: fontSizeValues.add("36"); //NOI18N
483: fontSizeValues.add("XX-small"); //NOI18N
484: fontSizeValues.add("X-small"); //NOI18N
485: fontSizeValues.add("small"); //NOI18N
486: fontSizeValues.add("medium"); //NOI18N
487: fontSizeValues.add("large"); //NOI18N
488: fontSizeValues.add("X-large"); //NOI18N
489: fontSizeValues.add("XX-large"); //NOI18N
490: fontSizeValues.add("smaller"); //NOI18N
491: fontSizeValues.add("larger"); //NOI18N
492: }
493:
494: static {
495: setCssPropertyNames();
496: setCssLengthUnitNames();
497: setBackgroundRepeatValues();
498: setBackgroundPositionValues();
499: setBackgroundAttachmentValues();
500: setFontStyleValues();
501: setFontVariantValues();
502: setFontWeightValues();
503: setDirectionValues();
504: setTextAlignValues();
505: setTextDecorationValues();
506: setVerticalAlignValues();
507: setPositionValues();
508: setVisiblityValues();
509: setBorderStyleValues();
510: setColorValues();
511: setColorNameHexMap();
512: setWebFontValues();
513: setFontFamilyValues();
514: setFontFamiliySetValues();
515: setFontSizeValues();
516: }
517:
518: /**
519: * Get the names of the supported properties
520: * @return Set of property names.
521: */
522: public static String[] getCssPropertyNames() {
523: return cssPropertyNames.toArray(new String[cssPropertyNames
524: .size()]);
525: }
526:
527: public static String[] getCssPropertyValues(String cssProperty) {
528: if (BACKGROUND_REPEAT.equals(cssProperty)) {
529: return backgroundRepeatValues
530: .toArray(new String[backgroundRepeatValues.size()]);
531: } else if (BACKGROUND_POSITION.equals(cssProperty)) {
532: return backgroundPositionValues
533: .toArray(new String[backgroundPositionValues.size()]);
534: } else if (BACKGROUND_ATTACHMENT.equals(cssProperty)) {
535: return backgroundAttachmentValues
536: .toArray(new String[backgroundAttachmentValues
537: .size()]);
538: } else if (FONT_STYLE.equals(cssProperty)) {
539: return fontStyleValues.toArray(new String[fontStyleValues
540: .size()]);
541: } else if (FONT_VARIANT.equals(cssProperty)) {
542: return fontVariantValues
543: .toArray(new String[fontVariantValues.size()]);
544: } else if (FONT_WEIGHT.equals(cssProperty)) {
545: return fontWeightValues.toArray(new String[fontWeightValues
546: .size()]);
547: } else if (DIRECTION.equals(cssProperty)) {
548: return directionValues.toArray(new String[directionValues
549: .size()]);
550: } else if (TEXT_ALIGN.equals(cssProperty)) {
551: return textAlignValues.toArray(new String[textAlignValues
552: .size()]);
553: } else if (TEXT_DECORATION.equals(cssProperty)) {
554: return textDecorationValues
555: .toArray(new String[textDecorationValues.size()]);
556: } else if (VERTICAL_ALIGN.equals(cssProperty)) {
557: return verticalAlignValues
558: .toArray(new String[verticalAlignValues.size()]);
559: } else if (POSITION.equals(cssProperty)) {
560: return positionValues.toArray(new String[positionValues
561: .size()]);
562: } else if (VISIBILITY.equals(cssProperty)) {
563: return visiblityValues.toArray(new String[visiblityValues
564: .size()]);
565: } else if (BORDER_STYLE.equals(cssProperty)) {
566: return borderStyleValues
567: .toArray(new String[borderStyleValues.size()]);
568: }
569: return new String[0];
570: }
571:
572: public static String[] getCssLengthUnits() {
573: return cssLengthUnits
574: .toArray(new String[cssLengthUnits.size()]);
575: }
576:
577: public static String[] getColorValues() {
578: return colorValues.toArray(new String[colorValues.size()]);
579: }
580:
581: public static Map getColorNameHexMap() {
582: return Collections.unmodifiableMap(colorNameHexMap);
583: }
584:
585: public static String[] getFontFamilyValues() {
586: return fontFamilyValues.toArray(new String[fontFamilyValues
587: .size()]);
588: }
589:
590: public static String[] getWebFontValues() {
591: return webFontValues.toArray(new String[webFontValues.size()]);
592: }
593:
594: public static String[] getFontFamilySetValues() {
595: return fontFamiliySetValues
596: .toArray(new String[fontFamiliySetValues.size()]);
597: }
598:
599: public static String[] getFontSizeValues() {
600: return fontSizeValues
601: .toArray(new String[fontSizeValues.size()]);
602: }
603: }
|