KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > w3c > css > sac > Selector


1 /*
2  * Copyright (c) 1999 World Wide Web Consortium,
3  * (Massachusetts Institute of Technology, Institut National de
4  * Recherche en Informatique et en Automatique, Keio University). All
5  * Rights Reserved. This program is distributed under the W3C's Software
6  * Intellectual Property License. This program is distributed in the
7  * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
8  * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
9  * PURPOSE.
10  * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
11  *
12  * $Id: Selector.java,v 1.1.1.1 2003/12/28 21:23:53 davidsch Exp $
13  */

14 package org.w3c.css.sac;
15
16 /**
17  * This interface defines a selector.
18  * <p><b>Remarks</b>: Not all the following selectors are supported (or will be
19  * supported) by CSS.
20  * <p>All examples are CSS2 compliant.
21  *
22  * @version $Revision: 1.1.1.1 $
23  * @author Philippe Le Hegaret
24  */

25 public interface Selector {
26     
27     /* simple selectors */
28
29     /**
30      * This is a conditional selector.
31      * example:
32      * <pre class="example">
33      * simple[role="private"]
34      * .part1
35      * H1#myId
36      * P:lang(fr).p1
37      * </pre>
38      *
39      * @see ConditionalSelector
40      */

41     public static final short SAC_CONDITIONAL_SELECTOR = 0;
42
43     /**
44      * This selector matches any node.
45      * @see SimpleSelector
46      */

47     public static final short SAC_ANY_NODE_SELECTOR = 1;
48
49     /**
50      * This selector matches the root node.
51      * @see SimpleSelector
52      */

53     public static final short SAC_ROOT_NODE_SELECTOR = 2;
54
55     /**
56      * This selector matches only node that are different from a specified one.
57      * @see NegativeSelector
58      */

59     public static final short SAC_NEGATIVE_SELECTOR = 3;
60
61     /**
62      * This selector matches only element node.
63      * example:
64      * <pre class="example">
65      * H1
66      * animate
67      * </pre>
68      * @see ElementSelector
69      */

70     public static final short SAC_ELEMENT_NODE_SELECTOR = 4;
71
72     /**
73      * This selector matches only text node.
74      * @see CharacterDataSelector
75      */

76     public static final short SAC_TEXT_NODE_SELECTOR = 5;
77
78     /**
79      * This selector matches only cdata node.
80      * @see CharacterDataSelector
81      */

82     public static final short SAC_CDATA_SECTION_NODE_SELECTOR = 6;
83
84     /**
85      * This selector matches only processing instruction node.
86      * @see ProcessingInstructionSelector
87      */

88     public static final short SAC_PROCESSING_INSTRUCTION_NODE_SELECTOR = 7;
89
90     /**
91      * This selector matches only comment node.
92      * @see CharacterDataSelector
93      */

94     public static final short SAC_COMMENT_NODE_SELECTOR = 8;
95     /**
96      * This selector matches the 'first line' pseudo element.
97      * example:
98      * <pre class="example">
99      * :first-line
100      * </pre>
101      * @see ElementSelector
102      */

103     public static final short SAC_PSEUDO_ELEMENT_SELECTOR = 9;
104
105     /* combinator selectors */
106
107     /**
108      * This selector matches an arbitrary descendant of some ancestor element.
109      * example:
110      * <pre class="example">
111      * E F
112      * </pre>
113      * @see DescendantSelector
114      */

115     public static final short SAC_DESCENDANT_SELECTOR = 10;
116
117     /**
118      * This selector matches a childhood relationship between two elements.
119      * example:
120      * <pre class="example">
121      * E > F
122      * </pre>
123      * @see DescendantSelector
124      */

125     public static final short SAC_CHILD_SELECTOR = 11;
126     /**
127      * This selector matches two selectors who shared the same parent in the
128      * document tree and the element represented by the first sequence
129      * immediately precedes the element represented by the second one.
130      * example:
131      * <pre class="example">
132      * E + F
133      * </pre>
134      * @see SiblingSelector
135      */

136     public static final short SAC_DIRECT_ADJACENT_SELECTOR = 12;
137
138     /**
139      * An integer indicating the type of <code>Selector</code>
140      */

141     public short getSelectorType();
142
143 }
144
Popular Tags