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 / Declaration.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: Declaration.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.core.model.SourceReference;
18 import net.sourceforge.phpeclipse.css.core.model.IDeclaration;
19 import net.sourceforge.phpeclipse.css.core.model.IRule;
20
21 import org.eclipse.jface.text.IDocument;
22
23 /**
24  * 
25  */
26 public class Declaration extends SourceReference
27         implements IDeclaration {
28
29         // Instance Variables ------------------------------------------------------
30
31         /**
32          * The rule that contains this declaration.
33          */
34         private IRule rule;
35
36         /**
37          * The part of the declaration that contains the property name.
38          */
39         private ISourceReference property;
40
41         /**
42          * The value part of the declaration.
43          */
44         private ISourceReference value;
45
46         /**
47          * The priority part of the declaration.
48          */
49         private ISourceReference priority;
50
51         // Constructors ------------------------------------------------------------
52
53         /**
54          * Constructor.
55          * 
56          * @param document the document that contains the property
57          * @param rule the rule that contains this property, or <code>null</code> if
58          *        the declaration does not belong to a specific rule 
59          */
60         public Declaration(IDocument document, IRule rule) {
61                 super(document);
62                 this.rule = rule;
63         }
64
65         // IProperty Implementation ------------------------------------------------
66
67         /*
68          * @see IDeclaration#getRule()
69          */
70         public final IRule getRule() {
71                 return rule;
72         }
73
74         /*
75          * @see IDeclaration#getProperty()
76          */
77         public final ISourceReference getProperty() {
78                 return property;
79         }
80
81         /*
82          * @see IDeclaration#getValue()
83          */
84         public final ISourceReference getValue() {
85                 return value;
86         }
87
88         /*
89          * @see IDeclaration#getPriority()
90          */
91         public final ISourceReference getPriority() {
92                 return priority;
93         }
94
95         // Instance Variables ------------------------------------------------------
96
97         /**
98          * Sets the property.
99          * 
100          * @param property The property to set
101          */
102         public final void setProperty(ISourceReference property) {
103                 this.property = property;
104         }
105
106         /**
107          * Sets the value.
108          * 
109          * @param value The value to set
110          */
111         public final void setValue(ISourceReference value) {
112                 this.value = value;
113         }
114
115         /**
116          * Sets the priority.
117          * 
118          * @param priority The priority to set
119          */
120         public final void setPriority(ISourceReference priority) {
121                 this.priority = priority;
122         }
123
124 }