/*
ItsNat Java Web Application Framework
Copyright (C) 2007 Innowhere Software Services S.L., Spanish Company
Author: Jose Maria Arranz Santamaria
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. See the GNU Affero General Public
License for more details. See the copy of the GNU Affero General Public License
included in this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.itsnat.comp;
import org.itsnat.core.domutil.ElementRenderer;
/**
* Is the base interface of button components with a label.
*
* <p>The label is set calling {@link #setLabelValue(Object)}. If never called
* this component does not change the original markup. A renderer is used to
* render the label as markup.</p>
*
* @author Jose Maria Arranz Santamaria
*/
public interface ItsNatButtonLabel extends ItsNatButton
{
/**
* Returns the current label.
*
* <p>Returned value is the value set by the last call to {@link #setLabelValue(Object)}.</p>
*
* @return the current label value. Null by default.
* @see #setLabelValue(Object)
*/
public Object getLabelValue();
/**
* Sets the current label value, this value is saved as is and rendered
* as markup using the current renderer returned by {@link #getElementRenderer()}.
*
* @param value the new label value.
* @see #getLabelValue()
*/
public void setLabelValue(Object value);
/**
* Returns the current renderer used to render the label as markup.
*
* <p>By default uses the default renderer returned by
* {@link org.itsnat.core.ItsNatDocument#createDefaultElementRenderer()}. Only
* {@link org.itsnat.comp.html.ItsNatHTMLInputReset},
* {@link org.itsnat.comp.html.ItsNatHTMLInputSubmit},
* and {@link org.itsnat.comp.html.ItsNatHTMLInputButton}
* components use by default an internal
* renderer to render the label as the value of the "value" attribute
* of the <input> element.</p>
*
* @return the current renderer.
* @see #setLabelValue(Object)
* @see #setElementRenderer(ElementRenderer)
*/
public ElementRenderer getElementRenderer();
/**
* Sets the current renderer.
*
* @param renderer the new renderer.
* @see #getElementRenderer()
*/
public void setElementRenderer(ElementRenderer renderer);
}
|