Button startButton = new Button(text.toString());
startButton.setStyleName("Default");
startButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
InteractiveApp app = (InteractiveApp)getApplicationInstance();
GhostTask ghostTask = new GhostTask();
ghostTask.setClicksPerIteration(clicksPerIteration);
if (runTimeInSeconds > 0) {
ghostTask.setRunTime(runTimeInSeconds * 1000);
}
app.startGhostTask(ghostTask, callbackInterval);
}
});
add(startButton);