本文整理匯總了Java中org.apache.wicket.markup.html.list.ListView.setReuseItems方法的典型用法代碼示例。如果您正苦於以下問題:Java ListView.setReuseItems方法的具體用法?Java ListView.setReuseItems怎麽用?Java ListView.setReuseItems使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.wicket.markup.html.list.ListView
的用法示例。
在下文中一共展示了ListView.setReuseItems方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: addOrReplaceContainers
import org.apache.wicket.markup.html.list.ListView; //導入方法依賴的package包/類
private void addOrReplaceContainers(IModel<ObjectWrapper<O>> model, final Form form, boolean isToBeReplaced){
ListView<ContainerWrapper> containers = new ListView<ContainerWrapper>(ID_CONTAINERS,
createContainerModel(model)) {
private static final long serialVersionUID = 1L;
@Override
protected void populateItem(ListItem<ContainerWrapper> item) {
PrismContainerPanel containerPanel = createContainerPanel(item, form);
createMetadataPanel(model, item, containerPanel);
}
};
containers.setReuseItems(true);
if (isToBeReplaced) {
replace(containers);
} else {
add(containers);
}
}
示例2: addOrReplaceProperties
import org.apache.wicket.markup.html.list.ListView; //導入方法依賴的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);
}
}
示例3: addOrReplaceContainers
import org.apache.wicket.markup.html.list.ListView; //導入方法依賴的package包/類
private void addOrReplaceContainers(final Form form, ItemVisibilityHandler isPanelVisible, boolean isToBeReplaced){
ListView<ContainerWrapper<C>> containers = new ListView<ContainerWrapper<C>>(ID_CONTAINERS,
getModel()) {
private static final long serialVersionUID = 1L;
@Override
protected void populateItem(ListItem<ContainerWrapper<C>> item) {
createContainerPanel(item, isPanelVisible, form);
}
};
containers.setReuseItems(true);
if (isToBeReplaced) {
replace(containers);
} else {
add(containers);
}
}
示例4: ExistingCriteriaForm
import org.apache.wicket.markup.html.list.ListView; //導入方法依賴的package包/類
/**
* @param id
* The wicket:id identifier of the criteria form.
*/
public ExistingCriteriaForm(String id) {
super(id);
ListView<TermQueryCriteria> criteriaView = new ListView<TermQueryCriteria>(
"criteria_selected_row", criteria) {
@Override
protected void populateItem(ListItem<TermQueryCriteria> item) {
item.add(new Label("criteria_elem_name", item.getModelObject()
.getElementName()));
item.add(new Label("criteria_elem_value", item.getModelObject()
.getValue()));
item.add(new TermQueryCriteriaRemoveButton("criteria_elem_remove",
item.getModelObject()));
}
};
criteriaView.setReuseItems(true);
add(criteriaView);
}
示例5: initLayout
import org.apache.wicket.markup.html.list.ListView; //導入方法依賴的package包/類
private void initLayout(final IModel<SceneItemDto> model) {
ListView<SceneItemLineDto> items = new ListView<SceneItemLineDto>(ID_ITEM_LINES,
new PropertyModel<List<SceneItemLineDto>>(model, SceneItemDto.F_LINES)) {
@Override
protected void populateItem(ListItem<SceneItemLineDto> item) {
SceneItemLinePanel panel = new SceneItemLinePanel(ID_ITEM_LINE, item.getModel());
item.add(panel);
}
};
items.setReuseItems(true);
add(items);
}
示例6: addOrReplaceProperties
import org.apache.wicket.markup.html.list.ListView; //導入方法依賴的package包/類
private <IW extends ItemWrapper> void addOrReplaceProperties(IModel<ContainerValueWrapper<C>> model, final Form form, ItemVisibilityHandler isPanaleVisible, boolean isToBeReplaced){
ListView<IW> properties = new ListView<IW>("properties",
new PropertyModel<List<IW>>(model, "properties")) {
private static final long serialVersionUID = 1L;
@Override
protected void populateItem(final ListItem<IW> item) {
if (item.getModel().getObject() instanceof ContainerWrapper) {
PrismContainerPanel<C> containerPanel = new PrismContainerPanel("property", (IModel<ContainerWrapper<C>>) item.getModel(), true, form, isPanaleVisible, pageBase);
containerPanel.setOutputMarkupId(true);
item.add(new VisibleEnableBehaviour(){
private static final long serialVersionUID = 1L;
public boolean isVisible(){
return containerPanel.isVisible();
}
});
item.add(containerPanel);
return;
}
PrismPropertyPanel propertyPanel = new PrismPropertyPanel("property", item.getModel(), form, isPanaleVisible, pageBase);
propertyPanel.setOutputMarkupId(true);
item.add(propertyPanel);
item.add(AttributeModifier.append("class", createStyleClassModel((IModel<ItemWrapper>) item.getModel())));
}
};
properties.setReuseItems(true);
if (isToBeReplaced) {
replace(properties);
} else {
add(properties);
}
}
示例7: AddEditCredentialGroupPanel
import org.apache.wicket.markup.html.list.ListView; //導入方法依賴的package包/類
public AddEditCredentialGroupPanel(String id, CredentialGroup credentialGroup) {
super(id, true);
this.credentialGroupModel = new EntityModel<CredentialGroup>(credentialGroup);
this.isCreation = credentialGroup.getId() == null;
Form form = getForm();
form.setModel(new CompoundPropertyModel(credentialGroupModel));
form.add(new SetFocusBehavior(form));
nameField = new RequiredTextField("name");
nameField.add(new StringValidator.MaximumLengthValidator(255));
connectorInstancesCheckGroup = new CheckGroup("connectorInstances", new PropertyModel(
credentialGroupModel, "connectorInstances"));
IModel connectorInstancesModel = new LoadableDetachableModel() {
@Override
protected Object load() {
AdminCollectionPanel adminCollectionPanel = (AdminCollectionPanel) findParent(AdminCollectionPanel.class);
RecordCollection collection = adminCollectionPanel.getCollection();
return new ArrayList<ConnectorInstance>(collection.getConnectorInstances());
}
};
connectorInstancesListView = new ListView("connectorInstancesListView", connectorInstancesModel) {
@Override
protected void populateItem(ListItem item) {
ConnectorInstance connectorInstance = (ConnectorInstance) item.getModelObject();
Check check = new Check("check", new ReloadableEntityModel<ConnectorInstance>(
connectorInstance));
Label label = new Label("label", connectorInstance.getDisplayName());
item.add(check);
item.add(label);
}
};
connectorInstancesListView.setReuseItems(true);
form.add(nameField);
form.add(connectorInstancesCheckGroup);
connectorInstancesCheckGroup.add(connectorInstancesListView);
}
示例8: addComponents
import org.apache.wicket.markup.html.list.ListView; //導入方法依賴的package包/類
@SuppressWarnings("unchecked")
private void addComponents() {
// initialize model
for (QueryParameter parameter : convertList) {
if (!runtimeModel.isEdit() || (USER_PARAM.equals(parameter.getName()))) {
JasperRuntimeParameterModel jasperRuntimeModel = createRuntimeModel(parameter);
runtimeModel.getParameters().put(parameter.getName(), jasperRuntimeModel);
}
}
if (!runtimeModel.isEdit()) {
// if some parameters initialized have default values, their dependent parameters
// have to be initialized too
for (QueryParameter qp : depParameters) {
populateDependentParameters(qp, null);
}
}
ListView<QueryParameter> listView = new ListView<QueryParameter>("params", new ArrayList<QueryParameter>(convertMap.values())) {
@Override
protected void populateItem(ListItem<QueryParameter> item) {
createItem(item);
}
};
listView.setReuseItems(true);
add(listView);
add(new DropDownChoice("exportType", new PropertyModel(runtimeModel, "exportType"), typeList).setRequired(true));
}
示例9: initLayout
import org.apache.wicket.markup.html.list.ListView; //導入方法依賴的package包/類
private void initLayout(final IModel<List<T>> chosenValues, final List<PrismReferenceValue> filterValues,
final boolean required, final boolean multiselect) {
AjaxLink<String> edit = new AjaxLink<String>(ID_EDIT) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
editValuePerformed(chosenValues.getObject(), filterValues, target, multiselect);
}
};
edit.setOutputMarkupPlaceholderTag(true);
add(edit);
ListView<T> selectedRowsList = new ListView<T>(ID_SELECTED_ROWS, chosenValues) {
@Override
protected void populateItem(ListItem<T> item) {
WebMarkupContainer textWrapper = new WebMarkupContainer(ID_TEXT_WRAPPER);
textWrapper.setOutputMarkupPlaceholderTag(true);
TextField<String> text = new TextField<String>(ID_TEXT, createTextModel(item.getModel())); //was value
text.add(new AjaxFormComponentUpdatingBehavior("blur") {
private static final long serialVersionUID = 1L;
@Override
protected void onUpdate(AjaxRequestTarget ajaxRequestTarget) {
}
});
text.setRequired(required);
text.setEnabled(false);
text.setOutputMarkupPlaceholderTag(true);
textWrapper.add(text);
FeedbackPanel feedback = new FeedbackPanel(ID_FEEDBACK, new ComponentFeedbackMessageFilter(text));
feedback.setOutputMarkupPlaceholderTag(true);
textWrapper.add(feedback);
initButtons(item, item);
item.add(textWrapper);
}
};
selectedRowsList.setReuseItems(true);
add(selectedRowsList);
}
示例10: initLayout
import org.apache.wicket.markup.html.list.ListView; //導入方法依賴的package包/類
private void initLayout(final IModel<List<T>> chosenValues, final List<PrismReferenceValue> filterValues,
final boolean required, final boolean multiselect) {
AjaxLink<String> edit = new AjaxLink<String>(ID_EDIT) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
editValuePerformed(chosenValues.getObject(), filterValues, target, multiselect);
}
};
edit.setOutputMarkupPlaceholderTag(true);
add(edit);
ListView<T> selectedRowsList = new ListView<T>(ID_SELECTED_ROWS, chosenValues) {
@Override
protected void populateItem(ListItem<T> item) {
WebMarkupContainer textWrapper = new WebMarkupContainer(ID_TEXT_WRAPPER);
textWrapper.setOutputMarkupPlaceholderTag(true);
TextField<String> text = new TextField<String>(ID_TEXT, createTextModel(item.getModel())); //was value
text.add(new AjaxFormComponentUpdatingBehavior("blur") {
private static final long serialVersionUID = 1L;
@Override
protected void onUpdate(AjaxRequestTarget ajaxRequestTarget) {
}
});
text.setRequired(required);
text.setEnabled(false);
text.setOutputMarkupPlaceholderTag(true);
textWrapper.add(text);
FeedbackPanel feedback = new FeedbackPanel(ID_FEEDBACK, new ComponentFeedbackMessageFilter(text));
feedback.setOutputMarkupPlaceholderTag(true);
textWrapper.add(feedback);
initButtons(item, item);
item.add(textWrapper);
}
};
selectedRowsList.setReuseItems(true);
add(selectedRowsList);
}
示例11: addOrReplaceProperties
import org.apache.wicket.markup.html.list.ListView; //導入方法依賴的package包/類
private void addOrReplaceProperties(IModel<ContainerWrapper<C>> model, final Form form, ItemVisibilityHandler isPanelVisible, boolean isToBeReplaced){
ListView<ContainerValueWrapper<C>> values = new ListView<ContainerValueWrapper<C>>("values", new PropertyModel<List<ContainerValueWrapper<C>>>(model, "values")) {
private static final long serialVersionUID = 1L;
@Override
protected void populateItem(ListItem<ContainerValueWrapper<C>> item) {
ContainerValuePanel<C> containerPanel = new ContainerValuePanel<C>("value", item.getModel(), true, form, isPanelVisible, pageBase);
containerPanel.setOutputMarkupId(true);
item.add(containerPanel);
}
};
values.setReuseItems(true);
if (isToBeReplaced) {
replace(values);
} else {
add(values);
}
}