Пример #1
0
  private JComboBox createTimeUnitCombo(boolean enableManualTimeControls) {
    JComboBox timeUnitCombo = new JComboBox(TIME_UNIT_OPTIONS);
    timeUnitCombo.setName(TIME_UNIT_COMBO_NAME);
    timeUnitCombo.setEnabled(enableManualTimeControls);

    TimeUnitConfig.Enum timeUnit = profile.getManualAccessTokenExpirationTimeUnit();
    timeUnitCombo.setSelectedItem(WordUtils.capitalize(timeUnit.toString().toLowerCase()));

    return timeUnitCombo;
  }
Пример #2
0
 public TimeUnitConfig.Enum getAccessTokenExpirationTimeUnit() {
   String timeUnitString = timeUnitCombo.getSelectedItem().toString().toUpperCase();
   return TimeUnitConfig.Enum.forString(timeUnitString);
 }