org.apache.wicket.markup.repeater.data.IDataProvider Java Examples
The following examples show how to use
org.apache.wicket.markup.repeater.data.IDataProvider.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ProductCatalogPage.java From the-app with Apache License 2.0 | 6 votes |
private IDataProvider<ProductInfo> productDataProvider(IModel<List<ProductInfo>> model) { return new IDataProvider<ProductInfo>() { @Override public Iterator<ProductInfo> iterator(long first, long count) { return model.getObject().iterator(); } @Override public long size() { return model.getObject().size(); } @Override public IModel<ProductInfo> model(ProductInfo object) { return Model.of(object); } @Override public void detach() { } }; }
Example #2
Source File: ArtifactSearchResultsPanel.java From artifact-listener with Apache License 2.0 | 6 votes |
public ArtifactSearchResultsPanel(String id, final IDataProvider<ArtifactBean> dataProvider) { super(id); add(new Label("title", new ResourceModel("artifact.follow.search.results.title"))); dataView = new ArtifactBeanDataView("artifacts", dataProvider, configurer.getArtifactSearchItemsPerPage()); add( dataView, new HideablePagingNavigator("pager", dataView) .add(new EnclosureContainer("pager")) ); add(new WebMarkupContainer("emptyList") { private static final long serialVersionUID = 6700720373087584498L; @Override public boolean isVisible() { return dataProvider.size() == 0; } }); }
Example #3
Source File: ArtifactPomSearchResultsPanel.java From artifact-listener with Apache License 2.0 | 6 votes |
private void addDataView(String id, final String className, IDataProvider<ArtifactBean> dataProvider) { // Data view final DataView<ArtifactBean> artifactDataView = new ArtifactBeanDataView("dataView", dataProvider); dataViews.add(artifactDataView); // Fragment Fragment fragment = new Fragment(id, "dataViewFragment", this) { private static final long serialVersionUID = 1L; @Override protected void onConfigure() { super.onConfigure(); setVisible(artifactDataView.getDataProvider().size() != 0); } }; fragment.add(new Label("title", new ResourceModel("artifact.follow.pom." + id)), artifactDataView); add(fragment); }
Example #4
Source File: ProductCatalogPage.java From AppStash with Apache License 2.0 | 6 votes |
private IDataProvider<ProductInfo> productDataProvider(IModel<List<ProductInfo>> model) { return new IDataProvider<ProductInfo>() { @Override public Iterator<ProductInfo> iterator(long first, long count) { return model.getObject().iterator(); } @Override public long size() { return model.getObject().size(); } @Override public IModel<ProductInfo> model(ProductInfo object) { return Model.of(object); } @Override public void detach() { } }; }
Example #5
Source File: ProductItemListPanel.java From AppStash with Apache License 2.0 | 6 votes |
private IDataProvider<ProductInfo> productsProvider() { return new IDataProvider<ProductInfo>() { @Override public Iterator<ProductInfo> iterator(long first, long count) { return productListModel.getObject().iterator(); } @Override public long size() { return productListModel.getObject().size(); } @Override public IModel<ProductInfo> model(ProductInfo product) { return Model.of(product); } @Override public void detach() { } }; }
Example #6
Source File: ProductItemListPanel.java From the-app with Apache License 2.0 | 6 votes |
private IDataProvider<ProductInfo> productsProvider() { return new IDataProvider<ProductInfo>() { @Override public Iterator<ProductInfo> iterator(long first, long count) { return productListModel.getObject().iterator(); } @Override public long size() { return productListModel.getObject().size(); } @Override public IModel<ProductInfo> model(ProductInfo product) { return Model.of(product); } @Override public void detach() { } }; }
Example #7
Source File: SemesterPage.java From sakai with Educational Community License v2.0 | 5 votes |
public SemesterPage(){ super(); IDataProvider<Semester> dataProvider = createDataProvider(); SemesterForm semesterEditor =createSemesterForm("form", new Semester()); add(semesterEditor); DataView<Semester>dataView = createDataView(dataProvider, semesterEditor); add(dataView); if (dataProvider instanceof SortableSemesterDataProvider){ addOrderBorders((SortableSemesterDataProvider) dataProvider, dataView); } add(createPagingForm("pagingform",dataView)); }
Example #8
Source File: SemesterPage.java From sakai with Educational Community License v2.0 | 5 votes |
public SemesterPage(){ super(); IDataProvider<Semester> dataProvider = createDataProvider(); SemesterForm semesterEditor =createSemesterForm("form", new Semester()); add(semesterEditor); DataView<Semester>dataView = createDataView(dataProvider, semesterEditor); add(dataView); if (dataProvider instanceof SortableSemesterDataProvider){ addOrderBorders((SortableSemesterDataProvider) dataProvider, dataView); } add(createPagingForm("pagingform",dataView)); }
Example #9
Source File: SortableDataAdapter.java From nextreports-server with Apache License 2.0 | 4 votes |
public SortableDataAdapter(IDataProvider<T> provider, Map<String, Comparator<T>> comparators) { this.provider = provider; this.comparators = comparators; }
Example #10
Source File: RecommendedArtifactPortfolioPanel.java From artifact-listener with Apache License 2.0 | 4 votes |
public RecommendedArtifactPortfolioPanel(String id, final IDataProvider<Artifact> dataProvider, int itemsPerPage) { super(id, dataProvider, itemsPerPage); add(new Label("title", new ResourceModel("artifact.follow.search.recommended.title"))); }
Example #11
Source File: ArtifactBeanDataView.java From artifact-listener with Apache License 2.0 | 4 votes |
protected ArtifactBeanDataView(String id, IDataProvider<ArtifactBean> dataProvider, long itemsPerPage) { super(id, dataProvider, itemsPerPage); }
Example #12
Source File: ArtifactBeanDataView.java From artifact-listener with Apache License 2.0 | 4 votes |
protected ArtifactBeanDataView(String id, IDataProvider<ArtifactBean> dataProvider) { this(id, dataProvider, Integer.MAX_VALUE); }
Example #13
Source File: UserPortfolioPanel.java From artifact-listener with Apache License 2.0 | 4 votes |
public UserPortfolioPanel(String id, IDataProvider<User> dataProvider, int itemsPerPage) { super(id, dataProvider, itemsPerPage); }
Example #14
Source File: ArtifactPortfolioPanel.java From artifact-listener with Apache License 2.0 | 4 votes |
public ArtifactPortfolioPanel(String id, IDataProvider<Artifact> dataProvider, int itemsPerPage) { super(id, dataProvider, itemsPerPage); }
Example #15
Source File: ProjectPortfolioPanel.java From artifact-listener with Apache License 2.0 | 4 votes |
public ProjectPortfolioPanel(String id, IDataProvider<Project> dataProvider, int itemsPerPage) { super(id, dataProvider, itemsPerPage); editProjectPopup = new ProjectFormPopupPanel("editProjectPopup", FormPanelMode.EDIT); add(editProjectPopup); }
Example #16
Source File: ViewPictures.java From sakai with Educational Community License v2.0 | 4 votes |
private void populateGallery(Form galleryForm, final String userUuid) { IDataProvider dataProvider = new GalleryImageDataProvider(userUuid); long numImages = dataProvider.size(); gridView = new GridView("rows", dataProvider) { private static final long serialVersionUID = 1L; @Override protected void populateItem(Item item) { final GalleryImage image = (GalleryImage) item.getModelObject(); final GalleryImageRenderer galleryImageThumbnailRenderer = new GalleryImageRenderer( "galleryImageThumbnailRenderer", image .getThumbnailResource()); AjaxLink galleryImageLink = new AjaxLink("galleryItem") { public void onClick(AjaxRequestTarget target) { setResponsePage(new ViewPicture(image)); } }; galleryImageLink.add(galleryImageThumbnailRenderer); item.add(galleryImageLink); } @Override protected void populateEmptyItem(Item item) { Link galleryImageLink = new Link("galleryItem") { @Override public void onClick() { } }; galleryImageLink.add(new Label("galleryImageThumbnailRenderer")); item.add(galleryImageLink); } }; gridView.setRows(3); gridView.setColumns(4); galleryForm.add(gridView); //pager if (numImages == 0) { galleryForm.add(new PagingNavigator("navigator", gridView).setVisible(false)); } else if (numImages <= ProfileConstants.MAX_GALLERY_IMAGES_PER_PAGE) { galleryForm.add(new PagingNavigator("navigator", gridView).setVisible(false)); } else { galleryForm.add(new PagingNavigator("navigator", gridView)); } }
Example #17
Source File: SortableDataAdapter.java From nextreports-server with Apache License 2.0 | 4 votes |
@SuppressWarnings("unchecked") public SortableDataAdapter(IDataProvider<T> provider) { this(provider, Collections.EMPTY_MAP); }
Example #18
Source File: FakeSortableDataAdapter.java From nextreports-server with Apache License 2.0 | 4 votes |
public FakeSortableDataAdapter(IDataProvider<T> provider) { this.provider = provider; }
Example #19
Source File: ViewPictures.java From sakai with Educational Community License v2.0 | 4 votes |
private void populateGallery(Form galleryForm, final String userUuid) { IDataProvider dataProvider = new GalleryImageDataProvider(userUuid); long numImages = dataProvider.size(); gridView = new GridView("rows", dataProvider) { private static final long serialVersionUID = 1L; @Override protected void populateItem(Item item) { final GalleryImage image = (GalleryImage) item.getModelObject(); final GalleryImageRenderer galleryImageThumbnailRenderer = new GalleryImageRenderer( "galleryImageThumbnailRenderer", image .getThumbnailResource()); AjaxLink galleryImageLink = new AjaxLink("galleryItem") { public void onClick(AjaxRequestTarget target) { setResponsePage(new ViewPicture(image)); } }; galleryImageLink.add(galleryImageThumbnailRenderer); item.add(galleryImageLink); } @Override protected void populateEmptyItem(Item item) { Link galleryImageLink = new Link("galleryItem") { @Override public void onClick() { } }; galleryImageLink.add(new Label("galleryImageThumbnailRenderer")); item.add(galleryImageLink); } }; gridView.setRows(3); gridView.setColumns(4); galleryForm.add(gridView); //pager if (numImages == 0) { galleryForm.add(new PagingNavigator("navigator", gridView).setVisible(false)); } else if (numImages <= ProfileConstants.MAX_GALLERY_IMAGES_PER_PAGE) { galleryForm.add(new PagingNavigator("navigator", gridView).setVisible(false)); } else { galleryForm.add(new PagingNavigator("navigator", gridView)); } }
Example #20
Source File: SemesterPage.java From sakai with Educational Community License v2.0 | 4 votes |
private DataView<Semester>createDataView(IDataProvider<Semester> listDataProvider, final SemesterForm semesterEditor){ DataView<Semester> dataView = new DataView<Semester>("row", listDataProvider) { private static final long serialVersionUID = 1L; @Override protected void populateItem(Item<Semester> item) { Semester sem = item.getModelObject(); RepeatingView repeatingView = new RepeatingView("dataRow"); CompoundPropertyModel<Semester> model = new CompoundPropertyModel<Semester>(sem); repeatingView.add(new Label(repeatingView.newChildId(), model.bind(PROP_EID))); repeatingView.add(new Label(repeatingView.newChildId(), model.bind(PROP_TITLE))); repeatingView.add(new Label(repeatingView.newChildId(),model.bind(PROP_START))); repeatingView.add(new Label(repeatingView.newChildId(),model.bind(PROP_END))); repeatingView.add(new Label(repeatingView.newChildId(), model.bind(PROP_DESC))); repeatingView.add(new Label(repeatingView.newChildId(), getString(sem.isCurrent()?"lbl_yes":"lbl_no"))); ActionLink<Semester> el = new ActionLink<Semester>(model) { private static final long serialVersionUID = 1L; @Override public void onClick() { IModel <Semester> m = getModel(); Semester selected = m.getObject(); semesterEditor.setModelObject(selected); semesterEditor.setUpdateEID(selected.getEid()); SemesterPage.this.clearFeedback(); } }; el.setBody(new ResourceModel(LABEL_EDIT)); repeatingView.add(new ActionPanel<Semester>(repeatingView.newChildId(), el)); item.add(repeatingView); } }; dataView.setItemsPerPage(DEFAULT_ITEMS_PER_PAGE); return dataView; }
Example #21
Source File: SemesterPage.java From sakai with Educational Community License v2.0 | 4 votes |
protected IDataProvider<Semester> createDataProvider(){ return new SortableSemesterDataProvider(); }
Example #22
Source File: SemesterPage.java From sakai with Educational Community License v2.0 | 4 votes |
protected IDataProvider<Semester> createDataProvider(){ return new SortableSemesterDataProvider(); }
Example #23
Source File: SemesterPage.java From sakai with Educational Community License v2.0 | 4 votes |
private DataView<Semester>createDataView(IDataProvider<Semester> listDataProvider, final SemesterForm semesterEditor){ DataView<Semester> dataView = new DataView<Semester>("row", listDataProvider) { private static final long serialVersionUID = 1L; @Override protected void populateItem(Item<Semester> item) { Semester sem = item.getModelObject(); RepeatingView repeatingView = new RepeatingView("dataRow"); CompoundPropertyModel<Semester> model = new CompoundPropertyModel<Semester>(sem); repeatingView.add(new Label(repeatingView.newChildId(), model.bind(PROP_EID))); repeatingView.add(new Label(repeatingView.newChildId(), model.bind(PROP_TITLE))); repeatingView.add(new Label(repeatingView.newChildId(),model.bind(PROP_START))); repeatingView.add(new Label(repeatingView.newChildId(),model.bind(PROP_END))); repeatingView.add(new Label(repeatingView.newChildId(), model.bind(PROP_DESC))); repeatingView.add(new Label(repeatingView.newChildId(), getString(sem.isCurrent()?"lbl_yes":"lbl_no"))); ActionLink<Semester> el = new ActionLink<Semester>(model) { private static final long serialVersionUID = 1L; @Override public void onClick() { IModel <Semester> m = getModel(); Semester selected = m.getObject(); semesterEditor.setModelObject(selected); semesterEditor.setUpdateEID(selected.getEid()); SemesterPage.this.clearFeedback(); } }; el.setBody(new ResourceModel(LABEL_EDIT)); repeatingView.add(new ActionPanel<Semester>(repeatingView.newChildId(), el)); item.add(repeatingView); } }; dataView.setItemsPerPage(DEFAULT_ITEMS_PER_PAGE); return dataView; }