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