com.jbbres.lib.actions.tools.elements
Class RuntimeVariable<C>

java.lang.Object
  extended by com.jbbres.lib.actions.tools.elements.SimpleElement
      extended by com.jbbres.lib.actions.tools.elements.SimpleVariable<C>
          extended by com.jbbres.lib.actions.tools.elements.RuntimeVariable<C>
Type Parameters:
C - - the class of the object that this variable provides when calling the getValue() method.
All Implemented Interfaces:
Element, ElementService, Variable, VariableService

public abstract class RuntimeVariable<C>
extends SimpleVariable<C>

This abstract class provides default implementations for most of the methods in the Variable interface.

Subclasses of RuntimeVariable must be created if you are willing to create your personalized runtime variable. A runtime variable is a variable that can store specific data used by your application and/or actions. Note that runtime variables are not editable: they provide a value that is not stored nor managed by Action(s) and whose has it own life cycle. Its value can be static (for example the path to the user’s picture folder) or dynamic (for example the result of an SQL request on a database).

RuntimeVariable is a parameterized abstract class with a single type variable, representing the type of object that the variable provides when calling the VariableService.getValue() method.

For example, if your variable provides a file object (File), the content of your variable class file will look like the following example:

 package packageName;
 
 import java.io.File;
 import com.jbbres.lib.actions.tools.elements.RuntimeVariable;
 import com.jbbres.lib.actions.workflow.Workflow;
 
 public class VRuntime extends RuntimeVariable<File> {
 
        public VRuntime(Workflow workflow) {
                super(workflow);
        }
 
        public File getValue() {
                return new File("my file path");
        }
 }
 
 
The getValue() method should returns the content of the variable. As described previously, it can be a static or a dynamic. The getValue() method is called every time the user try to access to the variable by adding a “Get Variable Value�? action in its workflow. Its results are passed as an input to the next action.

Since:
1.0.0
Version:
1.0.0
Author:
Jean-Baptiste Bres

Constructor Summary
RuntimeVariable(Workflow workflow)
          Instantiates a new run time variable.
 
Method Summary
 javax.swing.table.TableCellEditor getEditor()
          Returns the TableCellEditor used to edit the variable value.
 Parameters getParameters()
          Returns the state of the element.
 javax.swing.table.TableCellRenderer getRenderer()
          Returns the TableCellRenderer used to render the variable value.
 boolean isEditable()
          Defines if the value of the variable can be modified by using the setValue(C) method.
 void setParameters(Parameters parameters)
          Sets the current state of the element.
 void setVariableValue(C newValue)
          Sets the variable value.
 
Methods inherited from class com.jbbres.lib.actions.tools.elements.SimpleVariable
addVariableServiceListener, fireVariableInstanceNameChanges, fireVariableValueChanges, getDescription, getInstanceName, getService, getVariableListeners, isValidValueClass, removeVariableServiceListener, setInstanceName, setValue, valueClass
 
Methods inherited from class com.jbbres.lib.actions.tools.elements.SimpleElement
getWorkflow
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.jbbres.lib.actions.elements.VariableService
getValue
 

Constructor Detail

RuntimeVariable

public RuntimeVariable(Workflow workflow)
Instantiates a new run time variable.

Parameters:
workflow - - the workflow
Method Detail

setVariableValue

public void setVariableValue(C newValue)
                      throws InvalidVariableValueException
Description copied from class: SimpleVariable
Sets the variable value.

Specified by:
setVariableValue in class SimpleVariable<C>
Parameters:
newValue - the new variable value
Throws:
InvalidVariableValueException - the invalid variable value exception

getParameters

public final Parameters getParameters()
Description copied from interface: Element
Returns the state of the element.

Returns:
the current state of the element.
See Also:
Element.setParameters(Parameters), Parameters

setParameters

public final void setParameters(Parameters parameters)
                         throws InvalidParametersException
Description copied from interface: Element
Sets the current state of the element.

Parameters:
parameters - - the parameters. Can be null
Throws:
InvalidParametersException - Occurs when the parameters received are incorrect and cannot be mapped in the element.
See Also:
Element.getParameters(), Parameters

isEditable

public boolean isEditable()
Description copied from interface: VariableService
Defines if the value of the variable can be modified by using the setValue(C) method.

If this methods returns true, calling the setValue(C) method should have no effect.

Returns:
true if the value of the variable can be modified by using the setValue(C) method. false otherwise.

getEditor

public javax.swing.table.TableCellEditor getEditor()
Description copied from interface: Variable
Returns the TableCellEditor used to edit the variable value.

This method is not used in Action(s) 1.0.

Returns:
the editor

getRenderer

public javax.swing.table.TableCellRenderer getRenderer()
Description copied from interface: Variable
Returns the TableCellRenderer used to render the variable value.

This method is not used in Action(s) 1.0.

Returns:
the renderer


To file bugs or suggest feature enhancements, visit the app.jbbres.com Bug Reporter website.

Additional documentation available online at http://app.jbbres.com/actions/developers.

Copyright � 2009-2011 app.jbbres.com. All Rights Reserved.