io.imunity.vaadin.endpoint.common.HtmlLabelFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of unity-server-vaadin-endpoint-common Show documentation
Show all versions of unity-server-vaadin-endpoint-common Show documentation
Common Vaadin endpoint components
The newest version!
/*
* Copyright (c) 2021 Bixbit - Krzysztof Benedyczak. All rights reserved.
* See LICENCE.txt file for licensing information.
*/
package io.imunity.vaadin.endpoint.common;
import com.google.common.html.HtmlEscapers;
import com.vaadin.flow.component.Html;
import pl.edu.icm.unity.base.message.MessageSource;
public class HtmlLabelFactory
{
public static Html getHtmlLabel(MessageSource msg, String name, String msgKey, Object... unsafeArgs)
{
Object[] escapedArgs = escapeArgs(unsafeArgs);
Html html = new Html(msg.getMessageNullArg(msgKey, escapedArgs));
html.getElement().setProperty("label", name);
return html;
}
private static Object[] escapeArgs(Object... unsafeArgs)
{
Object[] escapedArgs = new Object[unsafeArgs.length];
for (int i=0; i
© 2015 - 2025 Weber Informatics LLC | Privacy Policy