11package io .jenkins .plugins .datatables ;
22
33import org .apache .commons .lang3 .StringUtils ;
4- import org .jenkins .ui .symbol .Symbol ;
54import org .jenkins .ui .symbol .SymbolRequest .Builder ;
65
76import com .fasterxml .jackson .core .JsonProcessingException ;
@@ -38,11 +37,7 @@ public class TableColumn {
3837 * @return the HTML div to create the details column
3938 */
4039 public static String renderDetailsColumn (final String detailsText ) {
41- return div ()
42- .withClass ("details-control" )
43- .attr ("data-description" , detailsText )
44- .with (join (symbol ("add" , "open" ),
45- symbol ("remove" , "close" ))).render ();
40+ return renderDetailsColumn (detailsText , new JenkinsFacade ());
4641 }
4742
4843 /**
@@ -51,18 +46,20 @@ public static String renderDetailsColumn(final String detailsText) {
5146 * @param detailsText
5247 * the text to show if the column has been expanded.
5348 * @param jenkinsFacade
54- * facade for Jenkins API calls
49+ * facade for Jenkins API calls to get symbols
5550 *
5651 * @return the HTML div to create the details column
57- * @deprecated use {@link #renderDetailsColumn(String)}
5852 */
59- @ Deprecated
60- public static String renderDetailsColumn (final String detailsText , @ SuppressWarnings ("unused" ) final JenkinsFacade jenkinsFacade ) {
61- return renderDetailsColumn (detailsText );
53+ public static String renderDetailsColumn (final String detailsText , final JenkinsFacade jenkinsFacade ) {
54+ return div ()
55+ .withClass ("details-control" )
56+ .attr ("data-description" , detailsText )
57+ .with (join (symbol ("add" , "open" , jenkinsFacade ),
58+ symbol ("remove" , "close" , jenkinsFacade ))).render ();
6259 }
6360
64- private static String symbol (final String imageName , final String cssId ) {
65- return Symbol . get (new Builder ()
61+ private static String symbol (final String imageName , final String cssId , final JenkinsFacade jenkins ) {
62+ return jenkins . getSymbol (new Builder ()
6663 .withName (imageName + "-circle-outline" )
6764 .withPluginName ("ionicons-api" )
6865 .withClasses ("details-icon details-icon-" + cssId )
@@ -354,7 +351,8 @@ public enum ColumnType {
354351 /** Numbers will be shown right aligned, and use a simple number sorting. */
355352 NUMBER ("num" ),
356353 /**
357- * Numbers will be shown right aligned, and use a simple number sorting. May contain HTML tags also in the data.
354+ * Numbers will be shown right aligned, and use a simple number sorting. May contain HTML tags also in the
355+ * data.
358356 */
359357 HTML_NUMBER ("html-num" ),
360358 /**
0 commit comments