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