KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > core > internal > variables > StringVariable


1 /*******************************************************************************
2  * Copyright (c) 2000, 2007 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.core.internal.variables;
12
13 import org.eclipse.core.runtime.IConfigurationElement;
14 import org.eclipse.core.variables.IStringVariable;
15
16 /**
17  * Common implementation of context and value variables
18  */

19 public abstract class StringVariable implements IStringVariable {
20     
21     /**
22      * Variable name
23      */

24     private String JavaDoc fName;
25     
26     /**
27      * Variable description, or <code>null</code>
28      */

29     private String JavaDoc fDescription;
30     
31     /**
32      * Configuration element associated with this variable, or <code>null</code>
33      */

34     private IConfigurationElement fConfigurationElement;
35
36     /**
37      * Constructs a new variable with the given name, description and configuration element.
38      *
39      * @param name variable name
40      * @param description variable description, or <code>null</code>
41      * @param configurationElement configuration element or <code>null</code>
42      */

43     public StringVariable(String JavaDoc name, String JavaDoc description, IConfigurationElement configurationElement) {
44         fName = name;
45         fDescription = description;
46         fConfigurationElement = configurationElement;
47     }
48     
49     /* (non-Javadoc)
50      * @see org.eclipse.debug.internal.core.stringsubstitution.IStringVariable#getName()
51      */

52     public String JavaDoc getName() {
53         return fName;
54     }
55
56     /* (non-Javadoc)
57      * @see org.eclipse.debug.internal.core.stringsubstitution.IStringVariable#getDescription()
58      */

59     public String JavaDoc getDescription() {
60         return fDescription;
61     }
62     
63     /**
64      * Returns the configuration element associated with this variable, or <code>null</code>
65      * if none.
66      *
67      * @return configuration element or <code>null</code>
68      */

69     protected IConfigurationElement getConfigurationElement() {
70         return fConfigurationElement;
71     }
72     
73     /**
74      * @see IValueVariable#setDescription(String)
75      * @param description
76      */

77     public void setDescription(String JavaDoc description) {
78         fDescription = description;
79     }
80
81 }
82
Popular Tags