Chapter 5. Jolt Aware AWT Beans Class Library Reference

The Jolt aware AWT Beans Class Library provides a Jolt enabled versions of standard AWT components, such as TextField, Label, and List. Using the Jolt aware AWT Beans, you can develop Jolt GUIs with minimal coding.

For information about the JoltBeans toolkit, refer to Chapter 4, "JoltBeans Toolkit Class Library Reference."

The bea.jolt.beans.awt package includes the following classes:

JoltCheckbox Class

java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Checkbox
|
+----bea.jolt.beans.awt.JoltCheckbox

The JoltCheckbox class is a Jolt aware extension of java.awt.Checkbox, that is linked to a specific field in the input buffer by its JoltFieldName property. If the field occurs multiple times, the occurrence this checkbox is linked to is specified by the occurrenceIndex property of this bean.

It can be connected with JoltServiceBeans to contain parts of the input for a service. A JoltServiceBean may listen to events raised by a JoltCheckbox. JoltCheckbox sends JoltInputEvents to its listeners (typically JoltServiceBeans) when the selection in the checkbox changes. The JoltInputEvent in this case is populated with the TrueValue property of data type String (if the box is selected) or FalseValue (if the box is unselected).

JoltCheckbox Constructor

Synopsis

JoltCheckbox()

JoltCheckbox Methods

The following methods are used in conjunction with the JoltCheckbox class:

addJoltInputListener

The addJoltInputListener() method registers JoltInput listeners.

Synopsis

synchronized void addJoltInputListener(JoltInputListener listener)

Parameters

listener
The listener to be added.

Usage

Registers JoltInput listeners.

removeJoltInputListener

The removeJoltInputListener() method unregisters JoltInput listeners.

Synopsis

synchronized void removeJoltInputListener(JoltInputListener listener)

Parameters

listener
The listener to be removed.

Usage

Unregisters JoltInput listeners.

setOccurrenceIndex

The setOccurrenceIndex() method sets the occurrence index of the field represented by this JoltCheckbox.

Synopsis

void setOccurrenceIndex(int occurrence)

Parameters

occurrence
The occurrence number.

Usage

Sets the occurrence index of the field represented by this JoltCheckbox.

getOccurrenceIndex

The getOccurrenceIndex() method gets the occurrence index of the field represented by this JoltCheckbox.

Synopsis

int getOccurrenceIndex()

Usage

Get the occurrence index of the field represented by this JoltCheckbox.

getJoltFieldName

The getJoltFieldName() method gets the Jolt field name corresponding to this JoltCheckbox.

Synopsis

String getJoltFieldName()

Usage

Gets the Jolt field name corresponding to this JoltCheckbox.

Returns

the Jolt field name

setJoltFieldName

The setJoltFieldName() method sets the Jolt field name corresponding to this JoltCheckbox.

Synopsis

void setJoltFieldName(String name)

Parameters

name
The Jolt field name.

Usage

Sets the Jolt field name corresponding to this JoltCheckbox.

getTrueValue

The getTrueValue() method returns the String value that is represented by this JoltCheckbox if the box is checked.

Synopsis

String getTrueValue()

Usage

Gets the field value represented by this JoltCheckbox if the box is checked.

Returns

The true value.

setTrueValue

The setTrueValue() method sets the String value that is represented by this JoltCheckbox if the box is checked.

Synopsis

void setTrueValue(String value)

Parameters

value
The true value.

Usage

Sets the field value that is represented by this JoltCheckbox if the box is checked.

getFalseValue

The getFalseValue() method gets the field value represented by this JoltCheckbox if the box is unchecked.

Synopsis

String getFalseValue()

Usage

Gets the field value if the box is unchecked.

Returns

The false value represented by this JoltCheckbox.

setFalseValue

The setFalseValue() method sets the field value that is represented by this JoltCheckbox if the box is unchecked.

Synopsis

void setFalseValue(String value)

Parameters

value
The false value

Usage

Sets the field value that is represented by this JoltCheckbox if the box is unchecked.

JoltChoice Class

java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Choice
|
+----bea.jolt.beans.awt.JoltChoice

The JoltChoice class provides a Jolt aware extension of java.awt.Choice that is linked to a specific field in the input buffer by its JoltFieldName property. If the field occurs multiple times, the occurrence this choice is linked to is specified by the occurrenceIndex property of this bean.

