本文整理匯總了Java中org.apache.wicket.markup.repeater.Item類的典型用法代碼示例。如果您正苦於以下問題:Java Item類的具體用法?Java Item怎麽用?Java Item使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Item類屬於org.apache.wicket.markup.repeater包,在下文中一共展示了Item類的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: 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);
}
示例4: refreshingView
import org.apache.wicket.markup.repeater.Item; //導入依賴的package包/類
private RefreshingView<NutchInstance> refreshingView() {
RefreshingView<NutchInstance> instances = new RefreshingView<NutchInstance>(
"instances") {
@Override
protected Iterator<IModel<NutchInstance>> getItemModels() {
return new CpmIteratorAdapter<NutchInstance>(
instanceService.getInstances());
}
@Override
protected void populateItem(Item<NutchInstance> item) {
populateInstanceRow(item);
}
};
return instances;
}
示例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: createPropertyColumn
import org.apache.wicket.markup.repeater.Item; //導入依賴的package包/類
private static <T> PropertyColumn<T, String> createPropertyColumn(String name, String sortableProperty,
final String expression, final boolean multivalue) {
return new PropertyColumn<T, String>(createStringResource(name), sortableProperty, expression) {
private static final long serialVersionUID = 1L;
@Override
public void populateItem(Item item, String componentId, IModel rowModel) {
if (multivalue) {
IModel<List> values = new PropertyModel<List>(rowModel, expression);
RepeatingView repeater = new RepeatingView(componentId);
for (final Object task : values.getObject()) {
repeater.add(new Label(repeater.newChildId(), task.toString()));
}
item.add(repeater);
return;
}
super.populateItem(item, componentId, rowModel);
}
};
}
示例7: 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);
}
});
}
示例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: initResultColumns
import org.apache.wicket.markup.repeater.Item; //導入依賴的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;
}
示例10: 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));
}
示例11: 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;
}
示例12: addProcessModelTable
import org.apache.wicket.markup.repeater.Item; //導入依賴的package包/類
@SuppressWarnings("unchecked")
private Component addProcessModelTable() {
this.columns = new ArrayList<IColumn<AbstractBPMNElement, String>>();
this.columns.add(new AbstractColumn<AbstractBPMNElement, String>(new Model("Element")) {
@Override
public void populateItem(final Item cellItem, final String componentId, final IModel rowModel) {
final String elementName = ((AbstractBPMNElement) rowModel.getObject()).toString();
cellItem.add(new Label(componentId, elementName));
}
});
this.columns.add(new PropertyColumn<AbstractBPMNElement, String>(Model.of("Predecessors"), "predecessors"));
this.columns.add(new PropertyColumn<AbstractBPMNElement, String>(Model.of("Successors"), "successors"));
this.columns.add(new PropertyColumn<AbstractBPMNElement, String>(Model.of("Monitoring Points"), "monitoringPoints"));
this.processModelTable = new DefaultDataTable<AbstractBPMNElement, String>("processModelElements", this.columns, this.processModelProvider, 40);
this.processModelTable.setOutputMarkupId(true);
this.processModelTable.setOutputMarkupPlaceholderTag(true);
return this.processModelTable;
}
示例13: createColumns
import org.apache.wicket.markup.repeater.Item; //導入依賴的package包/類
private List<IColumn<TypeTreeNode, String>> createColumns() {
final List<IColumn<TypeTreeNode, String>> columns = new ArrayList<IColumn<TypeTreeNode, String>>();
columns.add(new PropertyColumn<TypeTreeNode, String>(Model.of("ID"), "ID"));
columns.add(new TreeColumn<TypeTreeNode, String>(Model.of("Attributes")));
columns.add(new AbstractColumn<TypeTreeNode, String>(new Model("Select")) {
@Override
public void populateItem(final Item cellItem, final String componentId, final IModel rowModel) {
final TypeTreeNode attribute = ((TypeTreeNode) rowModel.getObject());
cellItem.add(new AttributeSelectionPanel(componentId, attribute, AttributeTreePanel.this.attributeIdentifiersAndExpressions, AttributeTreePanel.this.attributeIdentifiersWithExternalKnowledge, AttributeTreePanel.this.advancedRuleEditorPanel.getPatternBuilderPanel()));
}
});
return columns;
}
示例14: addEventTable
import org.apache.wicket.markup.repeater.Item; //導入依賴的package包/類
@SuppressWarnings({"rawtypes", "unchecked"})
private void addEventTable() {
this.columns = new ArrayList<IColumn<EapEvent, String>>();
this.columns.add(new PropertyColumn<EapEvent, String>(Model.of("ID"), "ID"));
this.columns.add(new PropertyColumn<EapEvent, String>(Model.of("Timestamp"), "timestamp"));
this.columns.add(new PropertyColumn<EapEvent, String>(Model.of("EventType"), "eventType"));
this.columns.add(new PropertyColumn<EapEvent, String>(Model.of("Values"), "values"));
this.columns.add(new PropertyColumn<EapEvent, String>(Model.of("Process Instances"), "processInstances"));
this.columns.add(new AbstractColumn<EapEvent, String>(new Model("Select")) {
private static final long serialVersionUID = 1L;
@Override
public void populateItem(final Item cellItem, final String componentId, final IModel rowModel) {
final int entryId = ((EapEvent) rowModel.getObject()).getID();
cellItem.add(new SelectEntryPanel(componentId, entryId, Export.this.eventProvider));
}
});
this.dataTable = new DefaultDataTable<EapEvent, String>("events", this.columns, this.eventProvider, 20);
this.dataTable.setOutputMarkupId(true);
this.add(this.dataTable);
}
示例15: 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);
}