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


Java ListDataProvider类代码示例

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


ListDataProvider类属于org.apache.wicket.markup.repeater.data包,在下文中一共展示了ListDataProvider类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ForAdmins

import org.apache.wicket.markup.repeater.data.ListDataProvider; //导入依赖的package包/类
/**
 * Construct.
 * 
 * @param id
 */
public ForAdmins(String id, final BodyFrame index) {
	super(id);
	
	// generate data-view to populate the table
	DataView<NavigationItem> naviView = new DataView<NavigationItem>("adminNavis",
			new ListDataProvider<NavigationItem>(index.getAdminNavigationList())) {

		@Override
		protected void populateItem(Item<NavigationItem> item) {
			NavigationItem naviItem = item.getModelObject();

			// link to the page
			ChangeFramePageLink link = new ChangeFramePageLink("linkToAdminPage", index, naviItem.getPageClass());
			link.add(new Label("adminLinkLabel", naviItem.getPageName()));
			item.add(link);
		}
	};
	
	add(naviView);
}
 
开发者ID:citlab,项目名称:Intercloud,代码行数:26,代码来源:NavigationFrame.java

示例2: addDetailRows

import org.apache.wicket.markup.repeater.data.ListDataProvider; //导入依赖的package包/类
private void addDetailRows(MasterDetailTable<M, D> table, M masterObject, boolean expanded) {
    List<D> list = null;
    if (expanded) {
        // calculate inner rows only if this parent row is expanded
        list = table.getDetails(masterObject);
    }
    if (list == null) {
        add(new WebMarkupContainer("rows").setVisible(false));
        return;
    }

    final SortParam sortParam = getSortParam(table);
    sortList(list, sortParam);

    final ListDataProvider dataProvider = new DetailsDataProvider<>(list, masterObject);
    add(new DetailsGridView("rows", table.getColumns(), dataProvider));
}
 
开发者ID:alancnet,项目名称:artifactory,代码行数:18,代码来源:MasterDetailRowPanel.java

示例3: HomePage

import org.apache.wicket.markup.repeater.data.ListDataProvider; //导入依赖的package包/类
public HomePage(final PageParameters parameters) {
super(parameters);

  add(new DataView<Invoice>("invoice-table", new ListDataProvider(invoiceService.getAll()))
     {
         private static final long serialVersionUID = 1L;

       @Override
        protected void populateItem(final Item<Invoice> item)
        {
            Invoice invoice = item.getModelObject();

            item.add(new Label("shop"       , invoice.getShop()));
            item.add(new Label("invoice-date", invoice.getInvoiceDate()));
        }

     });

// TODO Add your page's components here

  }
 
开发者ID:bartgeluykens,项目名称:Invoice-Keeper,代码行数:22,代码来源:HomePage.java

示例4: BulletListPanel

import org.apache.wicket.markup.repeater.data.ListDataProvider; //导入依赖的package包/类
public BulletListPanel(String id, String header, List<String> list) {
	super(id);
	if (list == null) {
		list = new ArrayList<String>();
	}
	add(new Label("header", header).setVisible(list.size() > 0));
	ListDataProvider<String> listDp = new ListDataProvider<String>(list);
	DataView<String> listView = new DataView<String>("list", listDp) {
		private static final long serialVersionUID = 1L;

		public void populateItem(final Item<String> item) {
			String entry = item.getModelObject();
			item.add(new Label("listItem", entry));
		}
	};
	add(listView.setVisible(list.size() > 0));
}
 
开发者ID:warpfork,项目名称:gitblit,代码行数:18,代码来源:BulletListPanel.java

示例5: ListItemsPage

import org.apache.wicket.markup.repeater.data.ListDataProvider; //导入依赖的package包/类
public ListItemsPage() {
	final Label label = new Label("message", "items from database:");
	add(label);

	add(new Link("link") {

		@Override
		public void onClick() {
			setResponsePage(AddItemPage.class);
		}
	});
	
	ListDataProvider<Item> itemProvider = new ListDataProvider<Item>(itemService.findAll());

	IColumn[] columns = new IColumn[2];

	columns[0] = new PropertyColumn(new Model<String>("Name"), "name");
	columns[1] = new PropertyColumn(new Model<String>("Price"), "price");

	DataTable table = new DataTable("datatable", columns, itemProvider, 10);
	table.addBottomToolbar(new NavigationToolbar(table));
	table.addTopToolbar(new HeadersToolbar(table, null));
	add(table);

}
 