It can be connected with JoltServiceBeans to contain parts of the input for a service. A JoltServiceBean may listen to events raised by a JoltChoice. JoltChoice sends JoltInputEvents to its listeners (typically JoltServiceBeans) when the selection in the choice changes. The JoltInputEvent in this case is populated with the single value of the selected item.

JoltChoice Constructor

Synopsis

JoltChoice()

JoltChoice Methods

The following methods are used in conjunction with the JoltChoice class:

addJoltInputListener

The addJoltInputListener() method registers JoltInput listeners.

Synopsis

synchronized void addJoltInputListener(JoltInputListener listener)

Parameters

listener
The listener to be added.

Usage

Registers JoltInput listeners.

removeJoltInputListener

The removeJoltInputListener() method unregisters JoltInput listeners.

Synopsis

synchronized void removeJoltInputListener(JoltInputListener listener)

Parameters

listener
The listener to be removed.

Usage

Unregisters JoltInput listeners.

setOccurrenceIndex

The setOccurrenceIndex() method sets the occurrence index of the field represented by this JoltChoice.

Synopsis

void setOccurrenceIndex(int occurrence)

Parameters

occurrence
The occurrence number.

Usage

Sets the occurrence index of the field represented by this JoltChoice.

getOccurrenceIndex

The getOccurrenceIndex() method gets the occurrence index of the field represented by this JoltChoice.

Synopsis

int getOccurrenceIndex()

Usage

Gets the occurrence index of the field represented by this JoltChoice.

getJoltFieldName

The getJoltFieldName() method gets the field name corresponding to the field represented by this JoltChoice.

Synopsis

String getJoltFieldName()

Usage

Gets the Jolt field name corresponding to this choice.

Returns

The Jolt field name

setJoltFieldName

The setJoltFieldName() method sets the field name (Jolt field name) corresponding to this Choice.

Synopsis

void setJoltFieldName(String name)

Parameters

name
The Jolt field name.

Usage

Sets the Jolt field name corresponding to the field represented by this JoltChoice.

getItems

The getItems() method gets the selected items corresponding to the field represented by this JoltChoice.

Synopsis

String[] getItems()

Usage

Gets the selected items corresponding to this choice.

Returns

The array of selected items.

setItems

The setItems() method sets the selected items corresponding to the field represented by this JoltChoice.

Synopsis

void setItems(String values[])

Parameters

name
The Jolt field name

Usage

Sets the selected items corresponding to this JoltChoice.

JoltLabel Class

java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Label
|
+----bea.jolt.beans.awt.JoltLabel

A Jolt aware extension of java.awt.Label that is linked to a specific field in the output buffer by its JoltFieldName property. If the field occurs multiple times, the occurrence this label is linked to is specified by the occurrenceIndex property of this bean. JoltLabel can be connected with JoltServiceBeans to display output from a service. A JoltLabel listens to JoltOutputEvents from JoltServiceBeans and updates its contents according to the occurrences of the field to which it is linked.

JoltLabel Constructor

JoltLabel()

JoltLabel Methods

The following methods are used in conjunction with the JoltLabel class:

serviceReturned

The serviceReturned() method is the event handler for JoltOutputEvents.

Synopsis

void serviceReturned(JoltOutputEvent evt)

Parameters

evt
The event object.

Usage

Event handler for JoltOutputEvents. This should not be called directly; it is always called by the JoltServiceBean.

setOccurrenceIndex

The setOccurrenceIndex() method sets the occurrence index of the field represented by this JoltLabel.

Synopsis

void setOccurrenceIndex(int occurrence)

Parameters

occurrence
The occurrence number.

Usage

Sets the occurrence index of this field.

getOccurrenceIndex

The getOccurrenceIndex() method gets the occurrence index of the field represented by this JoltLabel.

Synopsis

int getOccurrenceIndex()

Usage

Gets the occurrence index of this field.

getJoltFieldName

The getJoltFieldName() method gets the Jolt field name corresponding to this Label.

Synopsis

String getJoltFieldName()

Usage

Gets the Jolt field name corresponding to this JoltLabel.

Returns

The Jolt field name.

setJoltFieldName

The setJoltFieldName() method sets the Jolt field name corresponding to this Label.

Synopsis

void setJoltFieldName(String name)

Parameters

name
The Jolt field name

Usage

Sets the Jolt field name corresponding to this JoltLabel.

JoltList Class

java.lang.Object
|
+----java.awt.Component
|
+----java.awt.List
|
+----bea.jolt.beans.awt.JoltList

