• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*******************************************************************************
2  * Copyright (c) 2009, 2018 Mountainminds GmbH & Co. KG and Contributors
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  *    Marc R. Hoffmann - initial API and implementation
10  *
11  *******************************************************************************/
12 package org.jacoco.report.internal.html.resources;
13 
14 /**
15  * Constants for styles defined by the report style sheet.
16  */
17 public final class Styles {
18 
19 	/** Breadcrumb bar */
20 	public static final String BREADCRUMB = "breadcrumb";
21 
22 	/** Info links within the Breadcrumb bar */
23 	public static final String INFO = "info";
24 
25 	/** Footer */
26 	public static final String FOOTER = "footer";
27 
28 	/** Text block aligned to the right */
29 	public static final String RIGHT = "right";
30 
31 	/** Report element */
32 	public static final String EL_REPORT = "el_report";
33 
34 	/** Sessions element */
35 	public static final String EL_SESSION = "el_session";
36 
37 	/** Group element */
38 	public static final String EL_GROUP = "el_group";
39 
40 	/** Bundle element */
41 	public static final String EL_BUNDLE = "el_bundle";
42 
43 	/** Package element */
44 	public static final String EL_PACKAGE = "el_package";
45 
46 	/** Source file element */
47 	public static final String EL_SOURCE = "el_source";
48 
49 	/** Class element */
50 	public static final String EL_CLASS = "el_class";
51 
52 	/** Method element */
53 	public static final String EL_METHOD = "el_method";
54 
55 	/** Coverage table */
56 	public static final String COVERAGETABLE = "coverage";
57 
58 	/** Table cells for a graphical bar */
59 	public static final String BAR = "bar";
60 
61 	/** Table cells for the first column of a counter */
62 	public static final String CTR1 = "ctr1";
63 
64 	/** Table cells for the second column of a counter */
65 	public static final String CTR2 = "ctr2";
66 
67 	/** Table header for sortable columns */
68 	public static final String SORTABLE = "sortable";
69 
70 	/** Table header for column sorted upwards */
71 	public static final String UP = "up";
72 
73 	/** Table header for column sorted downwards */
74 	public static final String DOWN = "down";
75 
76 	/** Block of source code */
77 	public static final String SOURCE = "source";
78 
79 	/** Line number before each source line */
80 	public static final String NR = "nr";
81 
82 	/** Part of source code where instructions are not covered */
83 	public static final String NOT_COVERED = "nc";
84 
85 	/** Part of source code where instructions are partly covered */
86 	public static final String PARTLY_COVERED = "pc";
87 
88 	/** Part of source code where instructions are is fully covered */
89 	public static final String FULLY_COVERED = "fc";
90 
91 	/** Part of source code where branches are not covered */
92 	public static final String BRANCH_NOT_COVERED = "bnc";
93 
94 	/** Part of source code where branches are partly covered */
95 	public static final String BRANCH_PARTLY_COVERED = "bpc";
96 
97 	/** Part of source code where branches are fully covered */
98 	public static final String BRANCH_FULLY_COVERED = "bfc";
99 
100 	/**
101 	 * Returns a combined style from the given styles.
102 	 *
103 	 * @param styles
104 	 *            list of separate styles, entries might be null
105 	 * @return combined style or <code>null</code> if no style is given
106 	 */
combine(final String... styles)107 	public static String combine(final String... styles) {
108 		final StringBuilder sb = new StringBuilder();
109 		for (final String style : styles) {
110 			if (style != null) {
111 				if (sb.length() > 0) {
112 					sb.append(" ");
113 				}
114 				sb.append(style);
115 			}
116 		}
117 		return sb.length() == 0 ? null : sb.toString();
118 	}
119 
Styles()120 	private Styles() {
121 	}
122 
123 }
124