If you want to reconfigure timer settings dynamically, you must use TimerControlBean instead of the basic TimerControl interface.
TimerControlBean provides additional methods to programmatically get/set all of the parameter values displayed on the Properties view.
Using the TimerControlBean
When you use the Insert > Control command to create a timer control, the default annotation that is inserted uses the TimerControl interface.
@Control private TimerControl timerControl;
To use TimerControlBean instead, simply change TimerControl to TimerControlBean in the timer control declaration line. This will cause an error marker to appear in the marker bar on the class declaration line because TimerControlBean requires an additional import. Right click on the error marker and choose Quick Fix. The Quick Fix pull-down will appear:
click on Import 'TimerControlBean' and press Enter. A new import line
import com.bea.control.TimerControlBean;
TimerControlBean implements the TimerControl interface and also defines the following additional methods to get/set timer properties to get/set the property values:
|
||||||||||||||||||||||||||||
Note that the setTimerSettingxxx methods have no effect if the timer is already started. To set values, you must stop the timer, call the method to set the value, and start the timer. This will not create a new timer object, but will simply restart the existing control.
The getTimerSettingxxx methods work whether the timer is running or stopped.