To open the Interaction Wizard Editor, do one of the following:
For example, if you wanted to edit the ChartWrapper component, you would type in the following:
borland.jbcl.appletwrappers.barchart.ChartWrapper
.
For example, for the ChartWrapper component, the Interaction Wizard Editor would find six different event sets, because ChartWrapper, or its superclasses, expose those six addXxxxListener() methods.
To make all of the events of an event set visible in the Interaction Wizard, check This event set exposed to interactions:. This checkbox toggles the state of the event set between being visible or not visible in the Interaction Wizard. When a green dot appears beside an event set name, its event methods are visible in the Interaction Wizard.
adapter FOCUS_EVENTS java.awt.event.FocusListener { "Got focus" focusGained(FocusEvent) "Lost focus" focusLost(FocusEvent) }
In the example shown here of FOCUS_EVENT, the associated event interface is java.awt.event.FocusListener. It has two events that can be generated, with proposed descriptions of "Got focus" and "Lost focus".
You can modify the name of the event set, as it will be seen in this editor, and the descriptions of the individual events, as they will be seen in this editor and in the Interaction Wizard.
To change the name of an event set, click on it, type the new name in the Description box, and click the Change button. For example, for the ChartWrapper component, click on the event set FOCUS_EVENT, and then type a new event set name (such as CHART_FOCUS_EVENTS) in the Description field, and then click Change. The screen in this example would now look like this:
To change the description for a particular event within the event set, select the event, enter a new description in the Description text field, then click the Change button. For example, on the ChartWrapper, select the "Got focus" event, and in the Description text field, enter "The chart got focus" and click Change. The screen in this example would now look like this:
Note that the checkbox labeled This event set exposed to interactions: is disabled when the selected item is an event. This is because you can only expose or hide a whole event set, not the individual events.
If you had changed the event wording without changing the event set, then this change would have been propagated to all components using that same event set.
With the two changes in the above example, Interaction Wizard Editor would generate a new event set in interactions.ini that would look like this:
adapter CHART_FOCUS_EVENTS java.awt.event.FocusListener { "The Chart Got focus" focusGained(FocusEvent) "Lost Focus" focusLost(FocusEvent) }
The Interaction Wizard Editor uses introspection on the component to obtain a list of its public methods. It then presents the list to you, so you can selectively choose which methods to make visible in the Interaction Wizard, and which methods to hide. Those methods are listed by declaring classes.
To expose some methods specific to a class, such as the borland.jbcl.appletwrappers.barchart.ChartWrapperclass, click on the class name and the screen below should appear:
Click on the arrow by the class name to see its public methods.
As the selected method is promoted to being exposed, it is automatically moved on top of the tree, just below "Actions". This allows you to quickly spot, and work on, exposed methods. Note that if from this point you chose to NOT expose the method, it won't go back to where it was. This allows you to easily toggle from exposed to not exposed without losing the method.
new ClassName()
). Whatever you put here will be proposed to the user of the Interaction Wizard as the value for this parameter. The user may edit this, if necessary, unless you make the parameter read-only.
You can edit the expression by invoking the Expression Assistant. Click the ellipsis button at the
right of the Expression text field, and the Expression Assistant will appear.
When you're finished editing the expression, click the OK button on the Expression Assistant to commit the changes and return to the Interaction Wizard Editor. Notice that the Interaction Wizard Editor now displays the new value in the Expression field of Step 3.
You could have entered that same expression directly into the Expression field, provided you know the correct syntax.
When you are finished with Step 3, click the Finish button to validate all the changes and store them in the Interaction Wizard knowledge base.
Step 4 proposes the correct wording and default value.
The code that would be generated in interactions.ini for this component is as follows:
adapter CHART_FOCUS_EVENTS java.awt.event.FocusListener { "The chart got focus" focusGained(FocusEvent) "Lost Focus" focusLost(FocusEvent) }
component borland.jbcl.appletwrappers.barchart.ChartWrapper generates CHART_FOCUS_EVENTS { "Set the value for Q2" void "setc2_label(java.lang.String #Value for Q2# = 100)" }