本文整理汇总了Java中org.apache.wicket.markup.html.list.ListItem.add方法的典型用法代码示例。如果您正苦于以下问题:Java ListItem.add方法的具体用法?Java ListItem.add怎么用?Java ListItem.add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.wicket.markup.html.list.ListItem
的用法示例。
在下文中一共展示了ListItem.add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: DocumentationIndexPage
import org.apache.wicket.markup.html.list.ListItem; //导入方法依赖的package包/类
public DocumentationIndexPage() {
Harvester harvester = new Harvester();
@SuppressWarnings({ "unchecked", "rawtypes" })
ListView listview = new ListView("listview", harvester.getWorkspaces()) {
/**
*
*/
private static final long serialVersionUID = 2974513833506276491L;
protected void populateItem(ListItem item) {
WorkspaceDoc wi = (WorkspaceDoc) item.getModelObject();
BookmarkablePageLink link = new BookmarkablePageLink("link", WorkspacePage.class);
link.setParameter("workspaceName", wi.getName());
link.add(new Label("workspaceName", wi.getName()));
item.add(link);
}
};
add(listview);
ExtensionInfo info = new ExtensionInfo();
add(new Label("documentorVersion", info.getVersion()));
add(new Label("documentorGitVersion", info.getGitVersion()));
add(new Label("readme", info.getReadme()));
}
示例2: populateNode
import org.apache.wicket.markup.html.list.ListItem; //导入方法依赖的package包/类
private void populateNode() throws ExternalServiceException, IOException, RemoteException {
ListView<NodeDto> list = new ListView<NodeDto>("nodeList", this.model) {
private static final long serialVersionUID = 1L;
@Override
protected void populateItem(ListItem<NodeDto> item) {
NodeDto node = item.getModelObject();
BookmarkablePageLink<Void> link = NodePageUtil.createNodeLink("nodeLink", node);
item.add(link);
}
};
add(list);
WebMarkupContainer container = new WebMarkupContainer("nodeBlock");
add(container);
container.setVisible(this.model.isVisible());
}
示例3: initCounters
import org.apache.wicket.markup.html.list.ListItem; //导入方法依赖的package包/类
private void initCounters() {
ListView<InternalCounters> countersTable = new ListView<InternalCounters>(ID_COUNTERS_TABLE, Arrays.asList(InternalCounters.values())) {
private static final long serialVersionUID = 1L;
@Override
protected void populateItem(ListItem<InternalCounters> item) {
InternalCounters counter = item.getModelObject();
Label label = new Label(ID_COUNTER_LABEL, createStringResource("InternalCounters."+counter.getKey()));
item.add(label);
Label valueLabel = new Label(ID_COUNTER_VALUE, new AbstractReadOnlyModel<String>() {
private static final long serialVersionUID = 1L;
@Override
public String getObject() {
long val = InternalMonitor.getCount(counter);
return Long.toString(val);
}
});
item.add(valueLabel);
}
};
add(countersTable);
}
示例4: initLayout
import org.apache.wicket.markup.html.list.ListItem; //导入方法依赖的package包/类
private void initLayout() {
setOutputMarkupId(true);
ListView<PrismObject<R>> list = new ListView<PrismObject<R>>(ID_LIST, availableRoles) {
@Override
protected void populateItem(ListItem<PrismObject<R>> item) {
item.add(createRoleLink(ID_ITEM, item.getModel()));
}
};
list.setOutputMarkupId(true);
add(list);
AjaxLink<String> buttonReset = new AjaxLink<String>(ID_BUTTON_RESET) {
@Override
public void onClick(AjaxRequestTarget target) {
reset();
target.add(SimpleRoleSelector.this);
}
};
buttonReset.setBody(createStringResource("SimpleRoleSelector.reset"));
add(buttonReset);
}
示例5: addOrReplaceProperties
import org.apache.wicket.markup.html.list.ListItem; //导入方法依赖的package包/类
private void addOrReplaceProperties(IModel<ContainerWrapper> model, final Form form, boolean isToBeReplaced){
ListView<ItemWrapper> properties = new ListView<ItemWrapper>("properties",
new PropertyModel(model, "properties")) {
private static final long serialVersionUID = 1L;
@Override
protected void populateItem(final ListItem<ItemWrapper> item) {
item.add(new PrismPropertyPanel("property", item.getModel(), form, pageBase));
item.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible() {
return item.getModel().getObject().isVisible();
}
});
item.add(AttributeModifier.append("class", createStyleClassModel(item.getModel())));
}
};
properties.setReuseItems(true);
if (isToBeReplaced) {
replace(properties);
} else {
add(properties);
}
}
示例6: initLayout
import org.apache.wicket.markup.html.list.ListItem; //导入方法依赖的package包/类
private void initLayout() {
Label titleLabel = new Label(ID_TITLE, new PropertyModel<>(getModel(), InformationType.F_TITLE.getLocalPart()));
titleLabel.add(new VisibleBehaviour(() -> getModelObject().getTitle() != null));
add(titleLabel);
ListView<InformationPartType> list = new ListView<InformationPartType>(ID_PARTS,
new PropertyModel<>(getModel(), InformationType.F_PART.getLocalPart())) {
@Override
protected void populateItem(ListItem<InformationPartType> item) {
InformationPartType part = item.getModelObject();
Label label = new Label(ID_PART, part.getText());
if (Boolean.TRUE.equals(part.isHasMarkup())) {
label.setEscapeModelStrings(false);
}
item.add(label);
}
};
add(list);
}
示例7: addOtherTopicMapsSection
import org.apache.wicket.markup.html.list.ListItem; //导入方法依赖的package包/类
private void addOtherTopicMapsSection() {
// Alt. 2 Make a loadabledetachableModel for repository
IModel<List<TopicMapReference>> eachNonOntopolyTopicMapModel = new LoadableDetachableModel<List<TopicMapReference>>() {
@Override
protected List<TopicMapReference> load() {
OntopolyRepository repository = OntopolyContext.getOntopolyRepository();
return repository.getNonOntopolyTopicMaps();
}
};
ListView<TopicMapReference> eachTopicMap = new ListView<TopicMapReference>("eachNonOntopolyTopicMap", eachNonOntopolyTopicMapModel) {
@Override
protected void populateItem(ListItem<TopicMapReference> item) {
final TopicMapReference ref = item.getModelObject();
Map<String,String> pageParameterMap = new HashMap<String,String>();
pageParameterMap.put("topicMapId",ref.getId());
OntopolyBookmarkablePageLink link = new OntopolyBookmarkablePageLink(
"nonOntTMLink", ConvertPage.class, new PageParameters(pageParameterMap), ref.getName());
item.add(link);
}
};
add(eachTopicMap);
}
示例8: FunctionBoxesPanel
import org.apache.wicket.markup.html.list.ListItem; //导入方法依赖的package包/类
public FunctionBoxesPanel(String id) {
super(id);
Form<Object> form = new Form<Object>("functionBoxesForm");
add(form);
List<Component> list = getFunctionBoxesList("functionBox");
ListView<Component> functionBoxes = new ListView<Component>("functionBoxesList", list) {
@Override
protected void populateItem(ListItem<Component> item) {
item.add(item.getModelObject());
}
};
functionBoxes.setVisible(!list.isEmpty());
form.add(functionBoxes);
}
示例9: makeListView
import org.apache.wicket.markup.html.list.ListItem; //导入方法依赖的package包/类
/**
* Helper to create a listview for what needs to be shown
*
* @param markupId wicket markup id
* @param itemList ist of stuff
* @return
*/
private ListView<ProcessedGradeItem> makeListView(final String markupId, final List<ProcessedGradeItem> itemList) {
final ListView<ProcessedGradeItem> rval = new ListView<ProcessedGradeItem>(markupId, itemList) {
private static final long serialVersionUID = 1L;
@Override
protected void populateItem(final ListItem<ProcessedGradeItem> item) {
final ProcessedGradeItem gradeItem = item.getModelObject();
String displayTitle = gradeItem.getItemTitle();
if (gradeItem.getType() == Type.COMMENT) {
displayTitle = MessageHelper.getString("importExport.confirmation.commentsdisplay", gradeItem.getItemTitle());
}
item.add(new Label("title", displayTitle));
item.add(new Label("points", gradeItem.getItemPointValue()));
}
};
return rval;
}
示例10: populateItem
import org.apache.wicket.markup.html.list.ListItem; //导入方法依赖的package包/类
@Override
protected void populateItem(final ListItem<T> item) {
super.populateItem(item);
item.add(new AjaxEventBehavior("ondblclick") {
@SuppressWarnings({"unchecked"})
@Override
protected void onEvent(AjaxRequestTarget target) {
ModalHandler modalHandler = ModalHandler.getInstanceFor(RepoListPanel.this);
T itemObject = (T) item.getDefaultModelObject();
modalHandler.setModalPanel(newUpdateItemPanel(itemObject));
modalHandler.show(target);
}
@Override
protected IAjaxCallDecorator getAjaxCallDecorator() {
return new CancelDefaultDecorator();
}
});
}
示例11: populateItem
import org.apache.wicket.markup.html.list.ListItem; //导入方法依赖的package包/类
@Override
protected void populateItem(ListItem<Person> item) {
Person person = item.getModelObject();
item.add(new Label("firstname", person.getFirstName()));
item.add(new Label("lastname", person.getLastName()));
item.add(new Label("jobtitle", person.getJobTitle()));
}
示例12: populateItem
import org.apache.wicket.markup.html.list.ListItem; //导入方法依赖的package包/类
@Override
protected void populateItem(ListItem<ChampionMasteryItem> item) {
ChampionMasteryItem mastery = item.getModelObject();
ChampionStatisticItem championStatistic = null;
// create boolean to storing whether or not element should be shown
// set to false if mastery or championStatistic is null
boolean visible = true;
// check if mastery is null
if (mastery != null) {
championStatistic = PageDataProvider.getChampionStatisticById(mastery.getChampionId());
} else {
// if mastery is null create a new one and fill it with default data
mastery = new ChampionMasteryItem();
mastery.setChampionPoints(42);
mastery.setChampionLevel(1);
visible = false;
}
if (championStatistic == null) {
// if champion statistic is null use default champion for statistic
championStatistic = PageDataProvider.championStatisticMap.get("bard");
visible = false;
}
// create link to champion page
PageParameters linkParameters = new PageParameters();
linkParameters.set(0, championStatistic.getKeyName());
BookmarkablePageLink<String> link = new BookmarkablePageLink<>("champion_link",
SingleChampionPage.class, linkParameters);
item.add(link);
// add champion portrait, name and mastery score as well as champion level
link.add(new ExternalImage("champion_portrait", championStatistic.getPortraitUrl()));
link.add(new Label("champion_name", championStatistic.getChampionName()));
link.add(new Label("champion_stats", String.format("%s - Level %d", NumberFormatter.formatLong(
mastery.getChampionPoints()), mastery.getChampionLevel())));
// hide link if necessary
link.setVisible(visible);
}
示例13: initMenuItem
import org.apache.wicket.markup.html.list.ListItem; //导入方法依赖的package包/类
private void initMenuItem(ListItem<InlineMenuItem> menuItem) {
final InlineMenuItem item = menuItem.getModelObject();
WebMarkupContainer menuItemBody = new MenuLinkPanel(ID_MENU_ITEM_BODY, menuItem.getModel());
menuItemBody.setRenderBodyOnly(true);
menuItem.add(menuItemBody);
}
示例14: getPanels
import org.apache.wicket.markup.html.list.ListItem; //导入方法依赖的package包/类
public ListView<MyPasswordQuestionsPanel> getPanels(List<MyPasswordQuestionsPanel> p) {
ListView lw = new ListView(ID_PASSWORD_QUESTIONS_PANEL, p) {
private static final long serialVersionUID = 1L;
@Override
protected void populateItem(ListItem item) {
item.add((MyPasswordQuestionsPanel) item.getModelObject());
}
};
return lw;
}
示例15: initLayout
import org.apache.wicket.markup.html.list.ListItem; //导入方法依赖的package包/类
protected void initLayout(boolean ignoreMandatoryAttributes) {
Label attributeLabel = new Label(ID_ATTRIBUTE_LABEL, new PropertyModel(getModel(), ACAttributeDto.F_NAME));
add(attributeLabel);
WebMarkupContainer required = new WebMarkupContainer(ID_REQUIRED);
required.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
ACAttributeDto dto = getModel().getObject();
PrismPropertyDefinition def = dto.getDefinition();
return def.isMandatory();
}
});
add(required);
WebMarkupContainer hasOutbound = new WebMarkupContainer(ID_HAS_OUTBOUND);
hasOutbound.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return hasOutbound();
}
});
add(hasOutbound);
ListView<ACValueConstructionDto> values = new ListView<ACValueConstructionDto>(ID_VALUES,
new PropertyModel<List<ACValueConstructionDto>>(getModel(), ACAttributeDto.F_VALUES)) {
@Override
protected void populateItem(ListItem<ACValueConstructionDto> listItem) {
Form form = findParent(Form.class);
listItem.add(new ACAttributeValuePanel(ID_VALUE, listItem.getModel(), ignoreMandatoryAttributes, form));
}
};
add(values);
}