本文整理汇总了Java中org.apache.wicket.markup.repeater.Item.add方法的典型用法代码示例。如果您正苦于以下问题:Java Item.add方法的具体用法?Java Item.add怎么用?Java Item.add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.wicket.markup.repeater.Item
的用法示例。
在下文中一共展示了Item.add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: populateItem
import org.apache.wicket.markup.repeater.Item; //导入方法依赖的package包/类
@Override
protected void populateItem(Item<Var> item) {
String name = item.getModel().getObject().getName();
item.add(new AjaxLink("show") {
@Override
public void onClick(AjaxRequestTarget target) {
selectedName = name;
Component headerPanel = getPage().get(BasePage.STICKY_HEADER_ID);
VarModel varModel = new VarModel(model.getSessionId(), name);
VarPanel varPanel = new VarPanel(BasePage.STICKY_HEADER_ID, varModel, VarsRefreshingView.this);
headerPanel = headerPanel.replaceWith(varPanel);
target.add(headerPanel);
Component varsPanel = getPage().get(BasePage.LEFT_NAV_ID);
target.add(varsPanel);
}
}.add(new Label("name", name)));
String type = item.getModel().getObject().getValue().getTypeAsShortString();
item.add(new Label("type", type));
if (name.equals(selectedName)) {
item.add(new AttributeModifier("class", "success"));
}
}
示例2: populateCrawlRow
import org.apache.wicket.markup.repeater.Item; //导入方法依赖的package包/类
private void populateCrawlRow(Item<Crawl> item) {
item.add(new AjaxLink<Crawl>("edit", item.getModel()) {
@Override
public void onClick(AjaxRequestTarget target) {
editCrawl(target, getModel());
}
}.add(new Label("crawlName")));
item.add(new Label("seedList.name"));
item.add(new Label("progress"));
item.add(createStatusLabel());
item.add(new Link<Crawl>("start", item.getModel()) {
@Override
public void onClick() {
crawlService.startCrawl(getModelObject().getId(), getCurrentInstance());
}
});
item.add(new Link<Crawl>("delete", item.getModel()) {
@Override
public void onClick() {
crawlService.deleteCrawl(getModelObject().getId());
}
});
}
示例3: populateItem
import org.apache.wicket.markup.repeater.Item; //导入方法依赖的package包/类
@Override
protected void populateItem(Item<Count> item) {
//model for actual value
final PropertyModel<String> valueModel = new PropertyModel<>(item.getModel(), "name");
//checkbox
final Component selector = createValueCheckbox("selector", valueModel.getObject());
item.add(selector);
//label
item.add(new WebMarkupContainer("label")
//child label
.add(new FieldValueLabel("name", valueModel, fieldNameModel))
//count label
.add(new Label("count", new PropertyModel<String>(item.getModel(), "count")))
//reference to checkbox
.add(new AttributeModifier("for", selector.getMarkupId()))
.add(new AttributeAppender("class", valueModel, " "))
);
//description as tooltip (title)
final IModel<FieldValueDescriptor> descriptorModel = new MapValueModel<>(descriptorsModel, valueModel);
final IModel<String> descriptionModel = new PropertyModel<>(descriptorModel, "description");
item.add(new AttributeModifier("title", descriptionModel));
}
示例4: SettingsPage
import org.apache.wicket.markup.repeater.Item; //导入方法依赖的package包/类
public SettingsPage() {
settingsTable = new WebMarkupContainer("settingsTable");
settingsTable.setOutputMarkupId(true);
RefreshingView<NutchConfig> nutchConfig = new RefreshingView<NutchConfig>(
"settings") {
@Override
protected Iterator<IModel<NutchConfig>> getItemModels() {
return new CpmIteratorAdapter<NutchConfig>(
convertNutchConfig(nutchService.getNutchConfig(getCurrentInstance()
.getId())));
}
@Override
protected void populateItem(Item<NutchConfig> item) {
item.add(new Label("name"));
item.add(new TextField<String>("value"));
}
};
settingsTable.add(nutchConfig);
add(settingsTable);
}
示例5: populateItem
import org.apache.wicket.markup.repeater.Item; //导入方法依赖的package包/类
@Override
public void populateItem(Item<ICellPopulator<T>> cellItem, String componentId,
final IModel<T> rowModel) {
IModel model = createLinkModel(rowModel);
cellItem.add(new LinkPanel(componentId, model) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
LinkColumn.this.onClick(target, rowModel);
}
@Override
public boolean isEnabled() {
return LinkColumn.this.isEnabled(rowModel);
}
});
}
示例6: populateItem
import org.apache.wicket.markup.repeater.Item; //导入方法依赖的package包/类
@Override
public void populateItem(Item<ICellPopulator<T>> cellItem, String componentId,
final IModel<T> rowModel) {
IModel<ObjectType> superModel = createLinkModel(rowModel);
final ObjectType targetObjectType = superModel.getObject();
IModel<String> nameModel = new PropertyModel<String>(superModel, FocusType.F_NAME.getLocalPart() + ".orig");
cellItem.add(new LinkPanel(componentId, nameModel) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
ObjectLinkColumn.this.onClick(target, rowModel, targetObjectType);
}
@Override
public boolean isEnabled() {
return ObjectLinkColumn.this.isEnabled(rowModel);
}
});
}
示例7: newRowItem
import org.apache.wicket.markup.repeater.Item; //导入方法依赖的package包/类
@Override
protected Item<T> newRowItem(final String id, final int index, final IModel<T> model) {
final Item<T> rowItem = new Item<T>(id, index, model);
rowItem.add(
new AjaxEventBehavior("onclick") {
private static final long serialVersionUID = 6720512493017210281L;
@Override
protected void onEvent(final AjaxRequestTarget target) {
// callback or do some stuff
}
});
return rowItem;
}
示例8: populateItem
import org.apache.wicket.markup.repeater.Item; //导入方法依赖的package包/类
@Override
public void populateItem(final Item<ICellPopulator<T>> cellItem, String componentId,
final IModel<T> rowModel) {
IModel<Boolean> selected = getCheckBoxValueModel(rowModel);
CheckBoxPanel check = new CheckBoxPanel(componentId, selected, enabled) {
@Override
public void onUpdate(AjaxRequestTarget target) {
DataTable table = findParent(DataTable.class);
onUpdateRow(target, table, rowModel);
//updating table row
// target.add(cellItem.findParent(SelectableDataTable.SelectableRowItem.class));
}
};
check.setOutputMarkupId(true);
cellItem.add(check);
}
示例9: populateItem
import org.apache.wicket.markup.repeater.Item; //导入方法依赖的package包/类
@Override
public void populateItem(Item<ICellPopulator<BuildsDiffActionableItem>> item, String componentId,
final IModel<BuildsDiffActionableItem> model) {
item.add(new Label(componentId, createLabelModel(model)) {
@Override
protected void onBeforeRender() {
super.onBeforeRender();
BuildsDiffStatus status = model.getObject().getStatus();
if (BuildsDiffStatus.NEW.equals(status)) {
add(new CssClass("green-listed-label"));
} else if (BuildsDiffStatus.UPDATED.equals(status)) {
add(new CssClass("blue-listed-label"));
} else if (BuildsDiffStatus.REMOVED.equals(status)) {
add(new CssClass("light-gray-listed-label"));
}
}
});
}
示例10: newRowItem
import org.apache.wicket.markup.repeater.Item; //导入方法依赖的package包/类
@Override
protected Item<T> newRowItem(final String id, final int index, final IModel<T> model) {
Item<T> item = super.newRowItem(id, index, model);
if (canAddRowItemDoubleClickBehavior(model)) {
item.add(new AjaxEventBehavior("ondblclick") {
@Override
protected void onEvent(AjaxRequestTarget target) {
onRowItemEvent(id, index, model, target);
}
@Override
protected IAjaxCallDecorator getAjaxCallDecorator() {
return new CancelDefaultDecorator();
}
});
}
return item;
}
示例11: 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")));
}
}
}
示例12: 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);
}
};
}
示例13: createRealmColumn
import org.apache.wicket.markup.repeater.Item; //导入方法依赖的package包/类
private PropertyColumn<UserModel> createRealmColumn() {
return new PropertyColumn<UserModel>(Model.of("Realm"), "realm", "realm") {
@Override
public void populateItem(Item<ICellPopulator<UserModel>> item, String componentId,
final IModel<UserModel> model) {
String realm;
UserModel userModel = model.getObject();
if (userModel.isAnonymous()) {
realm = "";
} else if (StringUtils.isBlank(userModel.getRealm())) {
realm = "Will be updated on next login";
item.add(new CssClass("gray-listed-label"));
} else {
realm = StringUtils.capitalize(userModel.getRealm());
}
item.add(new Label(componentId, Model.of(realm)));
}
};
}
示例14: 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())));
}
示例15: SeedListsPage
import org.apache.wicket.markup.repeater.Item; //导入方法依赖的package包/类
public SeedListsPage() {
RefreshingView<SeedList> seedLists = new RefreshingView<SeedList>(
"seedLists") {
@Override
protected Iterator<IModel<SeedList>> getItemModels() {
return new CpmIteratorAdapter<SeedList>(seedListService.findAll());
}
@Override
protected void populateItem(final Item<SeedList> item) {
PageParameters params = new PageParameters();
params.add("id", item.getModelObject().getId());
Link<Void> edit = new BookmarkablePageLink<Void>("edit",
SeedPage.class, params);
edit.add(new Label("name"));
item.add(edit);
item.add(new Label("seedUrlsCount"));
item.add(new Link<SeedList>("delete", item.getModel()) {
@Override
public void onClick() {
seedListService.delete(item.getModelObject().getId());
}
});
}
};
add(seedLists);
add(new BookmarkablePageLink<Void>("newSeedList", SeedPage.class));
}