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


Java ICellPopulator类代码示例

本文整理汇总了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);
        }
    });
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:20,代码来源:LinkColumn.java

示例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);
        }
    });
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:22,代码来源:ObjectLinkColumn.java

示例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);
    }
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:21,代码来源:CheckBoxColumn.java

示例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;
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:23,代码来源:TaskResultTabPanel.java

示例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");
}
 
开发者ID:openwide-java,项目名称:owsi-core-parent,代码行数:22,代码来源:AbstractGenericListItemListPanel.java

示例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) )");
		}
	}
}
 
开发者ID:openwide-java,项目名称:owsi-core-parent,代码行数:25,代码来源:SequenceGridView.java

示例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;
}
 
开发者ID:openwide-java,项目名称:owsi-core-parent,代码行数:18,代码来源:CoreDataTable.java

示例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));
    }
}
 
开发者ID:ilgrosso,项目名称:oldSyncopeIdM,代码行数:17,代码来源:DatePropertyColumn.java

示例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), " "));
		}
	}
 
开发者ID:lumenrobot,项目名称:lumen,代码行数:27,代码来源:LinkColumn.java

示例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)));
        }
    };
}
 
开发者ID:alancnet,项目名称:artifactory,代码行数:20,代码来源:UsersTable.java

示例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);
}
 
开发者ID:alancnet,项目名称:artifactory,代码行数:21,代码来源:UserPermissionsPanel.java

示例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"));
            }
        }
    });
}
 
开发者ID:alancnet,项目名称:artifactory,代码行数:19,代码来源:ModuleDependencyPropertyColumn.java

示例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"));
            }
        }
    });
}
 
开发者ID:alancnet,项目名称:artifactory,代码行数:19,代码来源:ModuleArtifactPropertyColumn.java

示例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"));
            }
        }
    });
}
 
开发者ID:alancnet,项目名称:artifactory,代码行数:19,代码来源:BuildDiffGroupableColumn.java

示例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);
        }
    });
}
 
开发者ID:Evolveum,项目名称:midpoint,代码行数:19,代码来源:LinkColumn.java


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