当前位置: 首页>>代码示例>>Java>>正文


Java Model.ofList方法代码示例

本文整理汇总了Java中org.apache.wicket.model.Model.ofList方法的典型用法代码示例。如果您正苦于以下问题:Java Model.ofList方法的具体用法?Java Model.ofList怎么用?Java Model.ofList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.wicket.model.Model的用法示例。


在下文中一共展示了Model.ofList方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initViewSelector

import org.apache.wicket.model.Model; //导入方法依赖的package包/类
private void initViewSelector(WebMarkupContainer headerPanel){
    DropDownChoice<AssignmentViewType> viewSelect = new DropDownChoice(ID_VIEW_TYPE, viewModel,
            Model.ofList(viewTypeList != null && viewTypeList.size() > 0 ?
                    viewTypeList : createAssignableTypesList()),
            new EnumChoiceRenderer<AssignmentViewType>(this));
    viewSelect.add(new OnChangeAjaxBehavior() {
        private static final long serialVersionUID = 1L;

        @Override
        protected void onUpdate(AjaxRequestTarget target) {
            if (AssignmentViewType.USER_TYPE.equals(viewSelect.getModelObject())){
                initUserViewSelectionPopup(createStringResource("AssignmentCatalogPanel.selectAssignmentsUserOwner"),
                        target);
            } else {
                searchModel.reset();
                AssignmentCatalogPanel.this.addOrReplaceSearchPanel(getHeaderPanel());
                AssignmentCatalogPanel.this.addOrReplaceLayout(target, getCatalogItemsPanelContainer(), getPageBase());
                target.add(getCatalogItemsPanelContainer());
                target.add(getHeaderPanel());
            }
        }
    });
    viewSelect.setOutputMarkupId(true);
    headerPanel.add(viewSelect);

}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:27,代码来源:AssignmentCatalogPanel.java

示例2: initItemListModel

import org.apache.wicket.model.Model; //导入方法依赖的package包/类
private void initItemListModel() {
    List<AssignmentEditorDto> itemList = new ArrayList<>();
    if (isListProvider){
        itemList = listProvider != null ? listProvider.getAvailableData() : new ArrayList<>();
    } else {
        itemList = objectDataProvider != null ? objectDataProvider.getAvailableData() : new ArrayList<>();
    }
    itemsListModel = Model.ofList(itemList);
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:10,代码来源:CatalogItemsPanel.java

示例3: addOrReplaceAssignmentsTable

import org.apache.wicket.model.Model; //导入方法依赖的package包/类
private void addOrReplaceAssignmentsTable(WebMarkupContainer assignmentsContainer){
    fillInRelationAssignmentsMap();
    DropDownChoicePanel relation = WebComponentUtil.createEnumPanel(RelationTypes.class, ID_RELATION,
            WebComponentUtil.createReadonlyModelFromEnum(RelationTypes.class), relationModel, this, false);
    relation.getBaseFormComponent().add(new AjaxFormComponentUpdatingBehavior("change") {
        private static final long serialVersionUID = 1L;

        @Override
        protected void onUpdate(AjaxRequestTarget target) {
            relationModel.setObject((RelationTypes)relation.getBaseFormComponent().getConvertedInput());
            addOrReplaceAssignmentsTable(getAssignmentsContainer());
            target.add(AssignmentDataTablePanel.this.get(ID_ASSIGNMENTS).get(ID_ASSIGNMENTS_TABLE));
        }
    });
    relation.setOutputMarkupId(true);
    relation.setOutputMarkupPlaceholderTag(true);
    assignmentsContainer.addOrReplace(relation);

    AjaxButton showAllAssignmentsButton = new AjaxButton(ID_SHOW_ALL_ASSIGNMENTS_BUTTON,
            createStringResource("AssignmentTablePanel.menu.showAllAssignments")) {
        @Override
        public void onClick(AjaxRequestTarget ajaxRequestTarget) {
            showAllAssignments(ajaxRequestTarget);
        }
    };
    assignmentsContainer.addOrReplace(showAllAssignmentsButton);

    ListDataProvider<AssignmentEditorDto> assignmentsProvider = new ListDataProvider<AssignmentEditorDto>(this,
            Model.ofList(relationAssignmentsMap.get(relationModel.getObject())), false){
        private static final long serialVersionUID = 1L;

        @Override
        protected void saveProviderPaging(ObjectQuery query, ObjectPaging paging) {
            getAssignmentsStorage().setPaging(paging);
        }

    };
    BoxedTablePanel<AssignmentEditorDto> assignmentTable = new BoxedTablePanel<AssignmentEditorDto>(ID_ASSIGNMENTS_TABLE,
            assignmentsProvider, initColumns(), UserProfileStorage.TableId.ASSIGNMENTS_TAB_TABLE,
            (int) pageBase.getItemsPerPage(UserProfileStorage.TableId.ASSIGNMENTS_TAB_TABLE)){
        private static final long serialVersionUID = 1L;

        @Override
        protected Item<AssignmentEditorDto> customizeNewRowItem(Item<AssignmentEditorDto> item, IModel<AssignmentEditorDto> model) {
                item.add(AttributeModifier.append("class", AssignmentsUtil.createAssignmentStatusClassModel(model)));
            return item;
        }

        @Override
        public int getItemsPerPage() {
            return pageBase.getSessionStorage().getUserProfile().getTables().get(UserProfileStorage.TableId.ASSIGNMENTS_TAB_TABLE);
        }

    };
    assignmentTable.setOutputMarkupId(true);
    assignmentTable.setCurrentPage(getAssignmentsStorage().getPaging());
    assignmentsContainer.addOrReplace(assignmentTable);

}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:60,代码来源:AssignmentDataTablePanel.java

示例4: initModels

import org.apache.wicket.model.Model; //导入方法依赖的package包/类
private void initModels() {
    assignmentsModel = Model.ofList(getSessionStorage().getRoleCatalog().getAssignmentShoppingCart());
    descriptionModel = Model.of(getSessionStorage().getRoleCatalog().getRequestDescription());
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:5,代码来源:PageAssignmentsList.java

示例5: model

import org.apache.wicket.model.Model; //导入方法依赖的package包/类
@Override
public IModel<List<T>> model(List<T> object) {
    // Iterators.partition sometimes returns lists that are not deeply serializable, 
    // so we need to copy this into a serializable list here :(
    return Model.ofList(ImmutableList.copyOf(object));
}
 
开发者ID:acdh-oeaw,项目名称:vlo-curation,代码行数:7,代码来源:PartitionedDataProvider.java


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