private void setConfigDefaults() {
    try {
      Properties config = Util.getConfig(null);

      for (Comboitem item : portBaudRate.getItems()) {
        if (config.getProperty(Constants.SERIAL_PORT_BAUD).equals(item.getValue())) {
          portBaudRate.setSelectedItem(item);
        }
      }
      portsToScan.setValue(config.getProperty(Constants.SERIAL_PORTS));
      cfgWindOffset.setValue(config.getProperty(Constants.WIND_ZERO_OFFSET));
      String useChoice = config.getProperty(Constants.DNS_USE_CHOICE);
      if (Constants.DNS_USE_BOAT.equals(useChoice)) {
        useHomeGroup.setSelectedItem(useBoatRadio);
      } else {
        useHomeGroup.setSelectedItem(useHomeRadio);
      }
      if (new Boolean(config.getProperty(Constants.PREFER_RMC))) {
        useRmcGroup.setSelectedItem(useRmcRadio);
      } else {
        useRmcGroup.setSelectedItem(useHdgRadio);
      }
    } catch (Exception e) {
      logger.error(e.getMessage(), e);
      Messagebox.show("There has been a problem with loading the configuration:" + e.getMessage());
    }
  }
Example #2
0
 private void fillCombo(final Combobox combo, final Locale curLocale) {
   if (combo.getItemCount() == 0) {
     final Locale currentLocale = UISessionUtils.getCurrentSession().getLocale();
     for (final Locale locale : getPlayerFacade().getAllCountries()) {
       final Comboitem item = new Comboitem(locale.getDisplayCountry(currentLocale));
       item.setValue(locale);
       combo.appendChild(item);
       if (curLocale.getCountry().equals(locale.getCountry())) {
         combo.setSelectedItem(item);
       }
     }
   }
 }