本文整理匯總了Java中org.apache.wicket.markup.html.list.ListView.add方法的典型用法代碼示例。如果您正苦於以下問題:Java ListView.add方法的具體用法?Java ListView.add怎麽用?Java ListView.add使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.wicket.markup.html.list.ListView
的用法示例。
在下文中一共展示了ListView.add方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: addPrivilegesPanel
import org.apache.wicket.markup.html.list.ListView; //導入方法依賴的package包/類
private void addPrivilegesPanel(WebMarkupContainer body){
privilegesNames = getPrivilegesNamesList();
ListView<String> privilegesListComponent = new ListView<String>(ID_PRIVILEGES_LIST, privilegesNames){
private static final long serialVersionUID = 1L;
@Override
protected void populateItem(ListItem<String> item) {
Label privilageNameLabel = new Label(ID_PRIVILEGE, item.getModel());
item.add(privilageNameLabel);
}
};
privilegesListComponent.setOutputMarkupId(true);
privilegesListComponent.add(new VisibleEnableBehaviour(){
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible(){
if (!UserDtoStatus.ADD.equals(getModelObject().getStatus())){
return true;
}
return false;
}
});
body.addOrReplace(privilegesListComponent);
}
示例2: initContexts
import org.apache.wicket.markup.html.list.ListView; //導入方法依賴的package包/類
private void initContexts(WebMarkupContainer operationContent, final IModel<OpResult> model, Page parentPage) {
Label contextsLabel = new Label("contextsLabel", parentPage.getString("FeedbackAlertMessageDetails.contexts"));
contextsLabel.setOutputMarkupId(true);
contextsLabel.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible() {
return CollectionUtils.isNotEmpty(model.getObject().getContexts());
}
});
operationContent.add(contextsLabel);
ListView<Context> contexts = new ListView<Context>("contexts", createContextsModel(model)) {
private static final long serialVersionUID = 1L;
@Override
protected void populateItem(ListItem<Context> item) {
item.add(new Label("contextName", new PropertyModel<Object>(item.getModel(), "name")));
item.add(new Label("contextValue", new PropertyModel<Object>(item.getModel(), "value")));
}
};
contexts.setOutputMarkupId(true);
contexts.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible() {
return CollectionUtils.isNotEmpty(model.getObject().getContexts());
}
});
operationContent.add(contexts);
}
示例3: initContexts
import org.apache.wicket.markup.html.list.ListView; //導入方法依賴的package包/類
private void initContexts(WebMarkupContainer operationContent, final IModel<OpResult> model, Page parentPage) {
Label contextsLabel = new Label("contextsLabel", parentPage.getString("FeedbackAlertMessageDetails.contexts"));
contextsLabel.setOutputMarkupId(true);
contextsLabel.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible() {
return CollectionUtils.isNotEmpty(model.getObject().getContexts());
}
});
operationContent.add(contextsLabel);
ListView<Context> contexts = new ListView<Context>("contexts", createContextsModel(model)) {
private static final long serialVersionUID = 1L;
@Override
protected void populateItem(ListItem<Context> item) {
item.add(new Label("contextName", new PropertyModel<Object>(item.getModel(), "name")));
item.add(new Label("contextValue", new PropertyModel<Object>(item.getModel(), "value")));
}
};
contexts.setOutputMarkupId(true);
contexts.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible() {
return CollectionUtils.isNotEmpty(model.getObject().getContexts());
}
});
operationContent.add(contexts);
}
示例4: initLayout
import org.apache.wicket.markup.html.list.ListView; //導入方法依賴的package包/類
private void initLayout(final boolean nullValid, final NonEmptyModel<Boolean> readOnlyModel) {
WebMarkupContainer placeholderContainer = new WebMarkupContainer(ID_PLACEHOLDER_CONTAINER);
placeholderContainer.setOutputMarkupPlaceholderTag(true);
placeholderContainer.setOutputMarkupPlaceholderTag(true);
placeholderContainer.add(new VisibleEnableBehaviour(){
@Override
public boolean isVisible() {
return getModel().getObject().isEmpty();
}
});
add(placeholderContainer);
AjaxLink placeholderAdd = new AjaxLink(ID_PLACEHOLDER_ADD) {
@Override
public void onClick(AjaxRequestTarget target) {
addValuePerformed(target);
}
};
placeholderAdd.add(new AttributeAppender("class", new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
if (buttonsDisabled()) {
return " " + CSS_DISABLED;
}
return "";
}
}));
placeholderAdd.setOutputMarkupId(true);
placeholderAdd.setOutputMarkupPlaceholderTag(true);
placeholderAdd.add(WebComponentUtil.visibleIfFalse(readOnlyModel));
placeholderContainer.add(placeholderAdd);
ListView repeater = new ListView<T>(ID_REPEATER, getModel()){
@Override
protected void populateItem(final ListItem<T> item) {
DropDownChoice choice = new DropDownChoice<>(ID_INPUT, createDropDownItemModel(item.getModel()),
createChoiceList(), createRenderer());
choice.setNullValid(nullValid);
choice.add(WebComponentUtil.enabledIfFalse(readOnlyModel));
item.add(choice);
WebMarkupContainer buttonGroup = new WebMarkupContainer(ID_BUTTON_GROUP);
item.add(buttonGroup);
initButtons(buttonGroup, item, readOnlyModel);
}
};
repeater.setOutputMarkupId(true);
repeater.setOutputMarkupPlaceholderTag(true);
repeater.add(new VisibleEnableBehaviour(){
@Override
public boolean isVisible() {
return !getModel().getObject().isEmpty();
}
});
add(repeater);
}
示例5: initLayout
import org.apache.wicket.markup.html.list.ListView; //導入方法依賴的package包/類
private void initLayout(final boolean inputEnabled, final boolean showPlaceholder, final NonEmptyModel<Boolean> readOnlyModel) {
WebMarkupContainer placeholderContainer = new WebMarkupContainer(ID_PLACEHOLDER_CONTAINER);
placeholderContainer.setOutputMarkupPlaceholderTag(true);
placeholderContainer.setOutputMarkupPlaceholderTag(true);
placeholderContainer.add(new VisibleEnableBehaviour(){
@Override
public boolean isVisible() {
return showPlaceholder && (getModel().getObject() == null || getModel().getObject().isEmpty());
}
});
add(placeholderContainer);
AjaxLink placeholderAdd = new AjaxLink(ID_PLACEHOLDER_ADD) {
@Override
public void onClick(AjaxRequestTarget target) {
addValuePerformed(target);
}
};
placeholderAdd.add(new AttributeAppender("class", new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
if (buttonsDisabled()) {
return " " + CSS_DISABLED;
}
return "";
}
}));
placeholderAdd.add(WebComponentUtil.visibleIfFalse(readOnlyModel));
placeholderAdd.setOutputMarkupId(true);
placeholderAdd.setOutputMarkupPlaceholderTag(true);
placeholderContainer.add(placeholderAdd);
ListView repeater = new ListView<T>(ID_REPEATER, getModel()) {
@Override
protected void populateItem(final ListItem<T> item) {
TextField text = new TextField<>(ID_TEXT, createTextModel(item.getModel()));
text.add(new EmptyOnBlurAjaxFormUpdatingBehaviour());
text.add(AttributeAppender.replace("placeholder", createEmptyItemPlaceholder()));
if (selectedModel != null && item.getModelObject() == selectedModel.getObject()) {
text.add(AttributeAppender.append("style", "background-color: #FFFFD0;")); // TODO color constant
}
if (!inputEnabled) {
text.add(new AttributeModifier("disabled", "disabled"));
}
item.add(text);
WebMarkupContainer buttonGroup = new WebMarkupContainer(ID_BUTTON_GROUP);
item.add(buttonGroup);
initButtons(buttonGroup, item, readOnlyModel);
}
};
repeater.setOutputMarkupId(true);
repeater.setOutputMarkupPlaceholderTag(true);
repeater.add(new VisibleEnableBehaviour(){
@Override
public boolean isVisible() {
return getModel().getObject() != null && !getModel().getObject().isEmpty();
}
});
add(repeater);
}
示例6: initLayout
import org.apache.wicket.markup.html.list.ListView; //導入方法依賴的package包/類
@Override
protected void initLayout() {
WebMarkupContainer menuItemContainer = new WebMarkupContainer(ID_MENU_ITEM_CONTAINER);
menuItemContainer.setOutputMarkupId(true);
menuItemContainer.add(new AttributeAppender("class", getMenuItemContainerClass()));
menuItemContainer.add(new AttributeAppender("style", getMenuItemContainerStyle()));
add(menuItemContainer);
AjaxButton menuItemButton = new AjaxButton(ID_MENU_ITEM_BUTTON) {
@Override
public void onClick(AjaxRequestTarget ajaxRequestTarget) {
}
};
menuItemButton.setOutputMarkupId(true);
menuItemButton.add(new AttributeAppender("class", "dropdown-toggle " + getAdditionalButtonClass()));
menuItemButton.add(new AttributeAppender("style", getMenuItemButtonStyle()));
menuItemContainer.add(menuItemButton);
WebMarkupContainer icon = new WebMarkupContainer(ID_MENU_ITEM_ICON);
icon.setOutputMarkupId(true);
icon.add(new AttributeAppender("class", getIconClass()));
menuItemButton.add(icon);
ListView<InlineMenuItem> li = new ListView<InlineMenuItem>(ID_MENU_ITEM, getModel()) {
@Override
protected void populateItem(ListItem<InlineMenuItem> item) {
initMenuItem(item);
}
};
li.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
List list = InlineMenu.this.getModel().getObject();
return list != null && !list.isEmpty();
}
});
menuItemContainer.add(li);
}
示例7: initLayout
import org.apache.wicket.markup.html.list.ListView; //導入方法依賴的package包/類
@Override
protected void initLayout() {
WebMarkupContainer menuItemContainer = new WebMarkupContainer(ID_MENU_ITEM_CONTAINER);
menuItemContainer.setOutputMarkupId(true);
menuItemContainer.add(new AttributeAppender("class", getMenuItemContainerClass()));
menuItemContainer.add(new AttributeAppender("style", getMenuItemContainerStyle()));
add(menuItemContainer);
AjaxButton menuItemButton = new AjaxButton(ID_MENU_ITEM_BUTTON) {
@Override
public void onClick(AjaxRequestTarget ajaxRequestTarget) {
}
};
menuItemButton.setOutputMarkupId(true);
menuItemButton.setOutputMarkupPlaceholderTag(true);
menuItemButton.add(new AttributeAppender("class", "dropdown-toggle " + getAdditionalButtonClass()));
menuItemButton.add(new AttributeAppender("style", getMenuItemButtonStyle()));
menuItemContainer.add(menuItemButton);
WebMarkupContainer icon = new WebMarkupContainer(ID_MENU_ITEM_ICON);
icon.setOutputMarkupId(true);
icon.add(new AttributeAppender("class", getIconClass()));
menuItemButton.add(icon);
ListView<InlineMenuItem> li = new ListView<InlineMenuItem>(ID_MENU_ITEM, getModel()) {
@Override
protected void populateItem(ListItem<InlineMenuItem> item) {
initMenuItem(item);
}
};
li.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
List list = InlineMenu.this.getModel().getObject();
return list != null && !list.isEmpty();
}
});
menuItemContainer.add(li);
}