001/*-------------------------------------------------------------------------+
002|                                                                          |
003| Copyright 2005-2011 The ConQAT Project                                   |
004|                                                                          |
005| Licensed under the Apache License, Version 2.0 (the "License");          |
006| you may not use this file except in compliance with the License.         |
007| You may obtain a copy of the License at                                  |
008|                                                                          |
009|    http://www.apache.org/licenses/LICENSE-2.0                            |
010|                                                                          |
011| Unless required by applicable law or agreed to in writing, software      |
012| distributed under the License is distributed on an "AS IS" BASIS,        |
013| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
014| See the License for the specific language governing permissions and      |
015| limitations under the License.                                           |
016+-------------------------------------------------------------------------*/
017package org.conqat.lib.commons.html;
018
019/**
020 * Enumeration of pseudo classes supported.
021 * <p>
022 * List taken from http://www.w3schools.com/css/css_pseudo_classes.asp.
023 * 
024 * @author hummelb
025 */
026public enum ECSSPseudoClass {
027
028        /** Used to indicate the lack of any class. */
029        NONE(""),
030
031        /** Adds special style to an activated element. */
032        ACTIVE(":active"),
033
034        /** Adds special style to an element while the element has focus. */
035        FOCUS(":focus"),
036
037        /** Adds special style to an element when you mouse over it. */
038        HOVER(":hover"),
039
040        /** Adds special style to an unvisited link. */
041        LINK(":link"),
042
043        /** Adds special style to a visited link. */
044        VISITED(":visited"),
045
046        /**
047         * Adds special style to an element that is the first child of some other
048         * element.
049         */
050        FIRST_CHILD(":first-child");
051
052        /** The name of the pseudo class including the colon. */
053        private final String name;
054
055        /** Constructor. */
056        private ECSSPseudoClass(String name) {
057                this.name = name;
058        }
059
060        /** Returns the name of the pseudo class including the leading colon. */
061        public String getName() {
062                return name;
063        }
064
065        /** {@inheritDoc} */
066        @Override
067        public String toString() {
068                return name;
069        }
070}