mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 13:02:06 -08:00
UI: added start selection value on choice dialog popup;
This commit is contained in:
parent
2d9fa97808
commit
e4dfa5925b
3 changed files with 42 additions and 1 deletions
|
|
@ -61,6 +61,7 @@ public interface Choice {
|
|||
Map<String,String> getKeyChoices();
|
||||
void setChoiceByKey(String choiceKey);
|
||||
String getChoiceKey();
|
||||
String getChoiceValue();
|
||||
|
||||
// search
|
||||
boolean isSearchEnabled();
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue