private ScControl createFields() {
    AcUspsInternationalSkeletonRouteLegTools x = AcUspsInternationalSkeletonRouteLegTools.instance;

    _blockText = new ScText();
    _blockText.setLabel("Block");
    _blockText.setLabelBold(true);
    _blockText.setBold();

    _contractNumber = new ScDropdownField();
    _contractNumber.setLabel("Contract Number");
    _contractNumber.setDefaultFocus();
    _legNumber = x.newLegNumberField("Leg");
    _departDayOffset = x.newRouteDepartureDayOffsetField("Route Depart Day Offset");
    _listingCarrier = new ScDropdownField();
    _listingCarrier.setLabel("Listing Carrier");
    _listingFlightNumber = x.newFlightNumberField("Listing Flight Number");
    _operatorCarrier = new ScDropdownField();
    _operatorCarrier.setLabel("Operator Carrier");
    _operatorFlightNumber = x.newFlightNumberField("Operator Flight Number");
    _origin = x.newAirportDropdownField("Origin");
    _destination = x.newAirportDropdownField("Destination");
    _depart = x.newDepartureLocalTmField("Depart");
    _arrive = x.newArrivalLocalTmField("Arrive");
    _arriveDayOffset = x.newFlightArrivalDayOffsetField("Arrive Day Offset");
    _stopCount = x.newStopCountField("Stops");
    _daysCheckboxGroup = new ScDayFrequencyCheckboxGroup();
    _daysCheckboxGroup.setLabel("Frequency");
    _equipment = x.newEquipmentDropdownField("Equipment");

    ScContainer c = new ScContainer();
    c.useFieldLayout();
    c.add(_blockText);
    c.add(_contractNumber);
    c.add(_legNumber);
    c.add(_departDayOffset);
    c.add(_listingCarrier);
    c.add(_listingFlightNumber);
    c.add(_operatorCarrier);
    c.add(_operatorFlightNumber);
    c.add(_origin);
    c.add(_destination);
    c.add(_depart);
    c.add(_arrive);
    c.add(_arriveDayOffset);
    c.add(_stopCount);
    c.add(_daysCheckboxGroup);
    c.add(_equipment);
    return c;
  }
  private void save() {
    String webKey = getPageSession().getUspsInternationalSkeletonRouteWebKey();
    Integer routeId =
        AcUspsInternationalSkeletonRouteOfferSummaryVoTools.getRouteIdFromWebKey(webKey);

    AcUspsInternationalSkeletonRouteLeg e;
    e = new AcUspsInternationalSkeletonRouteLeg(getAccountCode());
    e.setUspsInternationalSkeletonRouteId(routeId);
    e.setContractNumber(_contractNumber.getValidSelectedString());
    e.setLegNumber(_legNumber.getValue());
    e.setRouteDepartureDayOffset(_departDayOffset.getValue());
    e.setCarrierCode(_listingCarrier.getSelectedString());
    e.setFlightNumber(_listingFlightNumber.getValue());
    e.setOperatorCarrierCode(_operatorCarrier.getSelectedString());
    e.setOperatorFlightNumber(_operatorFlightNumber.getValue());
    e.setOriginAirportCode(_origin.getSelectedString());
    e.setDestinationAirportCode(_destination.getSelectedString());
    e.setDepartureLocalTm(_depart.getValue());
    e.setArrivalLocalTm(_arrive.getValue());
    e.setFlightArrivalDayOffset(_arriveDayOffset.getValue());
    e.setStopCount(_stopCount.getValue());
    e.setFrequency(_daysCheckboxGroup.getValue());
    e.setEquipmentCode(_equipment.getSelectedString());
    getUspsInternationalSkeletonRouteLegService().insert(e);
  }
  @Override
  protected void createEquipmentCodeField() {
    AcUspsDomesticAcceptanceReportWorkshareContainerTools x =
        AcUspsDomesticAcceptanceReportWorkshareContainerTools.instance;

    String label = "Aircraft";

    if (isAircraftEditable()) {
      _equipmentDropdown = new ScDropdownField();
      _equipmentDropdown.setLabel(label);
      _details.add(_equipmentDropdown);
    } else {
      _equipment = new ScText();
      _equipment.setLabel(label);
      _equipment.setValue(x.getEquipmentCodeAdaptor());
      _equipment.setBold();
      _details.add(_equipment);
    }
  }
  @Override
  protected void preRender(AcUspsDomesticAcceptanceReportWorkshareContainer e) {
    super.preRender(e);

    if (isAircraftEditable()) {
      AcEquipmentTools a = AcEquipmentTools.instance;
      _equipmentDropdown.addSelectOption();
      _equipmentDropdown.addOptions(getEquipment(), a.getCodeAdaptor(), a.getDisplayLabelAdaptor());
      _equipmentDropdown.setSelectedValue(e.getEquipmentCode());
    }

    AcUspsDomesticContainerTools c = AcUspsDomesticContainerTools.instance;
    _containerDropdown.addSelectOption();
    _containerDropdown.addOptions(getContainers(), c.getNameAdaptor(), c.getNameAdaptor());
    _containerDropdown.setSelectedValue(e.getContainer());

    String unit =
        JwUtility.capitalizeFirstLetter(getData().getPreferredDomesticWeightPolicy().getUnit());
    _kilogramsPerContainer.setLabel(unit + "s " + _kilogramsPerContainerLabel);
  }
 @Override
 protected void createContainerField() {
   _containerDropdown = new ScDropdownField();
   _containerDropdown.setLabel("Container");
   _details.add(_containerDropdown);
 }
 @Override
 protected void updateModel(AcUspsDomesticAcceptanceReportWorkshareContainer e) {
   super.updateModel(e);
   if (isAircraftEditable()) e.setEquipmentCode(_equipmentDropdown.getNonGenericSelectedString());
   e.setContainer(_containerDropdown.getNonGenericSelectedString());
 }
  public void preRender() {
    JwList<AcAirport> airports = getInternationalAirports();
    JwList<AcCarrier> carriers = getCarriers();
    JwList<AcEquipment> equipment = getInternationalEquipment();
    JwList<AcUspsInternationalContract> contracts = getInternationalUspsInternationalContracts();

    _origin.clearOptions();
    _origin.addSelectOption();
    _origin.addOptions(airports);

    _destination.clearOptions();
    _destination.addSelectOption();
    _destination.addOptions(airports);

    _equipment.clearOptions();
    _equipment.addSelectOption();
    _equipment.addOptions(equipment);

    AcUspsInternationalContractTools c = AcUspsInternationalContractTools.instance;
    _contractNumber.clearOptions();
    _contractNumber.addSelectOption();
    _contractNumber.addOptions(contracts, c.getNumberAdaptor(), c.getNumberAdaptor());

    AcCarrierTools x = AcCarrierTools.instance;
    _listingCarrier.clearOptions();
    _listingCarrier.addSelectOption();
    _listingCarrier.addOptions(carriers, x.getCodeAdaptor(), x.getDisplayLabelAdaptor());

    _operatorCarrier.clearOptions();
    _operatorCarrier.addSelectOption();
    _operatorCarrier.addOptions(carriers, x.getCodeAdaptor(), x.getDisplayLabelAdaptor());

    _blockText.setValue(getBlockDisplayLabel());
  }