org.apache.wicket.markup.html.list.ListView Java Examples
The following examples show how to use
org.apache.wicket.markup.html.list.ListView.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: EventRefDetailsPanel.java From sakai with Educational Community License v2.0 | 7 votes |
@Override protected void onInitialize() { super.onInitialize(); List<EventDetail> detailsList = getDetails(); add(new ListView<EventDetail>("detailsList", detailsList) { @Override protected void populateItem(ListItem<EventDetail> item) { EventDetail ref = item.getModelObject(); item.add(new Label("key", Model.of(ref.getKey())).setRenderBodyOnly(true)); Fragment frag = buildDetailsFragment(ref); item.add(frag); } }); }
Example #2
Source File: SkuAttributesView.java From yes-cart with Apache License 2.0 | 6 votes |
@Override protected void onBeforeRender() { add( new ListView<Pair<String, List<Pair<String, String>>>>(ATTR_GROUPS, attributesToShow) { @Override protected void populateItem(ListItem<Pair<String, List<Pair<String, String>>>> pairListItem) { final Pair<String, List<Pair<String, String>>> item = pairListItem.getModelObject(); pairListItem.add( new SkuAttributesSectionView(ATTR_GROUP, item) ); } } ); super.onBeforeRender(); }
Example #3
Source File: TelemetryDetailsPanel.java From webanno with Apache License 2.0 | 6 votes |
public TelemetryDetailsPanel(String aId, IModel<List<TelemetryDetail>> aModel) { super(aId, aModel); ListView<TelemetryDetail> details = new ListView<TelemetryDetail>("details") { private static final long serialVersionUID = 5156853968330655499L; @Override protected void populateItem(ListItem<TelemetryDetail> aItem) { aItem.add(new Label("key", aItem.getModelObject().getKey())); aItem.add(new Label("value", aItem.getModelObject().getValue())); aItem.add(new Label("description", aItem.getModelObject().getDescription())); } }; details.setModel(aModel); add(details); }
Example #4
Source File: SocialNetworkPanel.java From Orienteer with Apache License 2.0 | 6 votes |
private ListView<OAuth2Service> createSocialNetworksServices(String id) { return new ListView<OAuth2Service>(id, getModel()) { @Override protected void populateItem(ListItem<OAuth2Service> item) { IOAuth2Provider provider = item.getModelObject().getProvider(); Image image = new Image("networkImage", provider.getIconResourceReference()); image.setOutputMarkupPlaceholderTag(true); image.add(new AjaxEventBehavior("click") { @Override protected void onEvent(AjaxRequestTarget target) { onSocialImageClick(target, item.getModel()); } }); image.add(new AttributeModifier("alt", new ResourceModel(provider.getLabel()).getObject())); item.add(image); } @Override protected void onInitialize() { super.onInitialize(); setReuseItems(true); } }; }
Example #5
Source File: ProjectCasDoctorPanel.java From webanno with Apache License 2.0 | 6 votes |
private ListView<LogMessageSet> createMessageSetsView() { return new ListView<LogMessageSet>("messageSets", PropertyModel.of(this, "formModel.messageSets")) { private static final long serialVersionUID = 8957632000765128508L; @Override protected void populateItem(ListItem<LogMessageSet> aItem) { IModel<LogMessageSet> set = aItem.getModel(); aItem.add(new Label("name", PropertyModel.of(set, "name"))); aItem.add(createMessagesView(set)); } }; }
Example #6
Source File: ProjectCasDoctorPanel.java From webanno with Apache License 2.0 | 6 votes |
private ListView<LogMessage> createMessagesView(IModel<LogMessageSet> aModel) { return new ListView<LogMessage>("messages", PropertyModel.of(aModel, "messages")) { private static final long serialVersionUID = 8957632000765128508L; @Override protected void populateItem(ListItem<LogMessage> aItem) { IModel<LogMessage> msg = aItem.getModel(); aItem.add(new Label("level", PropertyModel.of(msg, "level"))); aItem.add(new Label("source", PropertyModel.of(msg, "source"))); aItem.add(new Label("message", PropertyModel.of(msg, "message"))); } }; }
Example #7
Source File: SchemaPageHeader.java From Orienteer with Apache License 2.0 | 6 votes |
public SchemaPageHeader(String id, IModel<OClass> oClassModel) { super(id, oClassModel); add(new BookmarkablePageLink<Object>("schema", SchemaPage.class) .setBody(new ResourceModel("menu.list.schema"))); add(new ListView<OClass>("classes", classPathModel) { @Override protected void populateItem(ListItem<OClass> item) { item.add(new OClassPageLink("link", item.getModel()).setClassNameAsBody(false)); } }); childRepeatingView = new RepeatingView("child"); add(childRepeatingView); add(UpdateOnActionPerformedEventBehavior.INSTANCE_ALWAYS_FOR_CHANGING); add(new DefaultPageHeaderMenu("menu")); }
Example #8
Source File: RangeFilterPanel.java From Orienteer with Apache License 2.0 | 6 votes |
@SuppressWarnings("unchecked") public RangeFilterPanel(String id, IModel<List<T>> model, String filterId, IModel<OProperty> propertyModel, IVisualizer visualizer, IFilterCriteriaManager manager) { super(id, model, filterId, propertyModel, visualizer, manager, Model.of(true)); startComponent = (FormComponent<T>) createFilterComponent(Model.of()); endComponent = (FormComponent<T>) createFilterComponent(Model.of()); startComponent.setOutputMarkupId(true); endComponent.setOutputMarkupId(true); List<Component> rangeContainers = Lists.newArrayList(); rangeContainers.add(getRangeContainer(startComponent, getFilterId(), true)); rangeContainers.add(getRangeContainer(endComponent, getFilterId(), false)); ListView<Component> listView = new ListView<Component>("rangeFilters", rangeContainers) { @Override protected void populateItem(ListItem<Component> item) { item.add(item.getModelObject()); } }; add(listView); }
Example #9
Source File: OrderItemListPanel.java From AppStash with Apache License 2.0 | 6 votes |
private Component orderItemList() { return new ListView<OrderItemInfo>("orderItems", new PropertyModel<List<OrderItemInfo>>(getDefaultModel(), "orderItems")) { private int orderItemCounter = 1; @Override protected void populateItem(ListItem<OrderItemInfo> orderItem) { orderItem.add(new Label("orderItemCounter", Model.of(orderItemCounter++))); orderItem.add(new Label("product", new PropertyModel<String>(orderItem.getModel(), "product.name"))); orderItem.add(new Label("description", new PropertyModel<String>(orderItem.getModel(), "product.description"))); orderItem.add(new Label("totalSum", new PriceModel(new PropertyModel<>(orderItem.getModel(), "totalSum")))); } @Override protected void onDetach() { orderItemCounter = 1; super.onDetach(); } }; }
Example #10
Source File: ActionBar.java From webanno with Apache License 2.0 | 6 votes |
public ActionBar(String aId) { super(aId); add(new ListView<ActionBarExtension>("items", LoadableDetachableModel.of(this::getExtensions)) { private static final long serialVersionUID = -3124915140030491897L; @Override protected void populateItem(ListItem<ActionBarExtension> aItem) { aItem.add(aItem.getModelObject().createActionBarItem("item", (AnnotationPageBase) getPage())); } }); }
Example #11
Source File: AnnotatedListIdentifiers.java From inception with Apache License 2.0 | 6 votes |
public SearchResultGroup(String aId, String aMarkupId, MarkupContainer aMarkupProvider, List<String> aResultList) { super(aId, aMarkupId, aMarkupProvider); ListView<String> statementList = new ListView<String>("results") { private static final long serialVersionUID = 5811425707843441458L; @Override protected void populateItem(ListItem<String> aItem) { aItem.add( new Label("sentence", aItem.getModelObject()) .setEscapeModelStrings(false)); } }; statementList.setList(aResultList); add(statementList); }
Example #12
Source File: BaseModal.java From syncope with Apache License 2.0 | 6 votes |
@Override protected void onInitialize() { super.onInitialize(); final WebMarkupContainer dialog = (WebMarkupContainer) this.get("dialog"); dialog.setMarkupId(this.getId()); footer = (WebMarkupContainer) this.get("dialog:footer"); footer.addOrReplace(new ListView<Component>("inputs", components) { private static final long serialVersionUID = 4949588177564901031L; @Override protected void populateItem(final ListItem<Component> item) { item.add(item.getModelObject()); } }.setOutputMarkupId(true)).setOutputMarkupId(true); }
Example #13
Source File: KeyBindingsConfigurationPanel.java From webanno with Apache License 2.0 | 6 votes |
private ListView<KeyBinding> createKeyBindingsList(String aId, IModel<List<KeyBinding>> aKeyBindings) { return new ListView<KeyBinding>(aId, aKeyBindings) { private static final long serialVersionUID = 432136316377546825L; @Override protected void populateItem(ListItem<KeyBinding> aItem) { AnnotationFeature feature = KeyBindingsConfigurationPanel.this.getModelObject(); FeatureSupport<?> fs = featureSupportRegistry.getFeatureSupport(feature); KeyBinding keyBinding = aItem.getModelObject(); aItem.add(new Label("keyCombo", keyBinding.asHtml()).setEscapeModelStrings(false)); aItem.add( new Label("value", fs.renderFeatureValue(feature, keyBinding.getValue()))); aItem.add(new LambdaAjaxLink("removeKeyBinding", _target -> removeKeyBinding(_target, aItem.getModelObject()))); } }; }
Example #14
Source File: PlainAttrs.java From syncope with Apache License 2.0 | 6 votes |
public PlainSchemasMemberships( final String id, final Map<String, PlainSchemaTO> schemas, final IModel<Attributable> attributableTO) { super(id, schemas, attributableTO); add(new ListView<Attr>("schemas", new ListModel<Attr>(attributableTO.getObject(). getPlainAttrs().stream().sorted(attrComparator).collect(Collectors.toList()))) { private static final long serialVersionUID = 5306618783986001008L; @Override protected void populateItem(final ListItem<Attr> item) { setPanel(schemas, item, false); } }); }
Example #15
Source File: GradeImportConfirmationStep.java From sakai with Educational Community License v2.0 | 6 votes |
/** * 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; }
Example #16
Source File: Tabbable.java From onedev with MIT License | 6 votes |
@Override protected void onInitialize() { super.onInitialize(); add(new ListView<Tab>("tabs", new LoadableDetachableModel<List<Tab>>() { @Override protected List<Tab> load() { return getTabs().stream().collect(Collectors.toList()); } }) { @Override protected void populateItem(ListItem<Tab> item) { Tab tab = item.getModelObject(); if (tab.isSelected()) item.add(AttributeModifier.append("class", "active")); item.add(tab.render("tab")); } }); }
Example #17
Source File: PriceTierView.java From yes-cart with Apache License 2.0 | 6 votes |
/** {@inheritDoc} */ @Override protected void onBeforeRender() { add( new ListView<PriceModel>(PRICE_TIERS_LIST, skuPrices) { @Override protected void populateItem(ListItem<PriceModel> listItem) { listItem.add( new Label(QUANTITY_LABEL, String.valueOf(listItem.getModelObject().getQuantity().intValue())) ); final PriceModel price = listItem.getModel().getObject(); listItem.add( new PriceView(PRICE_VIEW, price, null, true, false, price.isTaxInfoEnabled(), price.isTaxInfoShowAmount()) ); } } ); super.onBeforeRender(); }
Example #18
Source File: PropertyChangePanel.java From onedev with MIT License | 6 votes |
@Override protected void onInitialize() { super.onInitialize(); add(new WebMarkupContainer("nameHeader").setVisible(showName)); add(new ListView<PropertyChange>("properties", changes) { @Override protected void populateItem(ListItem<PropertyChange> item) { PropertyChange change = item.getModelObject(); item.add(new Label("name", change.name).setVisible(showName)); if (change.oldValue != null) item.add(new Label("oldValue", change.oldValue)); else item.add(new Label("oldValue", "<i>empty</i>").setEscapeModelStrings(false)); if (change.newValue != null) item.add(new Label("newValue", change.newValue)); else item.add(new Label("newValue", "<i>empty</i>").setEscapeModelStrings(false)); } }); }
Example #19
Source File: GradeImportConfirmationStep.java From sakai with Educational Community License v2.0 | 6 votes |
/** * Helper to create a listview for what needs to be shown for new assignments * @param markupId wicket markup id * @param itemList list of Assignments populated by the item creation steps */ private ListView<Assignment> makeAssignmentsToCreateListView(final String markupId, final List<Assignment> itemList) { final ListView<Assignment> rval = new ListView<Assignment>(markupId, itemList) { @Override protected void populateItem(final ListItem<Assignment> item) { final Assignment assignment = item.getModelObject(); String extraCredit = assignment.isExtraCredit() ? yes : no; String dueDate = FormatHelper.formatDate(assignment.getDueDate(), ""); String releaseToStudents = assignment.isReleased() ? yes : no; String includeInCourseGrades = assignment.isCounted() ? yes : no; item.add(new Label("title", assignment.getName())); item.add(new Label("points", assignment.getPoints())); item.add(new Label("extraCredit", extraCredit)); item.add(new Label("dueDate", dueDate)); item.add(new Label("releaseToStudents", releaseToStudents)); item.add(new Label("includeInCourseGrades", includeInCourseGrades)); } }; return rval; }
Example #20
Source File: PlainAttrs.java From syncope with Apache License 2.0 | 6 votes |
public PlainSchemasOwn( final String id, final Map<String, PlainSchemaTO> schemas, final IModel<List<Attr>> attrTOs) { super(id, schemas, attrTOs); add(new ListView<Attr>("schemas", attrTOs) { private static final long serialVersionUID = 9101744072914090143L; @Override protected void populateItem(final ListItem<Attr> item) { setPanel(schemas, item, false); } }); }
Example #21
Source File: GradeImportConfirmationStep.java From sakai with Educational Community License v2.0 | 6 votes |
/** * 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; }
Example #22
Source File: FilterPanel.java From Orienteer with Apache License 2.0 | 6 votes |
private void addFilterPanels(WebMarkupContainer container, List<AbstractFilterPanel<?, ?>> panels, final List<FilterTab> tabs) { ListView<AbstractFilterPanel<?, ?>> listView = new ListView<AbstractFilterPanel<?, ?>>("filterPanels", panels) { private boolean first = true; @Override protected void populateItem(ListItem<AbstractFilterPanel<?, ?>> item) { if (first) { first = false; item.add(AttributeModifier.append("class", TAB_PANE_ACTIVE)); } else item.add(AttributeModifier.append("class", TAB_PANE)); item.add(AttributeModifier.append("class", FILTER_WIDTH)); AbstractFilterPanel panel = item.getModelObject(); for (FilterTab tab : tabs) { if (tab.getType().equals(panel.getFilterCriteriaType())) { tab.setTabId(item.getMarkupId()); break; } } item.add(panel); } }; listView.setOutputMarkupPlaceholderTag(true); listView.setReuseItems(true); container.add(listView); }
Example #23
Source File: PaymentPage.java From yes-cart with Apache License 2.0 | 6 votes |
/** * Get the negative result fragment. * @return negative result fragment */ private MarkupContainer createNegativePaymentResultFragment() { error(getLocalizer().getString(NEGATIVE_PAYMENT_NOTES, this)); final List<CustomerOrderPayment> payments = checkoutServiceFacade.findPaymentRecordsByOrderNumber(getOrderNumber()); return new Fragment(RESULT_CONTAINER, NEGATIVE_RESULT_FRAGMENT, this) .add( new ListView<CustomerOrderPayment>(PAYMENT_DETAIL_LIST, payments) { @Override protected void populateItem(final ListItem<CustomerOrderPayment> item) { final CustomerOrderPayment payment = item.getModelObject(); item.add(new Label(PAYMENT_ID_LABEL, String.valueOf(payment.getCustomerOrderPaymentId()))); item.add(new Label(PAYMENT_TRANS_ID, StringUtils.defaultIfEmpty(payment.getTransactionReferenceId(), StringUtils.EMPTY))); item.add(new Label(PAYMENT_AUTH_CODE, StringUtils.defaultIfEmpty(payment.getTransactionAuthorizationCode(), StringUtils.EMPTY))); item.add(new Label(PAYMENT_ERROR_CODE, StringUtils.defaultIfEmpty(payment.getTransactionOperationResultCode(), StringUtils.EMPTY))); item.add(new Label(PAYMENT_ERROR_DESCR, StringUtils.defaultIfEmpty(payment.getTransactionOperationResultMessage(), StringUtils.EMPTY))); } } ); }
Example #24
Source File: SortGradeItemsByGradeItemPanel.java From sakai with Educational Community License v2.0 | 6 votes |
@Override public void onInitialize() { super.onInitialize(); final List<Assignment> assignments = this.businessService.getGradebookAssignments(SortType.SORT_BY_SORTING); add(new ListView<Assignment>("gradeItemList", assignments) { @Override protected void populateItem(final ListItem<Assignment> assignmentItem) { final Assignment assignment = assignmentItem.getModelObject(); assignmentItem.add(new Label("name", assignment.getName())); assignmentItem.add(new HiddenField<Long>("id", Model.of(assignment.getId())).add( new AttributeModifier("name", String.format("id", assignment.getId())))); assignmentItem.add(new HiddenField<Integer>("order", Model.of(assignment.getSortOrder())).add( new AttributeModifier("name", String.format("item_%s[order]", assignment.getId())))); assignmentItem.add(new HiddenField<Integer>("current_order", Model.of(assignment.getSortOrder())).add( new AttributeModifier("name", String.format("item_%s[current_order]", assignment.getId())))); } }); }
Example #25
Source File: TypeBrowser.java From oodt with Apache License 2.0 | 6 votes |
/** * @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); }
Example #26
Source File: SortGradeItemsByGradeItemPanel.java From sakai with Educational Community License v2.0 | 6 votes |
@Override public void onInitialize() { super.onInitialize(); final List<Assignment> assignments = this.businessService.getGradebookAssignments(SortType.SORT_BY_SORTING); add(new ListView<Assignment>("gradeItemList", assignments) { @Override protected void populateItem(final ListItem<Assignment> assignmentItem) { final Assignment assignment = assignmentItem.getModelObject(); assignmentItem.add(new Label("name", assignment.getName())); assignmentItem.add(new HiddenField<Long>("id", Model.of(assignment.getId())).add( new AttributeModifier("name", String.format("id", assignment.getId())))); assignmentItem.add(new HiddenField<Integer>("order", Model.of(assignment.getSortOrder())).add( new AttributeModifier("name", String.format("item_%s[order]", assignment.getId())))); assignmentItem.add(new HiddenField<Integer>("current_order", Model.of(assignment.getSortOrder())).add( new AttributeModifier("name", String.format("item_%s[current_order]", assignment.getId())))); } }); }
Example #27
Source File: SkuAttributesSectionView.java From yes-cart with Apache License 2.0 | 6 votes |
/** * * Some times need additional format for value (keyValue.getSecond()). * */ @Override protected void onBeforeRender() { add( new Label(HEAD, headKeyValues.getFirst()) ); add( new ListView<Pair<String, String>>(KEY_VALUES_LIST, headKeyValues.getSecond()) { @Override protected void populateItem(ListItem<Pair<String, String>> pairListItem) { final Pair<String, String> keyValue = pairListItem.getModelObject(); pairListItem.add( new Label(KEY, keyValue.getFirst()) ).add( new Label(VALUE, StringUtils.defaultIfEmpty(keyValue.getSecond(), StringUtils.EMPTY) ) ); } } ); super.onBeforeRender(); }
Example #28
Source File: StartPage.java From ontopia with Apache License 2.0 | 6 votes |
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); }
Example #29
Source File: ActionPanel.java From wicket-spring-boot with Apache License 2.0 | 5 votes |
public ActionPanel(String id, List<AbstrractActionItem> items) { super(id); ListView<AbstrractActionItem> listItems = new ListView<AbstrractActionItem>("items", items) { @Override protected void populateItem(ListItem<AbstrractActionItem> item) { item.add(item.getModel().getObject()); } }; add(listItems); }
Example #30
Source File: ConsoleNotificationIndexPage.java From artifact-listener with Apache License 2.0 | 5 votes |
public ConsoleNotificationIndexPage(PageParameters parameters) { super(parameters); addHeadPageTitleKey("console.notifications"); add(new ListView<PageProvider>("notifications", getNotificationPages()) { private static final long serialVersionUID = 1L; @SuppressWarnings("unchecked") @Override protected void populateItem(ListItem<PageProvider> item) { Class<? extends Page> pageClass = (Class<? extends Page>) item.getModelObject().getPageClass(); Link<Void> link = new BookmarkablePageLink<Void>("link", pageClass); link.add(new Label("label", new ResourceModel("console.notifications." + pageClass.getSimpleName(), pageClass.getSimpleName()))); item.add(link); } }); add(new WebMarkupContainer("emptyList") { private static final long serialVersionUID = 6700720373087584498L; @Override public boolean isVisible() { return getNotificationPages().isEmpty(); } }); }