|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jbbres.lib.actions.tools.elements.SimpleElement com.jbbres.lib.actions.tools.elements.SimpleVariable<C> com.jbbres.lib.actions.tools.elements.RuntimeVariable<C>
C
- - the class of the object that this variable provides when calling
the getValue()
method.public abstract class RuntimeVariable<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.
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 |
---|
public RuntimeVariable(Workflow workflow)
workflow
- - the workflowMethod Detail |
---|
public void setVariableValue(C newValue) throws InvalidVariableValueException
SimpleVariable
setVariableValue
in class SimpleVariable<C>
newValue
- the new variable value
InvalidVariableValueException
- the invalid variable value exceptionpublic final Parameters getParameters()
Element
Element.setParameters(Parameters)
,
Parameters
public final void setParameters(Parameters parameters) throws InvalidParametersException
Element
parameters
- - the parameters. Can be null
InvalidParametersException
- Occurs when the parameters received are incorrect and cannot
be mapped in the element.Element.getParameters()
,
Parameters
public boolean isEditable()
VariableService
setValue(C)
method.
If this methods returns true
, calling the
setValue(C)
method should have no effect.
true
if the value of the variable can be modified by
using the setValue(C)
method. false
otherwise.public javax.swing.table.TableCellEditor getEditor()
Variable
TableCellEditor
used to edit the variable value.
This method is not used in Action(s) 1.0.
public javax.swing.table.TableCellRenderer getRenderer()
Variable
TableCellRenderer
used to render the variable
value.
This method is not used in Action(s) 1.0.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |