final String[] connectionModes = { "READ", "WRITE", "READ/WRITE" };
_connectionMode =
new ObjectChoiceField(" Connection Mode: ", connectionModes, 2);
// Connection timeout
_timeoutSupported = new CheckboxField(" Support timeouts", false);
_connectionTimeout =
new BasicEditField("Connection timeout: ", "", 6,
BasicEditField.FILTER_INTEGER);
// Connection security settings for tls/ssl
_endToEndRequired =
new CheckboxField(" tls/ssl end to end required", false);
_endToEndDesired =
new CheckboxField(" tls/ssl end to end desired", false);
// Connection retry options
_labelRetriesOpt = new LabelField("Retry options [optional]");
_timeLimit =
new BasicEditField(" Time Limit for Connections: ", "0", 6,
BasicEditField.FILTER_INTEGER);
_attemptsLimit =
new BasicEditField(" Attempts Limit: ", "0", 4,
BasicEditField.FILTER_INTEGER);
_retryFactor =
new BasicEditField(" Retry Factor: ", "0", 6,
BasicEditField.FILTER_INTEGER);
// Transport selection
final String[] transportNames =
{ "none", "TCP Cellular", "Wap", "Wap2", "Mds", "Bis B",
"TCP Wifi" };
// Preferred transport types option
_transportSelection =
new CheckboxField("Preferred Transport Types [Optional]", false);
_transportSelection.setChangeListener(new FieldChangeListener() {
public void fieldChanged(final Field field, final int context) {
if (_transportSelection.getChecked()) {
// Transport selection check box is checked. Enable drop
// downs for choosing the preferred transport.
_order1.setEditable(true);
_order2.setEditable(true);
_order3.setEditable(true);
_order4.setEditable(true);
_order5.setEditable(true);
_order6.setEditable(true);
} else {
// Transport selection check box is not checked. Disable
// drop
// downs for choosing the preferred transport and set them
// to
// "none".
_order1.setSelectedIndex(0);
_order1.setEditable(false);
_order2.setSelectedIndex(0);
_order2.setEditable(false);
_order3.setSelectedIndex(0);
_order3.setEditable(false);
_order4.setSelectedIndex(0);
_order4.setEditable(false);
_order5.setSelectedIndex(0);
_order5.setEditable(false);
_order6.setSelectedIndex(0);
_order6.setEditable(false);
}
}
});
// Initialize preferred transport types option.
// By default disable the options.
_order1 = new ObjectChoiceField("First:", transportNames);
_order1.setEditable(false);
_order2 = new ObjectChoiceField("Second:", transportNames);
_order2.setEditable(false);
_order3 = new ObjectChoiceField("Third:", transportNames);
_order3.setEditable(false);
_order4 = new ObjectChoiceField("Forth:", transportNames);
_order4.setEditable(false);
_order5 = new ObjectChoiceField("Fifth:", transportNames);
_order5.setEditable(false);
_order6 = new ObjectChoiceField("Sixth:", transportNames);
_order6.setEditable(false);
// Initialize disallowed transport types check boxes
_labelDisallowedTrasnports =
new LabelField("Disallowed Transport Types [optional]:");
_disallowDirectTCP = new CheckboxField("TCP Cellular", false);
_disallowWap = new CheckboxField("Wap", false);
_disallowWap2 = new CheckboxField("Wap2", false);
_disallowMds = new CheckboxField("Mds", false);
_disallowBisB = new CheckboxField("Bis B", false);
_disallowWifi = new CheckboxField("TCP Wifi", false);
// Initialize TCP Cellular transport options
_labelTcpCellular = new LabelField("TCP Cellular Options [optional]:");
_tcpApn = new EditField(" APN: ", "");
_tcpApnUser = new EditField(" Username: ", "");
_tcpApnPassword = new EditField(" Password: ", "");
// Initialize WAP transport options
_labelWap = new LabelField("WAP Options [optional]:");
_wapGatewayApn = new EditField(" Gateway APN: ", "");
_wapGatewayIp = new EditField(" Gateway IP: ", "");
_wapGatewayPort = new EditField(" Gateway Port: ", "");
_wapSourceIp = new EditField(" Source IP: ", "");
_wapSourcePort = new EditField(" Source Port: ", "");
_wapUser = new EditField(" Username: ", "");
_wapPassword = new EditField(" Password: ", "");
_wapEnableWTLS = new CheckboxField(" Enable WTLS", false);
// Initialize BisB transport options
_labelBisB = new LabelField("BisB Options [mandatory for BisB]");
_bisBConnectionType = new EditField(" Connection Type: ", "");