Web implementation of the Gourmet Recipe Manager
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

51 lines
1.2 KiB

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;
}
}