开发者ID:jirkapinkas,项目名称:example-wicket-portlet,代码行数:26,代码来源:ListItemsPage.java

示例6: createDataProvider

import org.apache.wicket.markup.repeater.data.ListDataProvider; //导入依赖的package包/类
private IDataProvider<Member> createDataProvider( List<String> members )
{
    ListDataProvider<Member> results;
    if ( CollectionUtils.isNotEmpty( members ) )
    {
        Collections.sort( members, new Comparator<String>()
        {
            @Override
            public int compare(String m1, String m2)
            {
                return m1.compareToIgnoreCase( m2 );
            }
        } );

        int ctr = 0;
        List<Member> tableMembers = new ArrayList<>();
        for ( String member : members )
        {
            Member tableMember = new Member();
            tableMember.setUserDn( member );
            tableMember.setIndex( ++ctr );
            tableMembers.add( tableMember );
        }
        results = new ListDataProvider<>( tableMembers );
    }
    else
    {
        results = new ListDataProvider<>( new ArrayList<Member>() );
    }
    return results;
}
 
开发者ID:apache,项目名称:directory-fortress-commander,代码行数:32,代码来源:GroupDetailPanel.java

示例7: createDataProvider

import org.apache.wicket.markup.repeater.data.ListDataProvider; //导入依赖的package包/类
private IDataProvider<RequestMod> createDataProvider( List<RequestMod> mods )
{
    ListDataProvider<RequestMod> results;
    if ( CollectionUtils.isNotEmpty( mods ) )
    {
        results = new ListDataProvider<>( mods );
    }
    else
    {
        results = new ListDataProvider<>( new ArrayList<RequestMod>() );
    }
    return results;
}
 
开发者ID:apache,项目名称:directory-fortress-commander,代码行数:14,代码来源:AuditModDetailPanel.java

示例8: newSubmenu

import org.apache.wicket.markup.repeater.data.ListDataProvider; //导入依赖的package包/类
/**
 * Creates a submenu. This is not actually submenu because we're using an older Twitter Bootstrap which is pre-submenu.
 * 
 * @param wicketId
 * @param submenuTitle
 * @param menuItems
 * @return a submenu fragment
 */
private Fragment newSubmenu(String wicketId, String submenuTitle, List<MenuItem> menuItems) {
	Fragment submenu = new Fragment(wicketId, "submenuFragment", this);
	submenu.add(new Label("submenuTitle", submenuTitle).setRenderBodyOnly(true));
	ListDataProvider<MenuItem> menuItemsDp = new ListDataProvider<MenuItem>(menuItems);
	DataView<MenuItem> submenuItems = new DataView<MenuItem>("submenuItem", menuItemsDp) {
		private static final long serialVersionUID = 1L;

		@Override
		public void populateItem(final Item<MenuItem> menuItem) {
			final MenuItem item = menuItem.getModelObject();
			String name = item.toString();
			try {
				// try to lookup translation
				name = getString(name);
			} catch (Exception e) {
			}
			if (item instanceof PageLinkMenuItem) {
				// link to another Wicket page
				PageLinkMenuItem pageLink = (PageLinkMenuItem) item;
				menuItem.add(new LinkPanel("submenuLink", null, null, name, pageLink.getPageClass(), pageLink.getPageParameters(), false)
						.setRenderBodyOnly(true));
			} else if (item instanceof ExternalLinkMenuItem) {
				// link to a specified href
				ExternalLinkMenuItem extLink = (ExternalLinkMenuItem) item;
				menuItem.add(new LinkPanel("submenuLink", null, name, extLink.getHref(), extLink.openInNewWindow()).setRenderBodyOnly(true));
			} else if (item instanceof MenuDivider) {
				// divider
				menuItem.add(new Label("submenuLink").setRenderBodyOnly(true));
				WicketUtils.setCssClass(menuItem, "divider");
			}
		}
	};
	submenu.add(submenuItems);
	submenu.setRenderBodyOnly(true);
	return submenu;
}
 
