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

org.wicketstuff.yui.helper.CSSInlineStyle Maven / Gradle / Ivy

There is a newer version: 8.0.0-M2
Show newest version
package org.wicketstuff.yui.helper;

/**
 * This is a CSS Inline Style "Style=..." where it's toString method will return the
 * string suitable  to be used for the Attribute Modifier
 * 
 * @author josh
 *
 */
public class CSSInlineStyle extends NameValuePair
{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	/**
	 * construct
	 */
	public CSSInlineStyle()
	{
		super();
	}

	@Override
	public String getPrefix()
	{
		return "";
	}

	@Override
	public String getSuffix()
	{
		return "";
	}

	@Override
	public String getValueSeparator()
	{
		return ";";
	}

	@Override
	public String getNameValueSeparator()
	{
		return ":";
	}

	/**
	 * adds the extra ";"
	 */
	@Override
	public String toString()
	{
		String ret = super.toString();
		
		if ((ret != null) && (ret.length() > 0))
		{
			ret = ret + getValueSeparator();
		}
		return ret;
	}
	
	protected String wrapValue(String value)
	{
		// no wrapping for CSS values
		// just return the parameter value
		return value;
	}

	/**
	 * @return
	 */
	public String getStyle()
	{
		return toString();
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy