KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > core > variables > IValueVariable


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.variables;
12
13 /**
14  * A variable with a value that can be set and retrieved. The context in which
15  * a value variable is referenced does not effect the value of the variable.
16  * A value variable can be contributed by an extension or created programmatically.
17  * A contributor may optionally specify an initial value for a variable, or
18  * provide a delegate that will initialize the variable with a value.
19  * <p>
20  * Since 3.3, a variable can be specified as a "read only" preventing users from changing
21  * the value after it has been initialized. Furthermore, a read only variable that is
22  * contributed by an extension will always load the value from the extension.
23  * </p>
24  * <p>
25  * Example of a value variable contribution with an initial value, the specified
26  * variable is created with the initial value "/usr/local/foo".
27  * <pre>
28  * &lt;extension point="org.eclipse.core.variables.valueVariables"&gt;
29  * &lt;variable
30  * name="FOO_HOME"
31  * initialValue="/usr/local/foo"&gt;
32  * &lt;/variable&gt;
33  * &lt;/extension&gt;
34  * </pre>
35  * </p>
36  * <p>
37  * Example of a value variable contribution with an initializer class, the class
38  * "com.example.FooLocator" will be used to initialize the value the first time
39  * it's requested.
40  * <pre>
41  * &lt;extension point="org.eclipse.core.variables.valueVariables"&gt;
42  * &lt;variable
43  * name="FOO_HOME"
44  * initializerClass="com.example.FooLocator"&gt;
45  * &lt;/variable&gt;
46  * &lt;/extension&gt;
47  * </pre>
48  * </p>
49  * <p>
50  * Clients are not intended to implement this interface.
51  * </p>
52  * @since 3.0
53  */

54 public interface IValueVariable extends IStringVariable {
55
56     /**
57      * Sets the value of this variable to the given value.
58      * Since 3.3, this has no effect if this variable is read only.
59      *
60      * @param value variable value
61      */

62     public void setValue(String JavaDoc value);
63     
64     /**
65      * Returns the value of this variable, or <code>null</code> if none.
66      *
67      * @return the value of this variable, or <code>null</code> if none
68      */

69     public String JavaDoc getValue();
70     
71     /**
72      * Returns whether this variable was contributed by an extension.
73      *
74      * @return whether this variable was contributed by an extension
75      */

76     public boolean isContributed();
77     
78     /**
79      * Returns whether this variable is read only.
80      *
81      * @return whether this variable is read only
82      * @since 3.3
83      */

84     public boolean isReadOnly();
85     
86     /**
87      * Sets the description of this variable to the given value.
88      *
89      * @param description variable description, possibly <code>null</code>
90      */

91     public void setDescription(String JavaDoc description);
92     
93 }
94
Popular Tags