});
_autoStartEnabled =
new CheckboxField("Auto-start when message arrives", true);
final FullWidthButton backButton = new FullWidthButton("Back");
backButton.setChangeListener(new FieldChangeListener() {
/**
* @see FieldChangeListener#fieldChanged(Field, int)
*/
public void fieldChanged(final Field field, final int context) {
((UiApplication) ReceivePushScreen.this.getApplication())
.popScreen(ReceivePushScreen.this);
}
});
final FullWidthButton startButton =
new FullWidthButton("Start Receiver");
startButton.setChangeListener(new FieldChangeListener() {
/**
* @see FieldChangeListener#fieldChanged(Field, int)
*/
public void fieldChanged(final Field field, final int context) {
if (_isBlocking.getChecked()) {
// Blocking receiver
controller.startBlockingReceiverBES(_uriReceiverField
.getText(), _autoStartEnabled.getChecked(),
CommunicationController.TIMEOUT);
} else {
// Non blocking receiver
controller.startNonBlockingReceiverBES(_uriReceiverField
.getText(), _autoStartEnabled.getChecked());
}
}
});
final FullWidthButton pauseButton =
new FullWidthButton("Pause Receiver");
pauseButton.setChangeListener(new FieldChangeListener() {
/**
* @see FieldChangeListener#fieldChanged(Field, int)
*/
public void fieldChanged(final Field field, final int context) {
controller.pauseReceiver(_uriReceiverField.getText());
}
});
final FullWidthButton resumeButton =
new FullWidthButton("Resume Receiver");
resumeButton.setChangeListener(new FieldChangeListener() {
/**
* @see FieldChangeListener#fieldChanged(Field, int)
*/
public void fieldChanged(final Field field, final int context) {
controller.resumeReceiver(_uriReceiverField.getText());
}
});
final FullWidthButton releaseButton =
new FullWidthButton("Release Receiver");
releaseButton.setChangeListener(new FieldChangeListener() {
/**
* @see FieldChangeListener#fieldChanged(Field, int)
*/
public void fieldChanged(final Field field, final int context) {
controller.releaseReceiver(_uriReceiverField.getText());
}
});
final FullWidthButton destroyButton =
new FullWidthButton("Destroy Receiver");
destroyButton.setChangeListener(new FieldChangeListener() {
/**
* @see FieldChangeListener#fieldChanged(Field, int)
*/
public void fieldChanged(final Field field, final int context) {
controller.destroyReceiver(_uriReceiverField.getText());