intial source from ttp://www.sf.net/projects/wdte
[phpeclipse.git] / archive / net.sourceforge.phpeclipse.css.core / src / net / sourceforge / phpeclipse / css / core / internal / model / StyleRule.java
1 /*
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
7  * 
8  * Contributors:
9  *     Christopher Lenz - initial API and implementation
10  * 
11  * $Id: StyleRule.java,v 1.1 2004-09-02 18:07:12 jsurfer Exp $
12  */
13
14 package net.sourceforge.phpeclipse.css.core.internal.model;
15
16 import net.sourceforge.phpeclipse.core.model.ISourceReference;
17 import net.sourceforge.phpeclipse.css.core.model.IRule;
18 import net.sourceforge.phpeclipse.css.core.model.IStyleRule;
19 import net.sourceforge.phpeclipse.css.core.model.IStyleSheet;
20
21 import org.eclipse.jface.text.IDocument;
22
23 /**
24  * 
25  */
26 public class StyleRule extends AbstractRule
27         implements IStyleRule {
28
29         // Instance Variables ------------------------------------------------------
30
31         /**
32          * The selector.
33          */
34         private ISourceReference selector;
35
36         // Constructors ------------------------------------------------------------
37
38         /**
39          * Constructor.
40          * 
41          * @param document The document that contains the rule
42          */
43         public StyleRule(IDocument document, IStyleSheet styleSheet) {
44                 this(document, styleSheet, null);
45         }
46
47         /**
48          * Constructor.
49          * 
50          * @param document The document that contains the rule
51          * @param parent The parent rule, or <code>null</code> if the rule is at top
52          *        level
53          */
54         public StyleRule(IDocument document, IStyleSheet styleSheet, IRule parent) {
55                 super(document, styleSheet, parent);
56         }
57
58         // IStyleRule Implementation -----------------------------------------------
59
60         /**
61          * @see IStyleRule#getSelector()
62          */
63         public final ISourceReference getSelector() {
64                 return selector;
65         }
66
67         // Public Methods ----------------------------------------------------------
68
69         public final void setSelector(ISourceReference selector) {
70                 this.selector = selector;
71         }
72
73 }