/** storeUIFieldsToCitation - transfer the UI field values to the citation record */ private void storeUIFieldsToCitation() { String accidentStatus = field_accident.getChecked() ? "true" : "false"; String radarStatus = field_radar.getChecked() ? "true" : "false"; String jailStatus = field_jail_booking.getChecked() ? "true" : "false"; String pacedStatus = field_paced.getChecked() ? "true" : "false"; String schoolStatus = field_school_zone.getChecked() ? "true" : "false"; String alcoholStatus = field_alcohol.getChecked() ? "true" : "false"; c.Violation.setElement(CViolation.ACCIDENT, accidentStatus); c.Violation.setElement(CViolation.RADAR, radarStatus); c.Violation.setElement(CViolation.JAIL_BOOKING, jailStatus); c.Violation.setElement(CViolation.PACED, pacedStatus); c.Violation.setElement(CViolation.SCHOOL_ZONE, schoolStatus); c.Violation.setElement(CViolation.ALCOHOL, alcoholStatus); c.Violation.setElement(CViolation.VBFI, field_vbfi.getText()); c.Violation.setElement(CViolation.SPEED_LIMIT, field_speed_limit.toString()); c.Violation.setElement(CViolation.ALLEGED_SPEED, field_alleged_speed.getText()); }
private void add() { // validate input.. if (nameTxt.getText().equals("") || nameTxt.getText() == null && urlTxt.getText().equals("") || urlTxt.getText() == null) { // invalid input.. Dialog.alert("Enter Feed Name and URL"); } else { // get the new feed name and url String feedName = nameTxt.getText(); String feedUrl = urlTxt.getText(); if (feedUrl.indexOf("http://") == -1) { Dialog.alert("Feed URL must begin with http://"); } else { // create new Feed object/store it at same time Feed newFeed = new Feed(feedName, feedUrl); databaseManager.getFeeds().addElement(newFeed); // add the new Feed to the end of the feeds list list.insert(list.getSize()); FeedsListCallback callback = (FeedsListCallback) list.getCallback(); callback.insert(newFeed); // close dialog.. close(); } } }
public String getText() { return editField.getText(); }