本文整理汇总了Java中org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator类的典型用法代码示例。如果您正苦于以下问题:Java ICellPopulator类的具体用法?Java ICellPopulator怎么用?Java ICellPopulator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ICellPopulator类属于org.apache.wicket.extensions.markup.html.repeater.data.grid包,在下文中一共展示了ICellPopulator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: populateItem
import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator; //导入依赖的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);
}
});
}
示例2: populateItem
import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator; //导入依赖的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);
}
});
}
示例3: populateItem
import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator; //导入依赖的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);
}
示例4: initResultColumns
import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator; //导入依赖的package包/类
private List<IColumn<OperationResult, String>> initResultColumns() {
List<IColumn<OperationResult, String>> columns = new ArrayList<IColumn<OperationResult, String>>();
columns.add(new PropertyColumn<>(createStringResource("pageTaskEdit.opResult.token"), "token"));
columns.add(new PropertyColumn<>(createStringResource("pageTaskEdit.opResult.operation"), "operation"));
columns.add(new PropertyColumn<>(createStringResource("pageTaskEdit.opResult.status"), "status"));
columns.add(new AbstractColumn<OperationResult, String>(createStringResource("pageTaskEdit.opResult.message"), "message") {
@Override
public void populateItem(Item<ICellPopulator<OperationResult>> cellItem, String componentId,
IModel<OperationResult> rowModel) {
Label label = new Label(componentId, new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
return WebComponentUtil.nl2br(rowModel.getObject().getMessage());
}
});
label.setEscapeModelStrings(false);
cellItem.add(label);
}
});
//columns.add(new PropertyColumn(createStringResource("pageTaskEdit.opResult.message"), "message"));
return columns;
}
示例5: addActionColumn
import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator; //导入依赖的package包/类
protected IAddedCoreColumnState<T, S> addActionColumn(IAddedCoreColumnState<T, S> builder) {
return builder
.addColumn(new AbstractCoreColumn<T, S>(new Model<String>()) {
private static final long serialVersionUID = 1L;
@Override
public void populateItem(Item<ICellPopulator<T>> cellItem, String componentId, final IModel<T> rowModel) {
Component rowItem = DataTableUtil.getRowItem(cellItem);
rowItem.add(new ClassAttributeAppender(new LoadableDetachableModel<String>() {
private static final long serialVersionUID = 1L;
@Override
protected String load() {
return rowModel.getObject().isEnabled() ? "enabled" : "disabled";
}
}));
cellItem.add(new ItemActionsFragment(componentId, rowModel));
}
})
.withClass("actions actions-2x");
}
示例6: populateItem
import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator; //导入依赖的package包/类
@Override
protected final void populateItem(final Item<T> item) {
RepeatingView cells = new RepeatingView(CELL_REPEATER_ID);
item.add(cells);
int populatorsNumber = populators.size();
for (int i = 0; i < populatorsNumber; i++) {
ICellPopulator<T> populator = populators.get(i);
IModel<ICellPopulator<T>> populatorModel = new Model<>(populator);
Item<ICellPopulator<T>> cellItem = newCellItem(cells.newChildId(), i, populatorModel);
cells.add(cellItem);
populator.populateItem(cellItem, CELL_ITEM_ID, item.getModel());
if (cellItem.get("cell") == null) {
throw new WicketRuntimeException(
populator.getClass().getName()
+ ".populateItem() failed to add a component with id [" + CELL_ITEM_ID + "] to the provided"
+ " [cellItem] object. Make sure you call add() on cellItem and make sure you gave the added"
+ " component passed in 'componentId' id."
+ " (*cellItem*.add(new MyComponent(*componentId*, rowModel) )");
}
}
}
示例7: newCellItem
import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator; //导入依赖的package包/类
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
protected Item newCellItem(final String id, final int index, final IModel model) {
Item item = CoreDataTable.this.newCellItem(id, index, model);
final ICellPopulator<T> column = internalGetPopulators().get(index);
if (column instanceof IStyledColumn) {
item.add(new ClassAttributeAppender(new AbstractReadOnlyModel<String>() {
private static final long serialVersionUID = 1L;
@Override
public String getObject() {
return ((IStyledColumn<T, S>) column).getCssClass();
}
}));
}
return item;
}
示例8: populateItem
import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator; //导入依赖的package包/类
@Override
public void populateItem(final Item<ICellPopulator<T>> item,
final String componentId, final IModel<T> rowModel) {
IModel date = (IModel<Date>) createLabelModel(rowModel);
String convertedDate = "";
if (date.getObject() != null) {
convertedDate = SyncopeSession.get().
getDateFormat().format(date.getObject());
item.add(new Label(componentId, convertedDate));
} else {
item.add(new Label(componentId, convertedDate));
}
}
示例9: populateItem
import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator; //导入依赖的package包/类
@Override
public void populateItem(Item<ICellPopulator<T>> item, String componentId, IModel<T> model) {
// log.debug("paramEx '{}' - paramName", paramExpression, paramName);
@Nullable
final Object paramValue = new PropertyModel<>(model, paramExpression).getObject();
// "Cannot get '%s' parameter because of null '%s' in %s",
// paramName, paramExpression, model.getObject());
if (paramValue != null) {
final PageParameters params = new PageParameters(paramsTemplate)
.add(paramName, paramValue);
// final LinkPanel<T, S> linkPanel = new LinkPanel<T, S>(componentId, pageClass, params,
// labelModel.or((IModel) getDataModel(model)), tagType);
final LinkPanel<T, S> linkPanel = new LinkPanel<T, S>(componentId, pageClassModel.getObject(), params,
labelModel.or((IModel) getDataModel(model)), tagType);
if (enabled != null) {
linkPanel.setEnabled(enabled.apply(model.getObject()));
}
item.add(linkPanel);
} else {
item.add(new Label(componentId));
}
if (cssClass != null) {
item.add(new AttributeAppender("class", new Model<>(cssClass), " "));
}
}
示例10: createRealmColumn
import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator; //导入依赖的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)));
}
};
}
示例11: addTable
import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator; //导入依赖的package包/类
private SortableTable addTable() {
List<IColumn<PermissionsRow>> columns = Lists.newArrayList();
columns.add(
new AbstractColumn<PermissionsRow>(Model.of("Permission Target"), "permissionTarget.name") {
@Override
public void populateItem(Item<ICellPopulator<PermissionsRow>> cellItem, String componentId,
IModel<PermissionsRow> rowModel) {
cellItem.add(new LinkPanel(componentId, rowModel));
}
});
columns.add(new BooleanColumn<PermissionsRow>("Manage", "manage", "manage"));
columns.add(new BooleanColumn<PermissionsRow>("Delete", "delete", "delete"));
columns.add(new BooleanColumn<PermissionsRow>("Deploy", "deploy", "deploy"));
columns.add(new BooleanColumn<PermissionsRow>("Annotate", "annotate", "annotate"));
columns.add(new BooleanColumn<PermissionsRow>("Read", "read", "read"));
PermissionsTabTableDataProvider dataProvider = new PermissionsTabTableDataProvider(userInfo);
return new SortableTable<>("userPermissionsTable", columns, dataProvider, 10);
}
示例12: populateItem
import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator; //导入依赖的package包/类
@Override
public void populateItem(Item<ICellPopulator<ModuleDependencyActionableItem>> item, String componentId,
final IModel<ModuleDependencyActionableItem> 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"));
}
}
});
}
示例13: populateItem
import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator; //导入依赖的package包/类
@Override
public void populateItem(Item<ICellPopulator<ModuleArtifactActionableItem>> item, String componentId,
final IModel<ModuleArtifactActionableItem> 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"));
}
}
});
}
示例14: populateItem
import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator; //导入依赖的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"));
}
}
});
}
示例15: populateItem
import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator; //导入依赖的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);
}
});
}