开发者ID:tomaswolf,项目名称:gerrit-gitblit-plugin,代码行数:45,代码来源:RootPage.java

示例9: TicketPage

import org.apache.wicket.markup.repeater.data.ListDataProvider; //导入依赖的package包/类
public TicketPage(PageParameters params) {
	super(params);

	final String ticketFolder = WicketUtils.getPath(params);

	Repository r = getRepository();
	TicketModel t = TicgitUtils.getTicket(r, ticketFolder);

	add(new Label("ticketTitle", t.title));
	add(new Label("ticketId", t.id));
	add(new Label("ticketHandler", t.handler.toLowerCase()));
	add(WicketUtils.createTimestampLabel("ticketOpenDate", t.date, getTimeZone(), getTimeUtils()));
	Label stateLabel = new Label("ticketState", t.state);
	WicketUtils.setTicketCssClass(stateLabel, t.state);
	add(stateLabel);
	add(new Label("ticketTags", StringUtils.flattenStrings(t.tags)));

	ListDataProvider<Comment> commentsDp = new ListDataProvider<Comment>(t.comments);
	DataView<Comment> commentsView = new DataView<Comment>("comment", commentsDp) {
		private static final long serialVersionUID = 1L;
		int counter;

		public void populateItem(final Item<Comment> item) {
			final Comment entry = item.getModelObject();
			item.add(WicketUtils.createDateLabel("commentDate", entry.date, GitBlitWebSession
					.get().getTimezone(), getTimeUtils()));
			item.add(new Label("commentAuthor", entry.author.toLowerCase()));
			item.add(new Label("commentText", prepareComment(entry.text))
					.setEscapeModelStrings(false));
			WicketUtils.setAlternatingBackground(item, counter);
			counter++;
		}
	};
	add(commentsView);
}
 
开发者ID:warpfork,项目名称:gitblit,代码行数:36,代码来源:TicketPage.java

示例10: DocsPage

import org.apache.wicket.markup.repeater.data.ListDataProvider; //导入依赖的package包/类
public DocsPage(PageParameters params) {
	super(params);

	Repository r = getRepository();
	List<String> extensions = GitBlit.getStrings(Keys.web.markdownExtensions);
	List<PathModel> paths = JGitUtils.getDocuments(r, extensions);

	final ByteFormat byteFormat = new ByteFormat();

	add(new Label("header", getString("gb.docs")));

	// documents list
	ListDataProvider<PathModel> pathsDp = new ListDataProvider<PathModel>(paths);
	DataView<PathModel> pathsView = new DataView<PathModel>("document", pathsDp) {
		private static final long serialVersionUID = 1L;
		int counter;

		public void populateItem(final Item<PathModel> item) {
			PathModel entry = item.getModelObject();
			item.add(WicketUtils.newImage("docIcon", "file_world_16x16.png"));
			item.add(new Label("docSize", byteFormat.format(entry.size)));
			item.add(new LinkPanel("docName", "list", entry.name, BlobPage.class, WicketUtils
					.newPathParameter(repositoryName, entry.commitId, entry.path)));

			// links
			item.add(new BookmarkablePageLink<Void>("view", BlobPage.class, WicketUtils
					.newPathParameter(repositoryName, entry.commitId, entry.path)));
			item.add(new BookmarkablePageLink<Void>("raw", RawPage.class, WicketUtils
					.newPathParameter(repositoryName, entry.commitId, entry.path)));
			item.add(new BookmarkablePageLink<Void>("blame", BlamePage.class, WicketUtils
					.newPathParameter(repositoryName, entry.commitId, entry.path)));
			item.add(new BookmarkablePageLink<Void>("history", HistoryPage.class, WicketUtils
					.newPathParameter(repositoryName, entry.commitId, entry.path)));
			WicketUtils.setAlternatingBackground(item, counter);
			counter++;
		}
	};
	add(pathsView);
}
 
开发者ID:warpfork,项目名称:gitblit,代码行数:40,代码来源:DocsPage.java

示例11: TicketsPage

import org.apache.wicket.markup.repeater.data.ListDataProvider; //导入依赖的package包/类
public TicketsPage(PageParameters params) {
	super(params);

	List<TicketModel> tickets = TicgitUtils.getTickets(getRepository());

	ListDataProvider<TicketModel> ticketsDp = new ListDataProvider<TicketModel>(tickets);
	DataView<TicketModel> ticketsView = new DataView<TicketModel>("ticket", ticketsDp) {
		private static final long serialVersionUID = 1L;
		int counter;

		public void populateItem(final Item<TicketModel> item) {
			final TicketModel entry = item.getModelObject();
			Label stateLabel = new Label("ticketState", entry.state);
			WicketUtils.setTicketCssClass(stateLabel, entry.state);
			item.add(stateLabel);
			item.add(WicketUtils.createDateLabel("ticketDate", entry.date, GitBlitWebSession
					.get().getTimezone(), getTimeUtils()));
			item.add(new Label("ticketHandler", StringUtils.trimString(
					entry.handler.toLowerCase(), 30)));
			item.add(new LinkPanel("ticketTitle", "list subject", StringUtils.trimString(
					entry.title, 80), TicketPage.class, newPathParameter(entry.name)));

			WicketUtils.setAlternatingBackground(item, counter);
			counter++;
		}
	};
	add(ticketsView);
}
 
开发者ID:warpfork,项目名称:gitblit,代码行数:29,代码来源:TicketsPage.java

示例12: CommitLegendPanel

import org.apache.wicket.markup.repeater.data.ListDataProvider; //导入依赖的package包/类
public CommitLegendPanel(String id, List<PathChangeModel> paths) {
	super(id);
	final Map<ChangeType, AtomicInteger> stats = getChangedPathsStats(paths);
	ListDataProvider<ChangeType> legendDp = new ListDataProvider<ChangeType>(
			new ArrayList<ChangeType>(stats.keySet()));
	DataView<ChangeType> legendsView = new DataView<ChangeType>("legend", legendDp) {
		private static final long serialVersionUID = 1L;

		public void populateItem(final Item<ChangeType> item) {
			ChangeType entry = item.getModelObject();

			Label changeType = new Label("changeType", "");
			WicketUtils.setChangeTypeCssClass(changeType, entry);
			item.add(changeType);
			int count = stats.get(entry).intValue();
			String description = "";
			switch (entry) {
			case ADD:
				description = MessageFormat.format(getString("gb.filesAdded"), count);
				break;
			case MODIFY:
				description = MessageFormat.format(getString("gb.filesModified"), count);
				break;
			case DELETE:
				description = MessageFormat.format(getString("gb.filesDeleted"), count);
				break;
			case COPY:
				description = MessageFormat.format(getString("gb.filesCopied"), count);
				break;
			case RENAME:
				description = MessageFormat.format(getString("gb.filesRenamed"), count);
				break;
			}
			item.add(new Label("description", description));
		}
	};
	add(legendsView);
}
 
开发者ID:warpfork,项目名称:gitblit,代码行数:39,代码来源:CommitLegendPanel.java

示例13: FederationRegistrationsPanel

import org.apache.wicket.markup.repeater.data.ListDataProvider; //导入依赖的package包/类
public FederationRegistrationsPanel(String wicketId) {
	super(wicketId);

	final List<FederationModel> list = new ArrayList<FederationModel>(GitBlit.self()
			.getFederationRegistrations());
	list.addAll(GitBlit.self().getFederationResultRegistrations());
	Collections.sort(list);
	hasRegistrations = list.size() > 0;
	DataView<FederationModel> dataView = new DataView<FederationModel>("row",
			new ListDataProvider<FederationModel>(list)) {
		private static final long serialVersionUID = 1L;
		private int counter;

		@Override
		protected void onBeforeRender() {
			super.onBeforeRender();
			counter = 0;
		}

		public void populateItem(final Item<FederationModel> item) {
			final FederationModel entry = item.getModelObject();
			item.add(new LinkPanel("url", "list", entry.url, FederationRegistrationPage.class,
					WicketUtils.newRegistrationParameter(entry.url, entry.name)));
			item.add(WicketUtils.getPullStatusImage("statusIcon", entry.getLowestStatus()));
			item.add(new LinkPanel("name", "list", entry.name,
					FederationRegistrationPage.class, WicketUtils.newRegistrationParameter(
							entry.url, entry.name)));

			item.add(WicketUtils.getRegistrationImage("typeIcon", entry, this));

			item.add(WicketUtils.createDateLabel("lastPull", entry.lastPull, getTimeZone(), getTimeUtils()));
			item.add(WicketUtils
					.createTimestampLabel("nextPull", entry.nextPull, getTimeZone(), getTimeUtils()));
			item.add(new Label("frequency", entry.frequency));
			WicketUtils.setAlternatingBackground(item, counter);
			counter++;
		}
	};
	add(dataView);
}
 
开发者ID:warpfork,项目名称:gitblit,代码行数:41,代码来源:FederationRegistrationsPanel.java

示例14: DropDownMenu

import org.apache.wicket.markup.repeater.data.ListDataProvider; //导入依赖的package包/类
public DropDownMenu(String id, String label, final DropDownMenuRegistration menu) {
	super(id);

	add(new Label("label", label).setRenderBodyOnly(true));
	ListDataProvider<DropDownMenuItem> items = new ListDataProvider<DropDownMenuItem>(
			menu.menuItems);
	DataView<DropDownMenuItem> view = new DataView<DropDownMenuItem>("menuItems", items) {
		private static final long serialVersionUID = 1L;

		public void populateItem(final Item<DropDownMenuItem> item) {
			DropDownMenuItem entry = item.getModelObject();
			if (entry.isDivider()) {
				item.add(new Label("menuItem").setRenderBodyOnly(true));
				WicketUtils.setCssClass(item, "divider");
			} else {
				String icon = null;
				if (entry.isSelected()) {
					icon = "icon-ok";
				} else {
					icon = "icon-ok-white";
				}
				item.add(new LinkPanel("menuItem", icon, null, entry.toString(), menu.pageClass,
						entry.getPageParameters(), false).setRenderBodyOnly(true));
			}
		}
	};
	add(view);
	setRenderBodyOnly(true);
}
 
开发者ID:warpfork,项目名称:gitblit,代码行数:30,代码来源:DropDownMenu.java

示例15: TicketsPage

import org.apache.wicket.markup.repeater.data.ListDataProvider; //导入依赖的package包/类
public TicketsPage(PageParameters params) {
	super(params);

	List<TicketModel> tickets = TicgitUtils.getTickets(getRepository());

	// header
	add(new LinkPanel("header", "title", repositoryName, SummaryPage.class,
			newRepositoryParameter()));

	ListDataProvider<TicketModel> ticketsDp = new ListDataProvider<TicketModel>(tickets);
	DataView<TicketModel> ticketsView = new DataView<TicketModel>("ticket", ticketsDp) {
		private static final long serialVersionUID = 1L;
		int counter;

		public void populateItem(final Item<TicketModel> item) {
			final TicketModel entry = item.getModelObject();
			Label stateLabel = new Label("ticketState", entry.state);
			WicketUtils.setTicketCssClass(stateLabel, entry.state);
			item.add(stateLabel);
			item.add(WicketUtils.createDateLabel("ticketDate", entry.date, GitBlitWebSession
					.get().getTimezone(), getTimeUtils()));
			item.add(new Label("ticketHandler", StringUtils.trimString(
					entry.handler.toLowerCase(), 30)));
			item.add(new LinkPanel("ticketTitle", "list subject", StringUtils.trimString(
					entry.title, 80), TicketPage.class, newPathParameter(entry.name)));

			WicketUtils.setAlternatingBackground(item, counter);
			counter++;
		}
	};
	add(ticketsView);
}
 
开发者ID:BullShark,项目名称:IRCBlit,代码行数:33,代码来源:TicketsPage.java


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