本文整理汇总了Java中org.primefaces.model.DualListModel类的典型用法代码示例。如果您正苦于以下问题:Java DualListModel类的具体用法?Java DualListModel怎么用?Java DualListModel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DualListModel类属于org.primefaces.model包,在下文中一共展示了DualListModel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1:
import org.primefaces.model.DualListModel; //导入依赖的package包/类
@PostConstruct
/* */ public void init()
/* */ {
/* 32 */ List citiesSource = new ArrayList();
/* 33 */ List citiesTarget = new ArrayList();
/* */
/* 35 */ citiesSource.add("San Francisco");
/* 36 */ citiesSource.add("London");
/* 37 */ citiesSource.add("Paris");
/* 38 */ citiesSource.add("Istanbul");
/* 39 */ citiesSource.add("Berlin");
/* 40 */ citiesSource.add("Barcelona");
/* 41 */ citiesSource.add("Rome");
/* */
/* 43 */ this.cities = new DualListModel(citiesSource, citiesTarget);
/* */ }
示例2: createTutorial
import org.primefaces.model.DualListModel; //导入依赖的package包/类
/**
* Creates a new tutorial.
*/
public void createTutorial() {
tutorial = new Tutorial();
tutorial.setCourse(course);
tutorial.setName(tutorialName);
tutorial = updateTutors(tutorial);
course.getTutorials().add(tutorial);
course = courseService.update(course);
this.tutorialName = null;
tutorialTutors = new DualListModel<>(courseService.findPrivUsers(course),
new ArrayList<>());
log.debug("Created new tutorial " + tutorial.getName());
}
示例3: onEventSelect
import org.primefaces.model.DualListModel; //导入依赖的package包/类
/**
* Selects an event to the currently edited event.
* @param selectEvent The selectEvent triggered by the PrimeFaces scheduler.
*/
public void onEventSelect(SelectEvent selectEvent) {
log.debug("onEventSelect called with " + selectEvent);
event = (ExamEvent) selectEvent.getObject();
oldEventStartDate = event.getStartDate();
oldEventEndDate = event.getEndDate();
if (canUserEditEvent()) {
course = courseService.findCourseById(courseIdStr);
studentDualList = new DualListModel<>(
getStudentsWithoutEvents(),
event.getExaminedStudents());
}
}
示例4: onDateSelect
import org.primefaces.model.DualListModel; //导入依赖的package包/类
/**
* Triggered when a date is selected. Creates a new ExamEvent
* @param selectEvent The selectEvent triggered by the PrimeFaces scheduler.
*/
public void onDateSelect(SelectEvent selectEvent) {
log.debug("onDateSelect called with " + selectEvent);
event = new ExamEvent(exam,
(Date) selectEvent.getObject(),
(Date) selectEvent.getObject());
if (canUserEditEvent()) {
course = courseService.findCourseById(courseIdStr);
studentDualList = new DualListModel<>(
getStudentsWithoutEvents(),
event.getExaminedStudents());
}
}
示例5: validateStudentSize
import org.primefaces.model.DualListModel; //导入依赖的package包/类
/**
* Validates that the size of the target list of the dual list model is not
* larger than the number of allowed students.
* @param ctx The FacesContex of the validation.
* @param comp The UIComponent for which the validation occurs.
* @param value The value of the compinent.
*/
public void validateStudentSize(FacesContext ctx, UIComponent comp, Object value) {
log.debug("validateStudentSize() called");
log.debug("Max number of students int: " + event.getMaxNumStudents());
if (value instanceof DualListModel<?>) {
ResourceBundle bundle = ResourceBundle.getBundle("messages",
FacesContext.getCurrentInstance().getViewRoot().getLocale());
DualListModel<?> dualListModel = (DualListModel<?>) value;
log.debug("Size of target list: " + dualListModel.getTarget());
if (dualListModel.getTarget().size() > event.getMaxNumStudents()) {
throw new ValidatorException(
new FacesMessage(FacesMessage.SEVERITY_FATAL,
bundle.getString("common.error"),
bundle.getString("examEvent.messageNumStudentsExceeded")));
}
}
}
示例6: setSubclassificacao
import org.primefaces.model.DualListModel; //导入依赖的package包/类
/**
* @param subclassificacao the subclassificacao to set
*/
public void setSubclassificacao(TbSubClassificacao subclassificacao) {
this.subclassificacao = subclassificacao;
List<TbClassificacao> todas = classificacaoDAO.findAll();
Collections.sort(todas);
ArrayList<TbClassificacao> todasClassificacoes = new ArrayList<>();
for (TbClassificacao tbClassificacao : todas) {
todasClassificacoes.add(tbClassificacao);
}
todasClassificacoes.removeAll(subclassificacao.getTbClassificacaoCollection());
listaClassificacao = new DualListModel<>((List<TbClassificacao>) todasClassificacoes, (List<TbClassificacao>) subclassificacao.getTbClassificacaoCollection());
}
示例7: createPermissoesDLM
import org.primefaces.model.DualListModel; //导入依赖的package包/类
/**
*
* @param tmpVO
*/
private void createPermissoesDLM(GrupoVO tmpVO) {
List<EAuthority> permissoesIn;
if(tmpVO==null || tmpVO.getAuthorities()==null){
permissoesIn = new ArrayList<EAuthority>();
}else{
permissoesIn = tmpVO.getAuthorities();
}
List<EAuthority> authsNotIn = getEnumsList(EAuthority.class);
if(CollectionUtils.isNotEmpty(permissoesIn)){
authsNotIn.removeAll(permissoesIn);
}
DualListModel<EAuthority> permissaoDLM = new DualListModel<EAuthority>();
permissaoDLM.setSource(authsNotIn);
permissaoDLM.setTarget(permissoesIn);
this.permissaoDLM = permissaoDLM;
}
示例8: getQuest
import org.primefaces.model.DualListModel; //导入依赖的package包/类
public DualListModel<QuestionnaireVO> getQuest(){
if(questionnaireDualListModel==null){
ExamVO tmpVO2 = getTmpVO();
if(tmpVO2==null){
return new DualListModel<QuestionnaireVO>();
}
List<QuestionnaireVO> questionnairesNotIn = questionnaireBusiness.findAllNotIn(tmpVO2.getQuestionnaires());
List<QuestionnaireVO> quest = new ArrayList<QuestionnaireVO>(questionnairesNotIn.size());
quest.addAll(questionnairesNotIn);
questionnaireDualListModel = new DualListModel<QuestionnaireVO>(quest, tmpVO2.getQuestionnaires());
}
return questionnaireDualListModel;
}
示例9: PickListBean
import org.primefaces.model.DualListModel; //导入依赖的package包/类
public PickListBean(List<ColumnModel> columnModelList) {
//Columns
source = new ArrayList<ColumnBean>();
target = new ArrayList<ColumnBean>();
for(ColumnModel column:columnModelList){
System.out.println(column.getColumnLabel());
ColumnBean bean = new ColumnBean(column.getId(), column.getColumnName(), column.getColumnLabel());
source.add(bean);
}
columns = new DualListModel<ColumnBean>(source, target);
}
示例10: initFeaturedDataverses
import org.primefaces.model.DualListModel; //导入依赖的package包/类
public void initFeaturedDataverses() {
List<Dataverse> featuredSource = new ArrayList<>();
List<Dataverse> featuredTarget = new ArrayList<>();
featuredSource.addAll(dataverseService.findAllPublishedByOwnerId(dataverse.getId()));
featuredSource.addAll(linkingService.findLinkedDataverses(dataverse.getId()));
List<DataverseFeaturedDataverse> featuredList = featuredDataverseService.findByDataverseId(dataverse.getId());
for (DataverseFeaturedDataverse dfd : featuredList) {
Dataverse fd = dfd.getFeaturedDataverse();
featuredTarget.add(fd);
featuredSource.remove(fd);
}
featuredDataverses = new DualListModel<>(featuredSource, featuredTarget);
}
开发者ID:pengchengluo,项目名称:Peking-University-Open-Research-Data-Platform,代码行数:15,代码来源:DataversePage.java
示例11: initFacets
import org.primefaces.model.DualListModel; //导入依赖的package包/类
public void initFacets() {
List<DatasetFieldType> facetsSource = new ArrayList<>();
List<DatasetFieldType> facetsTarget = new ArrayList<>();
facetsSource.addAll(datasetFieldService.findAllFacetableFieldTypes());
List<DataverseFacet> facetsList = dataverseFacetService.findByDataverseId(dataverse.getFacetRootId());
for (DataverseFacet dvFacet : facetsList) {
DatasetFieldType dsfType = dvFacet.getDatasetFieldType();
facetsTarget.add(dsfType);
facetsSource.remove(dsfType);
}
facets = new DualListModel<>(facetsSource, facetsTarget);
facetMetadataBlockId = null;
}
开发者ID:pengchengluo,项目名称:Peking-University-Open-Research-Data-Platform,代码行数:14,代码来源:DataversePage.java
示例12: load
import org.primefaces.model.DualListModel; //导入依赖的package包/类
/**
* Reload metadata
*/
public void load() {
try {
// Reload the definitions
this.studyIntegrationFacade.init(this.mainBean);
this.dataItemDefinitions = this.studyIntegrationFacade.getAllFields();
// Prepare model for PickList
this.queryDefinitions = new DualListModel<ItemDefinition>(this.dataItemDefinitions, new ArrayList<ItemDefinition>());
}
catch (Exception err) {
this.messageUtil.error(err);
}
}
示例13: init
import org.primefaces.model.DualListModel; //导入依赖的package包/类
/**
* Method called on bean initialization.
*/
@PostConstruct
public void init() {
FacesContext facesContext = FacesContext.getCurrentInstance();
ExternalContext exContext = facesContext.getExternalContext();
HttpServletRequest req = (HttpServletRequest) exContext.getRequest();
HttpServletResponse res = (HttpServletResponse) exContext.getResponse();
user = (User) exContext.getSessionMap().get("user");
course = courseService.findCourseById(req.getParameter("course-id"));
if (course == null || user == null) {
try {
res.sendError(HttpServletResponse.SC_BAD_REQUEST);
} catch (IOException e) {
log.fatal(e);
}
return;
}
manageTutorials = isAllowedToManageTutorials();
tutorialTutors = new DualListModel<>(courseService.findPrivUsers(course),
new ArrayList<>());
tutorialStudents = new DualListModel<>(courseService.findStudents(course),
new ArrayList<>());
groupMembers = new DualListModel<>(courseService.findStudents(course),
new ArrayList<>());
}
示例14: testValidateStudentSizeSameSize
import org.primefaces.model.DualListModel; //导入依赖的package包/类
/**
* Tests if no ValidatorException gets thrown if the student number
* of the picked students is equal to the set student size of the event.
*/
@Test
public void testValidateStudentSizeSameSize() {
int testNumStudents = 5;
ExamEvent event = new ExamEvent();
examEventController.setExamEvent(event);
event.setMaxNumStudents(testNumStudents);
List<Object> arrayListMock = Mockito.mock(ArrayList.class);
when(arrayListMock.size()).thenReturn(testNumStudents);
DualListModel<Object> dualListModelMock = Mockito.mock(DualListModel.class);
when(dualListModelMock.getTarget()).thenReturn(arrayListMock);
examEventController.validateStudentSize(contextMock,uiComponentMock,dualListModelMock);
}
示例15: testValidateStudentSizeOneToLargeSize
import org.primefaces.model.DualListModel; //导入依赖的package包/类
/**
* Tests if a ValidatorException gets thrown if the number of picked students
* for the event is larger than the maximal size of students of the event
* by one..
*/
@Test(expected = ValidatorException.class)
public void testValidateStudentSizeOneToLargeSize() {
int testNumStudents = 5;
ExamEvent event = new ExamEvent();
examEventController.setExamEvent(event);
event.setMaxNumStudents(testNumStudents);
List<Object> arrayListMock = Mockito.mock(ArrayList.class);
when(arrayListMock.size()).thenReturn(testNumStudents + 1);
DualListModel<Object> dualListModelMock = Mockito.mock(DualListModel.class);
when(dualListModelMock.getTarget()).thenReturn(arrayListMock);
examEventController.validateStudentSize(contextMock,uiComponentMock,dualListModelMock);
}