mirror of
https://github.com/correl/mage.git
synced 2025-03-12 17:00:08 -09:00
Search enabled by default
This commit is contained in:
parent
534e00e41f
commit
80b5026ec7
1 changed files with 2 additions and 11 deletions
|
@ -40,8 +40,7 @@ import java.util.Set;
|
|||
*/
|
||||
public class ChoiceImpl implements Choice, Serializable {
|
||||
|
||||
private int ENABLE_SEARCH_FOR_ITEMS_COUNT = 5; // enable search for choices more then X items (for non standard choices)
|
||||
|
||||
// TODO: add sorting to items
|
||||
protected boolean chosen;
|
||||
protected final boolean required;
|
||||
protected String choice;
|
||||
|
@ -50,7 +49,7 @@ public class ChoiceImpl implements Choice, Serializable {
|
|||
protected Map<String, String> keyChoices = new LinkedHashMap<>();
|
||||
protected String message;
|
||||
protected String subMessage;
|
||||
protected boolean searchEnabled = true;
|
||||
protected boolean searchEnabled = true; // enable for all windows by default
|
||||
protected String searchText;
|
||||
|
||||
public ChoiceImpl() {
|
||||
|
@ -72,12 +71,6 @@ public class ChoiceImpl implements Choice, Serializable {
|
|||
this.keyChoices = choice.keyChoices; // list should never change for the same object so copy by reference
|
||||
}
|
||||
|
||||
private void autoSearchEnable(){
|
||||
if((this.choices != null) && (this.choices.size() >= ENABLE_SEARCH_FOR_ITEMS_COUNT)){
|
||||
this.setSearchEnabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isChosen() {
|
||||
return chosen;
|
||||
|
@ -114,7 +107,6 @@ public class ChoiceImpl implements Choice, Serializable {
|
|||
@Override
|
||||
public void setChoices(Set<String> choices) {
|
||||
this.choices = choices;
|
||||
autoSearchEnable();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -148,7 +140,6 @@ public class ChoiceImpl implements Choice, Serializable {
|
|||
@Override
|
||||
public void setKeyChoices(Map<String, String> choices) {
|
||||
keyChoices = choices;
|
||||
autoSearchEnable();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Add table
Reference in a new issue