Package com.dodo.blog.ui.component.composite

Source Code of com.dodo.blog.ui.component.composite.FormRow

package com.dodo.blog.ui.component.composite;

import com.dodo.blog.ui.component.HtmlComponent;
import com.dodo.blog.ui.component.container.Panel;
import com.dodo.blog.ui.component.simple.Label;

/**
* @author <a href="mailto:pohorelec@comvai.com">Jozef Pohorelec</a>
*/
public class FormRow
        extends Panel
{
    private static final long serialVersionUID = 1L;

    public FormRow( String text, HtmlComponent component )
    {
        this( text, component, false );
    }

    public FormRow( String text, HtmlComponent component, boolean componentFirst )
    {
        Label label = new Label( text + ( componentFirst ? "" : ":" ), component.getId() );

        if ( componentFirst )
        {
            add( component );
            add( label );
        }
        else
        {
            add( label );
            add( component );
        }

        setClassName( "form-row" );
    }
}
TOP

Related Classes of com.dodo.blog.ui.component.composite.FormRow

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.