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

knowledgepixels / nanodash / 17837235071

18 Sep 2025 05:58PM UTC coverage: 13.87%. Remained the same
17837235071

push

github

tkuhn
chore: Remove serialVersionUIDs

443 of 4022 branches covered (11.01%)

Branch coverage included in aggregate %.

1133 of 7341 relevant lines covered (15.43%)

0.68 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/TitleBar.java
1
package com.knowledgepixels.nanodash.component;
2

3
import java.util.ArrayList;
4
import java.util.List;
5

6
import org.apache.wicket.behavior.AttributeAppender;
7
import org.apache.wicket.markup.html.WebMarkupContainer;
8
import org.apache.wicket.markup.html.panel.Panel;
9
import org.apache.wicket.markup.repeater.Item;
10
import org.apache.wicket.markup.repeater.data.DataView;
11
import org.apache.wicket.markup.repeater.data.ListDataProvider;
12

13
import com.knowledgepixels.nanodash.NanodashPageRef;
14
import com.knowledgepixels.nanodash.NanodashPreferences;
15
import com.knowledgepixels.nanodash.Utils;
16
import com.knowledgepixels.nanodash.page.NanodashPage;
17

18
/**
19
 * TitleBar is the top bar of the Nanodash application, which contains
20
 * navigation elements such as profile, my channel, users, connectors,
21
 * publish, query, and breadcrumb navigation.
22
 */
23
public class TitleBar extends Panel {
24

25
    private String highlight;
26

27
    /**
28
     * Constructs a TitleBar with the specified id, page, highlight element,
29
     * and an array of path references for breadcrumb navigation.
30
     *
31
     * @param id        the component id
32
     * @param page      the current Nanodash page
33
     * @param highlight the id of the element to highlight
34
     * @param pathRefs  an array of NanodashPageRef for breadcrumb navigation
35
     */
36
    public TitleBar(String id, NanodashPage page, String highlight, NanodashPageRef... pathRefs) {
37
        super(id);
×
38
        this.highlight = highlight;
×
39
        add(new ProfileItem("profile", page));
×
40

41
        createContainer("mychannel").setVisible(!NanodashPreferences.get().isReadOnlyMode());
×
42
        createContainer("users");
×
43
        createContainer("connectors");
×
44
        createContainer("publish").setVisible(!NanodashPreferences.get().isReadOnlyMode());
×
45
        createContainer("query");
×
46

47
        WebMarkupContainer breadcrumbPath = new WebMarkupContainer("breadcrumbpath");
×
48
        breadcrumbPath.setVisible(pathRefs.length > 0);
×
49
        if (pathRefs.length > 0) {
×
50
            breadcrumbPath.add(pathRefs[0].createComponent("firstpathelement"));
×
51
            // Getting serialization exception if not using 'new ArrayList<...>(...)' here:
52
            List<NanodashPageRef> morePathElements = new ArrayList<NanodashPageRef>(Utils.subList(pathRefs, 1, pathRefs.length));
×
53
            breadcrumbPath.add(new DataView<NanodashPageRef>("morepathelements", new ListDataProvider<NanodashPageRef>(morePathElements)) {
×
54

55
                @Override
56
                protected void populateItem(Item<NanodashPageRef> item) {
57
                    item.add(item.getModelObject().createComponent("furtherpathelement"));
×
58
                }
×
59

60
            });
61
        } else {
×
62
            breadcrumbPath.setVisible(false);
×
63
        }
64
        add(breadcrumbPath);
×
65
    }
×
66

67
    private WebMarkupContainer createContainer(String id) {
68
        WebMarkupContainer c = new WebMarkupContainer(id);
×
69
        if (id.equals(highlight)) {
×
70
            c.add(new AttributeAppender("class", "selected"));
×
71
        }
72
        add(c);
×
73
        return c;
×
74
    }
75

76
}
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