UI: added start selection value on choice dialog popup;

This commit is contained in:
Oleg Agafonov 2017-12-28 22:38:18 +04:00
parent 2d9fa97808
commit e4dfa5925b
3 changed files with 42 additions and 1 deletions

View file

@ -61,6 +61,7 @@ public interface Choice {
Map<String,String> getKeyChoices();
void setChoiceByKey(String choiceKey);
String getChoiceKey();
String getChoiceValue();
// search
boolean isSearchEnabled();

View file

@ -149,12 +149,22 @@ public class ChoiceImpl implements Choice, Serializable {
return choiceKey;
}
@Override
public String getChoiceValue() {
if ((keyChoices != null) && (keyChoices.containsKey(choiceKey))){
return keyChoices.get(choiceKey);
}else{
return null;
}
}
@Override
public void setChoiceByKey(String choiceKey) {
String choiceToSet = keyChoices.get(choiceKey);
if (choiceToSet != null) {
this.choice = choiceToSet;
this.choiceKey = choiceKey;
this.chosen = true;
}
}