• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java DualListModel类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.primefaces.model.DualListModel的典型用法代码示例。如果您正苦于以下问题:Java DualListModel类的具体用法?Java DualListModel怎么用?Java DualListModel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DualListModel类属于org.primefaces.model包,在下文中一共展示了DualListModel类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
/*    */   }
 
开发者ID:marlonalexis,项目名称:Multicentro_Mascotas,代码行数:17,代码来源:PickListView.java


示例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());
}
 
开发者ID:stefanoberdoerfer,项目名称:exmatrikulator,代码行数:19,代码来源:TutorialController.java


示例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());
    }
}
 
开发者ID:stefanoberdoerfer,项目名称:exmatrikulator,代码行数:18,代码来源:ExamEventController.java


示例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());
    }
}
 
开发者ID:stefanoberdoerfer,项目名称:exmatrikulator,代码行数:17,代码来源:ExamEventController.java


示例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")));
        }
    }

}
 
开发者ID:stefanoberdoerfer,项目名称:exmatrikulator,代码行数:27,代码来源:ExamEventController.java


示例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());

}
 
开发者ID:culturagovbr,项目名称:GOG,代码行数:19,代码来源:MBSubClassificacao.java


示例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;
	
}
 
开发者ID:darciopacifico,项目名称:omr,代码行数:27,代码来源:GrupoJSFBean.java


示例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;
	
}
 
开发者ID:darciopacifico,项目名称:omr,代码行数:19,代码来源:ExamJSFBean.java


示例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);

}
 
开发者ID:javaee-samples,项目名称:javaee8-applications,代码行数:16,代码来源:PickListBean.java


示例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);
    }
}
 
开发者ID:ddRPB,项目名称:rpb,代码行数:17,代码来源:OCDataBean.java


示例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<>());
}
 
开发者ID:stefanoberdoerfer,项目名称:exmatrikulator,代码行数:31,代码来源:TutorialController.java


示例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);
}
 
开发者ID:stefanoberdoerfer,项目名称:exmatrikulator,代码行数:19,代码来源:ExamEventControllerTest.java


示例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);
}
 
开发者ID:stefanoberdoerfer,项目名称:exmatrikulator,代码行数:20,代码来源:ExamEventControllerTest.java


示例16: initScriptSelectionModel

import org.primefaces.model.DualListModel; //导入依赖的package包/类
private void initScriptSelectionModel() {
    selectionModel = new DualListModel<DataFile>();
    List<DataFile> files = new DataFileDao().findAll();
    Collections.sort(files, new CreateDateComparator(SortOrder.DESCENDING));
    Set<Integer> dataFileIds = projectBean.getJobConfiguration().getDataFileIds();
    for (DataFile d : files) {
        if (dataFileIds.contains(d.getId())) {
            selectionModel.getTarget().add(d);
        } else {
            selectionModel.getSource().add(d);
        }
    }
}
 
开发者ID:intuit,项目名称:Tank,代码行数:14,代码来源:AssociateDataFileBean.java


示例17: initScriptSelectionModel

import org.primefaces.model.DualListModel; //导入依赖的package包/类
private void initScriptSelectionModel() {
    scriptSelectionModel = new DualListModel<Script>();
    List<Script> scripts = scriptLoader.getVersionEntities();
    for (Script s : scripts) {
        scriptSelectionModel.getSource().add(s);
    }
}
 
开发者ID:intuit,项目名称:Tank,代码行数:8,代码来源:WorkloadScripts.java


示例18: testGetSelectionModel_1

import org.primefaces.model.DualListModel; //导入依赖的package包/类
/**
 * Run the DualListModel<DataFile> getSelectionModel() method test.
 * 
 * @throws Exception
 * 
 * @generatedBy CodePro at 12/15/14 3:54 PM
 */
@Test
public void testGetSelectionModel_1()
        throws Exception {
    AssociateDataFileBean fixture = new AssociateDataFileBean();

    DualListModel<DataFile> result = fixture.getSelectionModel();

}
 
开发者ID:intuit,项目名称:Tank,代码行数:16,代码来源:AssociateDataFileBeanTest.java


示例19: testSetSelectionModel_2

import org.primefaces.model.DualListModel; //导入依赖的package包/类
/**
 * Run the void setSelectionModel(DualListModel<DataFile>) method test.
 * 
 * @throws Exception
 * 
 * @generatedBy CodePro at 12/15/14 3:54 PM
 */
@Test
public void testSetSelectionModel_2()
        throws Exception {
    AssociateDataFileBean fixture = new AssociateDataFileBean();
    DualListModel<DataFile> selectionModel = new DualListModel();

    fixture.setSelectionModel(selectionModel);

    // An unexpected exception was thrown in user code while executing this test:
    // java.lang.NoClassDefFoundError: com_cenqua_clover/CoverageRecorder
    // at com.intuit.tank.project.AssociateDataFileBean.setSelectionModel(AssociateDataFileBean.java:63)
}
 
开发者ID:intuit,项目名称:Tank,代码行数:20,代码来源:AssociateDataFileBeanTest.java


示例20: testSetSelectionModel_3

import org.primefaces.model.DualListModel; //导入依赖的package包/类
/**
 * Run the void setSelectionModel(DualListModel<DataFile>) method test.
 * 
 * @throws Exception
 * 
 * @generatedBy CodePro at 12/15/14 3:54 PM
 */
@Test
public void testSetSelectionModel_3()
        throws Exception {
    AssociateDataFileBean fixture = new AssociateDataFileBean();
    DualListModel<DataFile> selectionModel = null;

    fixture.setSelectionModel(selectionModel);

    // An unexpected exception was thrown in user code while executing this test:
    // java.lang.NoClassDefFoundError: com_cenqua_clover/CoverageRecorder
    // at com.intuit.tank.project.AssociateDataFileBean.setSelectionModel(AssociateDataFileBean.java:63)
}
 
开发者ID:intuit,项目名称:Tank,代码行数:20,代码来源:AssociateDataFileBeanTest.java



注:本文中的org.primefaces.model.DualListModel类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ServletContextResource类代码示例发布时间:2022-05-21
下一篇:
Java SplitPane类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap