本文整理汇总了Java中org.apache.wicket.markup.repeater.Item.getModelObject方法的典型用法代码示例。如果您正苦于以下问题:Java Item.getModelObject方法的具体用法?Java Item.getModelObject怎么用?Java Item.getModelObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.wicket.markup.repeater.Item
的用法示例。
在下文中一共展示了Item.getModelObject方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ForAdmins
import org.apache.wicket.markup.repeater.Item; //导入方法依赖的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);
}
示例2: getTeamListing
import org.apache.wicket.markup.repeater.Item; //导入方法依赖的package包/类
private DataView<TeamMembership> getTeamListing() {
return new DataView<TeamMembership>("teams", provider = new TeamProvider(user)) {
@Override
protected void populateItem(Item<TeamMembership> item) {
final TeamMembership team = item.getModelObject();
Check<TeamMembership> check = newDeleteCheck(item);
List<Role> roles = new ArrayList<>(Arrays.asList(Role.teamAssignableRoles()));
item.add(check);
DropDownChoice<Role> roleSelector = new DropDownChoice<>("td.role",
new PropertyModel<Role>(team, "role"), roles
);
roleSelector.setNullValid(false);
item.add(roleSelector);
BookmarkablePageLink<TeamEditPage> editTeamLink = new BookmarkablePageLink<>("link.edit.team", TeamEditPage.class, new PageParameters().add("id", team.getTeam().getId()));
editTeamLink.add(new Label("td.teamname", new PropertyModel<>(team.getTeam(), "name")));
item.add(editTeamLink);
item.setOutputMarkupId(true);
}
};
}
示例3: populateItem
import org.apache.wicket.markup.repeater.Item; //导入方法依赖的package包/类
@Override
public void populateItem(Item<LdapUser> item, Check<LdapUser> check) {
LdapUser user = item.getModelObject();
item.add(new Label("username", new PropertyModel(user, "userName")));
item.add(new ExternalLink("mail", "mailto:" + user.getMail()).add(new Label("mailText", new PropertyModel(user, "mail"))));
item.add(new Label("firstName", new PropertyModel(user, "firstName")));
item.add(new Label("lastName", new PropertyModel(user, "lastName")));
item.add(new Image("photo", user.hasProfilePicture() ? user.getProfilePictureImage() : anonymousPicture));
if (isSelectionEnabled()) {
if (userService.ldapBasedUserExists(user)) {
check.setVisible(false);
item.add(new AttributeAppender("class", Model.of("warning")));
item.add(new AttributeAppender("title", new StringResourceModel("table.users.warning.exists", this, null)));
} else {
item.add(new AttributeAppender("class", Model.of("success")));
}
}
}
示例4: populateDataViewItem
import org.apache.wicket.markup.repeater.Item; //导入方法依赖的package包/类
@Override
protected void populateDataViewItem(Item<QualityIndicator> item) {
final QualityIndicator entity = item.getModelObject();
BookmarkablePageLink<QualityIndicatorEditPage> link = new BookmarkablePageLink<>("link",
QualityIndicatorEditPage.class, QualityIndicatorEditPage.forQualityIndicator(entity));
link.add(new Label("name", Model.of(entity.getName()
+ " (" + entity.getNodeKey() + ")")).setRenderBodyOnly(true));
item.add(link);
BookmarkablePageLink<ProjectViewPage> projectLink = new BookmarkablePageLink<>("project",
ProjectViewPage.class, ProjectViewPage.forProject(entity.getProject()));
projectLink.add(new Label("projectKey", Model.of(entity.getProject().getNodeKey())));
item.add(projectLink);
item.add(new Label("value", Model.of(entity.getValue())));
}
示例5: populateDataViewItem
import org.apache.wicket.markup.repeater.Item; //导入方法依赖的package包/类
@Override
protected void populateDataViewItem(Item<Metric> item) {
final Metric entity = item.getModelObject();
BookmarkablePageLink<MetricEditPage> link = new BookmarkablePageLink<>("link",
MetricEditPage.class, MetricEditPage.forMetric(entity));
link.add(new Label("name", Model.of(entity.getName()
+ " (" + entity.getNodeKey() + ")")).setRenderBodyOnly(true));
item.add(link);
BookmarkablePageLink<ProjectViewPage> projectLink = new BookmarkablePageLink<>("project",
ProjectViewPage.class, ProjectViewPage.forProject(entity.getProject()));
projectLink.add(new Label("projectKey", Model.of(entity.getProject().getNodeKey())));
item.add(projectLink);
item.add(new Label("source", Model.of(entity.getMetricSource())));
item.add(new Label("value", Model.of(entity.getValue())));
}
示例6: populateDataViewItem
import org.apache.wicket.markup.repeater.Item; //导入方法依赖的package包/类
@Override
protected void populateDataViewItem(Item<QMMetric> item) {
final QMMetric entity = item.getModelObject();
BookmarkablePageLink<QMMetricEditPage> link = new BookmarkablePageLink<>("link",
QMMetricEditPage.class, QMMetricEditPage.forMetric(entity));
link.add(new Label("name", Model.of(entity.getName()
+ " (" + entity.getNodeKey() + ")")).setRenderBodyOnly(true));
item.add(link);
BookmarkablePageLink<QModelViewPage> QMlink = new BookmarkablePageLink<>("qmodel",
QModelViewPage.class, QModelViewPage.forQModel(entity.getQModel()));
QMlink.add(new Label("qmKey", Model.of(entity.getQModel().getNodeKey())));
item.add(QMlink);
item.add(new Label("value", Model.of(entity.getTargetValue())));
}
示例7: populateDataViewItem
import org.apache.wicket.markup.repeater.Item; //导入方法依赖的package包/类
@Override
protected void populateDataViewItem(Item<QMQualityIndicator> item) {
final QMQualityIndicator entity = item.getModelObject();
BookmarkablePageLink<QMQualityIndicatorEditPage> link = new BookmarkablePageLink<>("link",
QMQualityIndicatorEditPage.class, QMQualityIndicatorEditPage.forQualityIndicator(entity));
link.add(new Label("name", Model.of(entity.getName()
+ " (" + entity.getNodeKey() + ")")).setRenderBodyOnly(true));
item.add(link);
BookmarkablePageLink<QModelViewPage> QMlink = new BookmarkablePageLink<>("qmodel",
QModelViewPage.class, QModelViewPage.forQModel(entity.getQModel()));
QMlink.add(new Label("qmKey", Model.of(entity.getQModel().getNodeKey())));
item.add(QMlink);
item.add(new Label("value", Model.of(entity.getTargetValue())));
}
示例8: populateDataViewItem
import org.apache.wicket.markup.repeater.Item; //导入方法依赖的package包/类
@Override
protected void populateDataViewItem(Item<User> item) {
final User entity = item.getModelObject();
BookmarkablePageLink<User> link = new BookmarkablePageLink<>("link",
UserEditPage.class, UserEditPage.linkToEdit(entity));
link.add(new Label("name", Model.of(entity.getFullNameWithUserName())).setRenderBodyOnly(true));
item.add(link);
item.add(new Label("role", Model.of(entity.getRole())));
item.add(new Label("email", Model.of(entity.getMail())));
}
示例9: createDataTable
import org.apache.wicket.markup.repeater.Item; //导入方法依赖的package包/类
private void createDataTable( List<RequestMod> mods )
{
DataView< RequestMod > view = new DataView<RequestMod>("modstable", createDataProvider( mods ) )
{
private static final long serialVersionUID = 1L;
@Override
protected void populateItem(final Item<RequestMod> item)
{
RequestMod mod = item.getModelObject();
item.add( new Label( "index", mod.getIndex() ) );
item.add( new Label( "type", mod.getType() ) );
item.add( new Label( "name", mod.getName() ) );
item.add( new Label( "value", mod.getValue() ) );
item.add( AttributeModifier.replace( "class", new AbstractReadOnlyModel<String>()
{
private static final long serialVersionUID = 1L;
@Override
public String getObject()
{
return ( item.getIndex() % 2 == 1 ) ? "even" : "odd";
}
} ));
}
};
addOrReplace( view );
}
示例10: populateDataViewItem
import org.apache.wicket.markup.repeater.Item; //导入方法依赖的package包/类
@Override
protected void populateDataViewItem(Item<Process> item) {
final Process entity = item.getModelObject();
BookmarkablePageLink<Process> link = new BookmarkablePageLink<>("link",
ProcessAddEditPage.class, ProcessAddEditPage.linkToEdit(entity));
link.add(new Label("name", Model.of(entity.getName())).
setRenderBodyOnly(true));
item.add(link);
item.add(new Label("description", Model.of(entity.getDescription())));
item.add(new Label("startdate", Model.of(entity.getStartDate())));
item.add(new Label("enddate", Model.of(entity.getEndDate())));
}
示例11: populateDataViewItem
import org.apache.wicket.markup.repeater.Item; //导入方法依赖的package包/类
@Override
protected void populateDataViewItem(Item<QModel> item) {
final QModel entity = item.getModelObject();
BookmarkablePageLink<QModelViewPage> link = new BookmarkablePageLink<>("link",
QModelViewPage.class, QModelViewPage.forQModel(entity));
link.add(new Label("name", Model.of(entity.getName()
+ " (" + entity.getNodeKey() + ")")).setRenderBodyOnly(true));
item.add(link);
item.add(new Label("description", Model.of(entity.getDescription())));
}
示例12: populateDataViewItem
import org.apache.wicket.markup.repeater.Item; //导入方法依赖的package包/类
@Override
protected void populateDataViewItem(Item<Product> item) {
final Product entity = item.getModelObject();
BookmarkablePageLink<Product> link = new BookmarkablePageLink<>("link",
ProductAddEditPage.class, ProductAddEditPage.linkToEdit(entity));
link.add(new Label("name", Model.of(entity.getName())).setRenderBodyOnly(true));
item.add(link);
item.add(new Label("description", Model.of(entity.getDescription())));
item.add(new Label("version", Model.of(entity.getVersion())));
item.add(new Label("date", Model.of(entity.getReleaseDate())));
}
示例13: populateDataViewItem
import org.apache.wicket.markup.repeater.Item; //导入方法依赖的package包/类
@Override
protected void populateDataViewItem(Item<Project> item) {
// TODO add quality indicator icon!
final Project entity = item.getModelObject();
BookmarkablePageLink<ProjectViewPage> link = new BookmarkablePageLink<>("link",
ProjectViewPage.class, ProjectViewPage.forProject(entity));
link.add(new Label("name", Model.of(entity.getName()
+ " (" + entity.getNodeKey() + ")")).setRenderBodyOnly(true));
item.add(link);
item.add(new Label("startdate", Model.of(entity.getStartDate())));
item.add(new Label("enddate", Model.of(entity.getEndDate())));
item.add(new Label("progress", Model.of(entity.
getElapsedVsRemainingWithPercentageString())));
}
示例14: ViewGroupPage
import org.apache.wicket.markup.repeater.Item; //导入方法依赖的package包/类
public ViewGroupPage(PageParameters param) {
super(ListGroupsPage.class, param);
final Long groupId = param.get("gid").toLong();
//BACK
add(new BookmarkablePageLink<ListGroupsPage>("back-to-groups",ListGroupsPage.class));
//FILTER
final Filter filter = new Filter();
final Form<Filter> filtersForm = new Form<>("filter-form", new Model<>(filter));
add(filtersForm);
filtersForm.add(new TextField<>("action-name-substr", new PropertyModel<String>(filter, "actionNameSubstring")));
//GROUP PROPERTIES
final UIGroupForView curGroup = groupService.getGroupById(groupId);
add(new Label("groupName", curGroup.getName()));
add(new Label("groupSubsystem", curGroup.getSubsystemName()));
// SORTABLE DATA PROVIDER
String[] fieldName = { "groupId","groupName","subsystemName","actionId", "actionName" };
final SortableDataProvider<UIActionForCheckboxForGroup, String> actionDataProvider = new IndexedSortableDataProvider<UIActionForCheckboxForGroup>(fieldName) {
private static final long serialVersionUID = 1L;
public Iterator<? extends UIActionForCheckboxForGroup> iterator(long first,
long count) {
List<UIActionForCheckboxForGroup> list = groupService.getAllGroupMappedActions(first, count,
getSortFieldIndex(), isAscending(), groupId, filter.getActionNameSubstring());
return list.iterator();
}
public long size() {
return groupService.getAllGroupMappedActionsCount(groupId, filter.getActionNameSubstring());
}
};
// DATAVIEW
final DataView<UIActionForCheckboxForGroup> actionDataView = new PagingDataView<UIActionForCheckboxForGroup>("dataView",actionDataProvider){
private static final long serialVersionUID = 1L;
@Override
protected void populateItem(Item<UIActionForCheckboxForGroup> item) {
final UIActionForCheckboxForGroup action = item.getModelObject();
item.add(new Label("action-id",String.valueOf(action.getActionId())));
item.add(new Label("action-name",action.getActionName()));
}
};
add(actionDataView);
add(new OrderByLink<>("order-by-ActionID", "actionId", actionDataProvider));
add(new OrderByLink<>("order-by-ActionName", "actionName", actionDataProvider));
add(new SuperflyPagingNavigator("paging-navigator", actionDataView));
add(new BookmarkablePageLink("group-actions", ChangeGroupActionsPage.class, PageParametersBuilder.fromPair("gid", groupId)));
}
示例15: populateDataViewItem
import org.apache.wicket.markup.repeater.Item; //导入方法依赖的package包/类
@Override
protected void populateDataViewItem(Item<Team> item) {
final Team entity = item.getModelObject();
BookmarkablePageLink<TeamEditPage> link = new BookmarkablePageLink<>("link",
TeamEditPage.class, TeamEditPage.linkToEdit(entity));
link.add(new Label("name", Model.of(entity.getName())).setRenderBodyOnly(true));
item.add(link);
item.add(new Label("description", Model.of(entity.getDescription())));
item.add(new Label("member", Model.of(entity.getAllUsers())));
}