Eclipse Platform
Release 3.0

org.eclipse.core.variables
Interface IValueVariable

All Superinterfaces:
IStringVariable

public interface IValueVariable
extends IStringVariable

A variable with a value that can be set and retrieved. The context in which a value variable is referenced does not effect the value of the variable. A value variable can be contributed by an extension or created programmatically. A contributor may optionally specify an initial value for a variable, or provide a delegate that will initialie the variable with a value.

Example of a value variable contribution with an initial value, the specified variable is created with the initial value "/usr/local/foo".

  <extension point="org.eclipse.core.variables.valueVariables">
   <variable
    name="FOO_HOME"
    initialValue="/usr/local/foo">
   </variable>
  </extension>
 

Example of a value variable contribution with an initializer class, the class "com.example.FooLocator" will be used to initialize the value the first time it's requested.

  <extension point="org.eclipse.core.variables.valueVariables">
   <variable
    name="FOO_HOME"
    initializerClass="com.example.FooLocator">
   </variable>
  </extension>
 

Since:
3.0

Method Summary
 String getValue()
          Returns the value of this variable, or null if none.
 boolean isContributed()
          Returns whether this variable was contributed by an extension.
 void setDescription(String description)
          Sets the description of this variable to the given value.
 void setValue(String value)
          Sets the value of this variable to the given value.
 
Methods inherited from interface org.eclipse.core.variables.IStringVariable
getDescription, getName
 

Method Detail

setValue

public void setValue(String value)
Sets the value of this variable to the given value. A value of null indicates the value of this variable is undefined.

Parameters:
value - variable value, possibly null

getValue

public String getValue()
Returns the value of this variable, or null if none.

Returns:
the value of this variable, or null if none

isContributed

public boolean isContributed()
Returns whether this variable was contributed by an extension.

Returns:
whether this variable was contributed by an extension

setDescription

public void setDescription(String description)
Sets the description of this variable to the given value.

Parameters:
description - variable description, possibly null

Eclipse Platform
Release 3.0

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2004. All rights reserved.