2 * Copyright (c) 2003-2004 Christopher Lenz and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Common Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/cpl-v10.html
9 * Christopher Lenz - initial API and implementation
11 * $Id: Css2Profile.java,v 1.1 2004-09-02 18:07:14 jsurfer Exp $
14 package net.sourceforge.phpeclipse.css.core.profiles;
16 import net.sourceforge.phpeclipse.css.core.internal.CssCoreMessages;
19 * Implementation of the CSS Level 2 profile
20 * (<a href="http://www.w3.org/TR/CSS2">http://www.w3.org/TR/CSS2</a>).
22 public class Css2Profile extends Css1Profile {
24 // Constants ---------------------------------------------------------------
26 protected static final String CATEGORY_AURAL =
27 CssCoreMessages.getString("CssProfile.category.aural"); //$NON-NLS-1$
28 protected static final String CATEGORY_GENERATED_CONTENT =
29 CssCoreMessages.getString(
30 "CssProfile.category.generatedContent"); //$NON-NLS-1$
31 protected static final String CATEGORY_PAGED_MEDIA =
32 CssCoreMessages.getString(
33 "CssProfile.category.pagedMedia"); //$NON-NLS-1$
34 protected static final String CATEGORY_TABLE =
35 CssCoreMessages.getString("CssProfile.category.table"); //$NON-NLS-1$
36 protected static final String CATEGORY_USER_INTERFACE =
37 CssCoreMessages.getString(
38 "CssProfile.category.userInterface"); //$NON-NLS-1$
39 protected static final String CATEGORY_VISUAL_EFFECTS =
40 CssCoreMessages.getString(
41 "CssProfile.category.visualEffects"); //$NON-NLS-1$
43 // Constructors ------------------------------------------------------------
45 public Css2Profile(IProfileDescriptor descriptor) {
47 initializeAtKeywords();
48 initializeProperties();
49 initializePseudoClasses();
52 // Private Methods ---------------------------------------------------------
54 private void initializeAtKeywords() {
55 addAtKeyword("charset"); //$NON-NLS-1$
56 addAtKeyword("font-face"); //$NON-NLS-1$
57 addAtKeyword("media"); //$NON-NLS-1$
58 addAtKeyword("page"); //$NON-NLS-1$
61 private void initializeProperties() {
62 addProperty("font-stretch", CATEGORY_FONT); //$NON-NLS-1$
63 addProperty("unicode-bidi", CATEGORY_TEXT); //$NON-NLS-1$
64 addProperty("direction", CATEGORY_TEXT); //$NON-NLS-1$
65 addProperty("border-bottom-color", CATEGORY_BOX); //$NON-NLS-1$
66 addProperty("border-bottom-style", CATEGORY_BOX); //$NON-NLS-1$
67 addProperty("border-collapse", CATEGORY_TABLE); //$NON-NLS-1$
68 addProperty("border-left-color", CATEGORY_BOX); //$NON-NLS-1$
69 addProperty("border-left-style", CATEGORY_BOX); //$NON-NLS-1$
70 addProperty("border-right-color", CATEGORY_BOX); //$NON-NLS-1$
71 addProperty("border-right-style", CATEGORY_BOX); //$NON-NLS-1$
72 addProperty("border-top-color", CATEGORY_BOX); //$NON-NLS-1$
73 addProperty("border-top-style", CATEGORY_BOX); //$NON-NLS-1$
74 addProperty("border-spacing", CATEGORY_TABLE); //$NON-NLS-1$
75 addProperty("caption-side", CATEGORY_TABLE); //$NON-NLS-1$
76 addProperty("empty-cells", CATEGORY_TABLE); //$NON-NLS-1$
77 addProperty("table-layout", CATEGORY_TABLE); //$NON-NLS-1$
78 addProperty("bottom", CATEGORY_VISUAL_FORMATTING); //$NON-NLS-1$
79 addProperty("clip", CATEGORY_VISUAL_EFFECTS); //$NON-NLS-1$
80 addProperty("content", CATEGORY_GENERATED_CONTENT); //$NON-NLS-1$
81 addProperty("counter-increment", //$NON-NLS-1$
82 CATEGORY_GENERATED_CONTENT);
83 addProperty("counter-reset", CATEGORY_GENERATED_CONTENT); //$NON-NLS-1$
84 addProperty("azimuth", CATEGORY_AURAL); //$NON-NLS-1$
85 addProperty("cue", CATEGORY_AURAL, true); //$NON-NLS-1$
86 addProperty("cue-after", CATEGORY_AURAL); //$NON-NLS-1$
87 addProperty("cue-before", CATEGORY_AURAL); //$NON-NLS-1$
88 addProperty("cursor", CATEGORY_USER_INTERFACE); //$NON-NLS-1$
89 addProperty("elevation", CATEGORY_AURAL); //$NON-NLS-1$
90 addProperty("left", CATEGORY_VISUAL_FORMATTING); //$NON-NLS-1$
91 addProperty("max-height", CATEGORY_VISUAL_FORMATTING); //$NON-NLS-1$
92 addProperty("max-width", CATEGORY_VISUAL_FORMATTING); //$NON-NLS-1$
93 addProperty("min-height", CATEGORY_VISUAL_FORMATTING); //$NON-NLS-1$
94 addProperty("min-width", CATEGORY_VISUAL_FORMATTING); //$NON-NLS-1$
95 addProperty("orphans", CATEGORY_PAGED_MEDIA); //$NON-NLS-1$
96 addProperty("outline", CATEGORY_USER_INTERFACE); //$NON-NLS-1$
97 addProperty("outline-color", CATEGORY_USER_INTERFACE); //$NON-NLS-1$
98 addProperty("outline-style", CATEGORY_USER_INTERFACE); //$NON-NLS-1$
99 addProperty("outline-width", CATEGORY_USER_INTERFACE); //$NON-NLS-1$
100 addProperty("overflow", CATEGORY_VISUAL_EFFECTS); //$NON-NLS-1$
101 addProperty("page-break-after", CATEGORY_PAGED_MEDIA); //$NON-NLS-1$
102 addProperty("page-break-before", CATEGORY_PAGED_MEDIA); //$NON-NLS-1$
103 addProperty("page-break-inside", CATEGORY_PAGED_MEDIA); //$NON-NLS-1$
104 addProperty("pause", CATEGORY_AURAL, true); //$NON-NLS-1$
105 addProperty("pause-after", CATEGORY_AURAL); //$NON-NLS-1$
106 addProperty("pause-before", CATEGORY_AURAL); //$NON-NLS-1$
107 addProperty("pitch", CATEGORY_AURAL); //$NON-NLS-1$
108 addProperty("pitch-range", CATEGORY_AURAL); //$NON-NLS-1$
109 addProperty("play-during", CATEGORY_AURAL); //$NON-NLS-1$
110 addProperty("position", CATEGORY_VISUAL_FORMATTING); //$NON-NLS-1$
111 addProperty("quotes", CATEGORY_AURAL); //$NON-NLS-1$
112 addProperty("richness", CATEGORY_AURAL); //$NON-NLS-1$
113 addProperty("right", CATEGORY_VISUAL_FORMATTING); //$NON-NLS-1$
114 addProperty("speak", CATEGORY_AURAL, true); //$NON-NLS-1$
115 addProperty("speak-header", CATEGORY_AURAL); //$NON-NLS-1$
116 addProperty("speak-numeral", CATEGORY_AURAL); //$NON-NLS-1$
117 addProperty("speak-punctuation", CATEGORY_AURAL); //$NON-NLS-1$
118 addProperty("speech-rate", CATEGORY_AURAL); //$NON-NLS-1$
119 addProperty("text-shadow", CATEGORY_TEXT); //$NON-NLS-1$
120 addProperty("stress", CATEGORY_AURAL); //$NON-NLS-1$
121 addProperty("top", CATEGORY_VISUAL_FORMATTING); //$NON-NLS-1$
122 addProperty("visibility", CATEGORY_VISUAL_EFFECTS); //$NON-NLS-1$
123 addProperty("voice-family", CATEGORY_AURAL); //$NON-NLS-1$
124 addProperty("volume", CATEGORY_AURAL); //$NON-NLS-1$
125 addProperty("widows", CATEGORY_PAGED_MEDIA); //$NON-NLS-1$
126 addProperty("z-index", CATEGORY_VISUAL_FORMATTING); //$NON-NLS-1$
129 private void initializePseudoClasses() {
130 addPseudoClass("after"); //$NON-NLS-1$
131 addPseudoClass("before"); //$NON-NLS-1$
132 addPseudoClass("first-child"); //$NON-NLS-1$
133 addPseudoClass("focus"); //$NON-NLS-1$
134 addPseudoClass("hover"); //$NON-NLS-1$
135 addPseudoClass("land"); //$NON-NLS-1$
136 addPseudoClass("left"); //$NON-NLS-1$
137 addPseudoClass("right"); //$NON-NLS-1$