A Jolt aware extension of java.awt.TextField that is linked to a specific field in the Jolt input or output buffer by its JoltFieldName property. If the field occurs multiple times, the occurrence this textfield is linked to is specified by the occurrenceIndex property of this bean.

JoltTextField can be connected with JoltServiceBeans in two ways:

JoltList Methods

The following methods are used in conjunction with the JoltList class:

serviceReturned

The serviceReturned() method is the event handler for JoltOutputEvents.

Synopsis

void serviceReturned(JoltOutputEvent evt)

Parameters

evt
The event object.

Usage

Event handler for JoltOutputEvents. This method should not be called directly. It is always called by the JoltServiceBean.

addJoltInputListener

The addJoltInputListener() method registers JoltInput listeners.

Synopsis

synchronized void addJoltInputListener(JoltInputListener l)

Parameters

l
The listener to be added.

Usage

Registers JoltInput listeners.

removeJoltInputListener

The removeJoltInputListener() method unregisters JoltInput listeners.

Synopsis

synchronized void removeJoltInputListener(JoltInputListener l)

Parameters

l
The listener to be removed

Usage

Unregisters JoltInput listeners.

getJoltFieldName

The getJoltFieldName() method gets the Jolt field name corresponding to this JoltList.

Synopsis

String getJoltFieldName()

Usage

Gets the Jolt field name corresponding to this JoltList.

Returns

The Jolt field name.

setJoltFieldName

The setJoltFieldName() method sets the Jolt field name corresponding to this JoltList.

Synopsis

void setJoltFieldName(String name)

Parameters

name
The Jolt field name.

Usage

Sets the Jolt field name corresponding to this JoltList.

setOccurrenceIndex

The setOccurrenceIndex() method sets the occurrence index of the field represented by this JoltList.

Synopsis

void setOccurrenceIndex(int occurrence)

Parameters

occurrence
The occurrence number.

Usage

Sets the occurrence index of this field.

getOccurrenceIndex

The getOccurrenceIndex() method gets the occurrence index of the field represented by this JoltList.

Synopsis

int getOccurrenceIndex()

Usage

Gets the occurrence index of this field.

JoltTextField Class

java.lang.Object
|
+----java.awt.Component
|
+----java.awt.TextComponent
|
+----java.awt.TextField
|
+----bea.jolt.beans.awt.JoltTextField

A Jolt aware extension of java.awt.TextField that is linked to a specific field in the Jolt buffer by its JoltFieldName property. If the field occurs multiple times, the occurrence this textfield is linked to is specified by the occurrenceIndex property of this bean.

JoltTextField can be connected with JoltServiceBeans in two ways:

JoltTextField Constructor

The JoltTextField constructor creates an instance of the JoltTextField.

JoltTextField Methods

The following methods are used in conjunction with the JoltTextField class:

addJoltInputListener

The addJoltInputListener() method registers JoltInput listeners.

Synopsis

synchronized void addJoltInputListener(JoltInputListener l)

Parameters

l
The listener to be added

Usage

Registers JoltInput listeners.

removeJoltInputListener

The removeJoltInputListener() method unregisters JoltInput listeners.

Synopsis

synchronized void removeJoltInputListener(JoltInputListener l)

Parameters

l
The listener to be removed.

Usage

Unregisters JoltInput listeners.

serviceReturned

The serviceReturned() method is the handler method for JoltOutputEvents.

Synopsis

void serviceReturned(JoltOutputEvent evt)

Parameters

evt
The event object.

Usage

Handler method for JoltOutputEvents. This method should not be called directly. It is always called by the JoltServiceBean.

getJoltFieldName

The getJoltFieldName() method gets the field name corresponding to this JoltTextField.

Synopsis

String getJoltFieldName()

Usage

Gets the Jolt field name corresponding to this JoltTextField.

Returns

The Jolt field name.

setJoltFieldName

The setJoltFieldName() method sets the field name corresponding to this JoltTextField.

Synopsis

void setJoltFieldName(String name)

Parameters

name
The Jolt field name.

Usage

Sets the Jolt field name corresponding to this JoltTextField.

setOccurrenceIndex

The setOccurrenceIndex() method sets the occurrence index of the field represented by this JoltTextField.

Synopsis

void setOccurrenceIndex(int occurrence)

Parameters

occurrence
The occurrence number.

Usage

Sets the occurrence index of this field.

getOccurrenceIndex

The getOccurrenceIndex() method gets the occurrence index of the field represented by this JoltTextField.

Synopsis

int getOccurrenceIndex()

Usage

Gets the occurrence index of this field.