parent
9cf0f89e76
commit
61942f547a
3 changed files with 53 additions and 28 deletions
@ -0,0 +1,51 @@ |
||||
package com.mousetech.gourmetj; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
|
||||
import jakarta.enterprise.context.ApplicationScoped; |
||||
import jakarta.faces.model.SelectItem; |
||||
import jakarta.inject.Named; |
||||
|
||||
/** |
||||
* Appplication-scope data (mostly constants) |
||||
* |
||||
* @author timh |
||||
* @since Feb 1, 2024 |
||||
*/ |
||||
@Named |
||||
@ApplicationScoped |
||||
public class AppBean { |
||||
|
||||
public AppBean() { |
||||
// TODO Auto-generated constructor stub
|
||||
} |
||||
|
||||
private List<SelectItem> searchTypeList; |
||||
|
||||
/** |
||||
* @return the searchTypeList |
||||
* @see RecipeSearchType |
||||
* Used by main.xhtml |
||||
*/ |
||||
public List<SelectItem> getSearchTypeList() { |
||||
if (searchTypeList == null) { |
||||
searchTypeList = loadSearchTypeList(); |
||||
} |
||||
return searchTypeList; |
||||
} |
||||
|
||||
private List<SelectItem> loadSearchTypeList() { |
||||
List<SelectItem> list = new ArrayList<SelectItem>(5); |
||||
list.add(new SelectItem(RecipeSearchType.rst_BY_NAME.ordinal(), |
||||
"Title")); |
||||
list.add(new SelectItem(RecipeSearchType.rst_BY_CATEGORY.ordinal(), |
||||
"Category")); |
||||
list.add(new SelectItem(RecipeSearchType.rst_BY_CUISINE.ordinal(), |
||||
"Cuisine")); |
||||
list.add( |
||||
new SelectItem(RecipeSearchType.rst_BY_INGREDIENT.ordinal(), |
||||
"Ingredient")); |
||||
return list; |
||||
} |
||||
} |
Loading…
Reference in new issue