1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
package org.devacfr.maven.skins.reflow.model; |
20 |
|
|
21 |
|
import javax.annotation.Nonnull; |
22 |
|
|
23 |
|
import org.devacfr.maven.skins.reflow.ISkinConfig; |
24 |
|
|
25 |
|
|
26 |
|
@author |
27 |
|
@since |
28 |
|
|
|
|
| 75% |
Uncovered Elements: 5 (20) |
Complexity: 6 |
Complexity Density: 0,46 |
|
29 |
|
public class TocTopBar extends Toc<TocTopBar> { |
30 |
|
|
31 |
|
|
32 |
|
private boolean flatten = false; |
33 |
|
|
34 |
|
|
35 |
|
private int numberItems = -1; |
36 |
|
|
37 |
|
|
38 |
|
|
39 |
|
|
40 |
|
@param |
41 |
|
|
42 |
|
|
|
|
| 88,9% |
Uncovered Elements: 1 (9) |
Complexity: 2 |
Complexity Density: 0,29 |
|
43 |
1 |
public TocTopBar(final @Nonnull ISkinConfig config) {... |
44 |
1 |
super("top", "navbar"); |
45 |
1 |
this.setTheme(config.getAttributeValue(COMPONENT, "theme", String.class, "light")); |
46 |
1 |
this.setBackground(config.getAttributeValue(COMPONENT, "background", String.class, "light")); |
47 |
1 |
this.setCssClass(config.getAttributeValue(COMPONENT, "cssClass", String.class, null)); |
48 |
1 |
this.withFlatten(config.getAttributeValue(COMPONENT, "flatten", Boolean.class, false)) |
49 |
|
.withNumberItems(config.getAttributeValue(COMPONENT, "numberItems", Integer.class, -1)) |
50 |
|
.withEnabled(true); |
51 |
1 |
if (isEnabled()) { |
52 |
1 |
this.addCssOptions("m-toc-top-enabled"); |
53 |
|
} |
54 |
|
} |
55 |
|
|
56 |
|
|
57 |
|
|
58 |
|
|
59 |
|
@return |
60 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
61 |
0 |
public boolean isFlatten() {... |
62 |
0 |
return flatten; |
63 |
|
} |
64 |
|
|
65 |
|
|
66 |
|
|
67 |
|
|
68 |
|
@param |
69 |
|
|
70 |
|
@return |
71 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0,5 |
|
72 |
1 |
protected TocTopBar withFlatten(final boolean flatten) {... |
73 |
1 |
this.flatten = flatten; |
74 |
1 |
return self(); |
75 |
|
} |
76 |
|
|
77 |
|
|
78 |
|
@return |
79 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
80 |
0 |
public int getNumberItems() {... |
81 |
0 |
return numberItems; |
82 |
|
} |
83 |
|
|
84 |
|
|
85 |
|
|
86 |
|
|
87 |
|
@param |
88 |
|
|
89 |
|
@return |
90 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0,5 |
|
91 |
1 |
protected TocTopBar withNumberItems(final int numberItems) {... |
92 |
1 |
this.numberItems = numberItems; |
93 |
1 |
return self(); |
94 |
|
} |
95 |
|
} |