storagehub-icons-library/src/main/java/org/gcube/portal/stohubicons/shared/MDIcon.java

51 lines
1.2 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package org.gcube.portal.stohubicons.shared;
import java.io.Serializable;
/**
*
* @author M. Assante, CNR-ISTI
*
* easy to incorporate icons into your web page. Heres a small example: <i class="material-icons">face</i>
* @see <a href="http://google.github.io/material-design-icons/">http://google.github.io/material-design-icons/</a>
* object representing Material Design Icon &lt;i class="material-icons"&gt; $The Returned Material Design Icon Textual Name &lt;/i&gt;
*/
@SuppressWarnings("serial")
public class MDIcon implements Serializable {
private StringBuilder html;
private String textualName;
private String color;
public MDIcon(String textualName, String color) {
this.html = new StringBuilder
("<i style=\"color: ")
.append(color)
.append("\" class=\"material-icons\">")
.append(textualName)
.append("</i>");
this.textualName = textualName;
this.color = color;
}
public String getHtml() {
return html.toString();
}
public String getTextualName() {
return textualName;
}
public void setTextualName(String textualName) {
this.textualName = textualName;
}
public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}
}