• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

knowledgepixels / nanodash / 19101564803

05 Nov 2025 12:12PM UTC coverage: 14.453% (+0.1%) from 14.319%
19101564803

push

github

ashleycaselli
chore: add source nanopublication character to ItemListElement

515 of 4518 branches covered (11.4%)

Branch coverage included in aggregate %.

1353 of 8407 relevant lines covered (16.09%)

0.72 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
src/main/java/com/knowledgepixels/nanodash/component/ItemListElement.java
1
package com.knowledgepixels.nanodash.component;
2

3
import com.knowledgepixels.nanodash.page.ExplorePage;
4
import org.apache.wicket.markup.html.WebPage;
5
import org.apache.wicket.markup.html.basic.Label;
6
import org.apache.wicket.markup.html.link.BookmarkablePageLink;
7
import org.apache.wicket.markup.html.panel.Panel;
8
import org.apache.wicket.model.Model;
9
import org.apache.wicket.request.mapper.parameter.PageParameters;
10
import org.nanopub.Nanopub;
11

12
/**
13
 * A reusable component that represents an item in a list with a link and an optional note.
14
 */
15
public class ItemListElement extends Panel {
16
    /**
17
     * Constructor for ItemListElement.
18
     *
19
     * @param markupId              the Wicket markup ID
20
     * @param pageClass             the class of the page to link to
21
     * @param parameters            the page parameters for the link
22
     * @param linkText              the text to display for the link
23
     * @param note                  an optional note to display alongside the link
24
     * @param sourceNanopublication the source nanopublication
25
     */
26
    public ItemListElement(String markupId, Class<? extends WebPage> pageClass, final PageParameters parameters, String linkText, String note, Nanopub sourceNanopublication) {
27
        super(markupId);
×
28

29
        add(new BookmarkablePageLink<>("link", pageClass, parameters).setBody(Model.of(linkText)));
×
30
        if (note == null) {
×
31
            add(new Label("note").setVisible(false));
×
32
        } else {
33
            add(new Label("note", note));
×
34
        }
35
        if (sourceNanopublication == null) {
×
36
            add(new Label("np").setVisible(false));
×
37
        } else {
38
            add(new BookmarkablePageLink<>("np", ExplorePage.class, new PageParameters().add("id", sourceNanopublication.getUri())));
×
39
        }
40
    }
×
41

42
    /**
43
     * Overloaded constructor without note.
44
     *
45
     * @param markupId   the Wicket markup ID
46
     * @param pageClass  the class of the page to link to
47
     * @param parameters the page parameters for the link
48
     * @param linkText   the text to display for the link
49
     */
50
    public ItemListElement(String markupId, Class<? extends WebPage> pageClass, final PageParameters parameters, String linkText) {
51
        this(markupId, pageClass, parameters, linkText, null, null);
×
52
    }
×
53

54
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc