@Override public void populateItem(Item<ICellPopulator<T>> item, String componentId, IModel<T> rowModel) { item.add(new Label(componentId, getDataModel(rowModel))); }
/** * Implementation of populateItem which adds a label to the cell whose model is the provided * property expression evaluated against rowModelObject * * @see ICellPopulator#populateItem(Item, String, IModel) */ @Override public void populateItem(final Item<ICellPopulator<T>> item, final String componentId, final IModel<T> rowModel) { item.add(new Label(componentId, getDataModel(rowModel))); }
protected void addLinkBehavior(final Item<ICellPopulator<T>> item, final IModel<T> model) { if (isLink()) { item.add(new AjaxEventBehavior("onclick") { @Override protected void onEvent(AjaxRequestTarget target) { ListDataTable dataTable = item.findParent(ListDataTable.class); dataTable.getSelectionListener().selectionChanged(model); } }); } }
@Override protected void populateViewItem(Item<IRenderService> item, final JcrNodeModel model) { Fragment fragment = new TransparentFragment("fragment", "view-fragment", this); item.add(fragment); }
/** * @deprecated Deprecated in favor of {@link #populateViewItem(Item, JcrPropertyValueModel)} */ @Deprecated @Override protected void populateViewItem(Item<IRenderService> item) { Fragment fragment = new TransparentFragment("fragment", "view-fragment", this); item.add(fragment); }
public void populateItem(final Item<Component> item) { Component menuItem = item.getModelObject(); item.add(menuItem); } });
@Override public void populateItem(final Item item) { MenuItem menuItem = (MenuItem) item.getModelObject(); item.add(menuItem); } });
protected Item newGroupCellItem(String id, int index, IModel<T> model) { Item item = new Item<>(id, index, model); String colspan = String.valueOf(getColumns().size()); item.add(new AttributeModifier("colspan", colspan)); item.add(new CssClass("first-cell last-cell")); item.add(new JavascriptEvent("onclick", "GroupableTable.collapseExpand(this);")); return item; }
/** * @see org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator#populateItem(org.apache.wicket.markup.repeater.Item, * java.lang.String, org.apache.wicket.model.IModel) */ @Override public void populateItem(final Item<ICellPopulator<T>> cellItem, final String componentId, final IModel<T> rowModel) { cellItem.add(new Label(componentId, new PropertyModel<>(rowModel, property))); } }
@Override protected void populateItem(Item<String> item) { Label label = new Label("stat", item.getModel()); label.setEscapeModelStrings(false); item.add(label); } });
protected Item newGroupRowItem(String id, int index, IModel<T> model) { Item<T> item = new Item<>(id, index, model); item.add(new CssClass("group-header-row")); if (isGroupExpanded(item)) { item.add(new CssClass("group-expanded")); } else { item.add(new CssClass("group-collapsed")); } return item; }
@Override public void populateItem(Item<ICellPopulator<TreeNode>> item, String componentId, IModel<TreeNode> rowModel) { item.add(new Label(componentId, Bytes.bytes(rowModel.getObject().getSize()) .toString())); }
protected void addCssClasses(Item<ICellPopulator<T>> item) { if (isLink()) { item.add(CssClass.append("link")); } }
protected Item<?> addCSSIcon(String icon) { WebMarkupContainer markupContainer = new WebMarkupContainer("css-icon"); item.add(markupContainer); markupContainer.add(new AttributeModifier("class", icon)); Image image = new Image("regular-image", "not-there.gif"); image.setVisible(false); item.add(image); return item; } }
@Override protected void populateItem(Item<SInstance> item) { BSGrid grid = new BSGrid("_r"); buildHeader(item, grid); buildBody(item, grid); item.add(grid); }
@Override public Item<?> caseProjectLocale(ProjectLocale object) { if(object.getLocale()==null || object.getLocale()==ProjectLocale.TEMPLATE_LOCALE) return addCSSIcon("icon-book"); WebMarkupContainer markupContainer = new WebMarkupContainer("css-icon"); item.add(markupContainer); markupContainer.setVisible(false); Image image = new Image("regular-image", WicketUtil.getIconForLocale(object.getLocale())); item.add(image); return item; }
@Override protected void populateItem(Item<SInstance> item) { final BSGrid grid = new BSGrid("_r"); final ViewMode viewMode = ctx.getViewMode(); buildHeader(item, grid, viewMode); buildBody(item, grid, viewMode); item.add(grid); }
@Override public void populateItem(Item<ICellPopulator<T>> cellItem, String componentId, IModel<T> rowModel) { NodeModel<T> nodeModel = (NodeModel<T>)rowModel; Component nodeComponent = getTree().newNodeComponent(componentId, nodeModel.getWrappedModel()); nodeComponent.add(new NodeBorder(nodeModel.getBranches())); cellItem.add(nodeComponent); } }
@Override protected void populateItem(Item<T> item) { final IModel<T> itemModel = item.getModel(); // add row selector (visible only if selection is active) WebMarkupContainer cnt = new WebMarkupContainer("selectItemContainer"); cnt.add(selectOneCheckbox(item)); cnt.setVisible(selectable); item.add(cnt); buildRowListView(dataProvider, item, itemModel); } };