All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.jwebmp.plugins.themify.icons.ThemifyIcon Maven / Gradle / Ivy

There is a newer version: 1.2.2.1-jre17
Show newest version
package com.jwebmp.plugins.themify.icons;

import com.jwebmp.core.base.ComponentHierarchyBase;
import com.jwebmp.core.base.html.Span;
import com.jwebmp.core.base.html.attributes.NoAttributes;
import com.jwebmp.core.base.interfaces.IComponentHierarchyBase;
import com.jwebmp.core.base.interfaces.IIcon;

/**
 * Creates a span that will contain this icon as a class name
 */
public class ThemifyIcon
		extends Span
	implements IIcon
{
	private ThemifyIcons icon;
	/**
	 * Creates the span for the given icon
	 *
	 * @param icon
	 * 		The icon to use
	 */
	public ThemifyIcon(ThemifyIcons icon)
	{
		this.icon = icon;
	}

	@Override
	public void preConfigure()
	{
		if(!isConfigured())
		{
			addClass(icon);
		}
		super.preConfigure();
	}

	/**
	 * Creates an empty span with no icon, use the other constructor
	 */
	public ThemifyIcon()
	{
		//No config required
	}

	@Override
	public String getClassName()
	{
		return icon.toString();
	}

	@Override
	public ComponentHierarchyBase getIconComponent()
	{
		return this;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy