Styles.java revision 8d9c1af51844f4d333245344444935b015393506
1/******************************************************************************* 2 * Copyright (c) 2009, 2010 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 *******************************************************************************/ 12package org.jacoco.report.internal.html.resources; 13 14/** 15 * Constants for styles defined by the report style sheet. 16 * 17 * @author Marc R. Hoffmann 18 * @version $qualified.bundle.version$ 19 */ 20public class Styles { 21 22 /** Breadcrumb bar */ 23 public static final String BREADCRUMB = "breadcrumb"; 24 25 /** Footer */ 26 public static final String FOOTER = "footer"; 27 28 /** Test 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 the first column of a counter */ 59 public static final String CTR1 = "ctr1"; 60 61 /** Table cells for the second column of a counter */ 62 public static final String CTR2 = "ctr2"; 63 64 /** Table header for sortable columns */ 65 public static final String SORTABLE = "sortable"; 66 67 /** Table header for column sorted upwards */ 68 public static final String UP = "up"; 69 70 /** Table header for column sorted downwards */ 71 public static final String DOWN = "down"; 72 73 /** Block of source code */ 74 public static final String SOURCE = "source"; 75 76 /** Line number before each source line */ 77 public static final String NR = "nr"; 78 79 /** Part of source code where instructions are not covered */ 80 public static final String NOT_COVERED = "nc"; 81 82 /** Part of source code where instructions are partly covered */ 83 public static final String PARTLY_COVERED = "pc"; 84 85 /** Part of source code where instructions are is fully covered */ 86 public static final String FULLY_COVERED = "fc"; 87 88 /** Part of source code where branches are not covered */ 89 public static final String BRANCH_NOT_COVERED = "bnc"; 90 91 /** Part of source code where branches are partly covered */ 92 public static final String BRANCH_PARTLY_COVERED = "bpc"; 93 94 /** Part of source code where branches are fully covered */ 95 public static final String BRANCH_FULLY_COVERED = "bfc"; 96 97 /** 98 * Returns a combined style from the given styles. 99 * 100 * @param styles 101 * list of separate styles, entries might be null 102 * @return combined style or <code>null</code> if no style is given 103 */ 104 public static String combine(final String... styles) { 105 final StringBuilder sb = new StringBuilder(); 106 for (final String style : styles) { 107 if (style != null) { 108 if (sb.length() > 0) { 109 sb.append(" "); 110 } 111 sb.append(style); 112 } 113 } 114 return sb.length() == 0 ? null : sb.toString(); 115 } 116 117 private Styles() { 118 } 119 120} 121