當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。