/*
 * This class was automatically generated with 
 * <a href="http://www.castor.org">Castor 0.9.7</a>, using an XML
 * Schema.
 * $Id$
 */

package com.queplix.core.modules.config.jxb;

  //---------------------------------/
 //- Imported classes and packages -/
//---------------------------------/

import java.io.IOException;
import java.io.Reader;
import java.io.Serializable;
import java.io.Writer;
import java.util.ArrayList;
import java.util.Enumeration;
import org.exolab.castor.xml.MarshalException;
import org.exolab.castor.xml.Marshaller;
import org.exolab.castor.xml.Unmarshaller;
import org.exolab.castor.xml.ValidationException;
import org.xml.sax.ContentHandler;

/**
 * The sequence of tabs
 * 
 * @version $Revision$ $Date$
 */
public class Tab extends com.queplix.core.utils.jxb.JXBObject 
implements java.io.Serializable
{


      //--------------------------/
     //- Class/Member Variables -/
    //--------------------------/

    /**
     * The name of focus tab
     */
    private java.lang.String _name;

    /**
     * Field _subFocus
     */
    private java.lang.String _subFocus;

    /**
     * Field _order
     */
    private java.lang.Integer _order = new java.lang.Integer("-1");

    /**
     * Field _caption
     */
    private java.lang.String _caption;

    /**
     * Field _inframelinks
     */
    private java.lang.Boolean _inframelinks = new java.lang.Boolean("false");

    /**
     * Field _grid
     */
    private java.lang.Boolean _grid = new java.lang.Boolean("true");

    /**
     * The sequence of form definition
     */
    private java.util.ArrayList _formList;

    /**
     * The focus tab captions collection
     */
    private com.queplix.core.modules.config.jxb.Captions _captions;

    /**
     * Link to the Help Guide section
     */
    private java.lang.String _helplink;


      //----------------/
     //- Constructors -/
    //----------------/

    public Tab() 
     {
        super();
        _formList = new ArrayList();
    } //-- com.queplix.core.modules.config.jxb.Tab()


      //-----------/
     //- Methods -/
    //-----------/

    /**
     * Method addForm
     * 
     * 
     * 
     * @param vForm
     */
    public void addForm(com.queplix.core.modules.config.jxb.Form vForm)
        throws java.lang.IndexOutOfBoundsException
    {
        _formList.add(vForm);
    } //-- void addForm(com.queplix.core.modules.config.jxb.Form) 

    /**
     * Method addForm
     * 
     * 
     * 
     * @param index
     * @param vForm
     */
    public void addForm(int index, com.queplix.core.modules.config.jxb.Form vForm)
        throws java.lang.IndexOutOfBoundsException
    {
        _formList.add(index, vForm);
    } //-- void addForm(int, com.queplix.core.modules.config.jxb.Form) 

    /**
     * Method clearForm
     * 
     */
    public void clearForm()
    {
        _formList.clear();
    } //-- void clearForm() 

    /**
     * Method enumerateForm
     * 
     * 
     * 
     * @return Enumeration
     */
    public java.util.Enumeration enumerateForm()
    {
        return new org.exolab.castor.util.IteratorEnumeration(_formList.iterator());
    } //-- java.util.Enumeration enumerateForm() 

    /**
     * Returns the value of field 'caption'.
     * 
     * @return String
     * @return the value of field 'caption'.
     */
    public java.lang.String getCaption()
    {
        return this._caption;
    } //-- java.lang.String getCaption() 

    /**
     * Returns the value of field 'captions'. The field 'captions'
     * has the following description: The focus tab captions
     * collection
     * 
     * @return Captions
     * @return the value of field 'captions'.
     */
    public com.queplix.core.modules.config.jxb.Captions getCaptions()
    {
        return this._captions;
    } //-- com.queplix.core.modules.config.jxb.Captions getCaptions() 

    /**
     * Method getForm
     * 
     * 
     * 
     * @param index
     * @return Form
     */
    public com.queplix.core.modules.config.jxb.Form getForm(int index)
        throws java.lang.IndexOutOfBoundsException
    {
        //-- check bounds for index
        if ((index < 0) || (index > _formList.size())) {
            throw new IndexOutOfBoundsException();
        }
        
        return (com.queplix.core.modules.config.jxb.Form) _formList.get(index);
    } //-- com.queplix.core.modules.config.jxb.Form getForm(int) 

    /**
     * Method getForm
     * 
     * 
     * 
     * @return Form
     */
    public com.queplix.core.modules.config.jxb.Form[] getForm()
    {
        int size = _formList.size();
        com.queplix.core.modules.config.jxb.Form[] mArray = new com.queplix.core.modules.config.jxb.Form[size];
        for (int index = 0; index < size; index++) {
            mArray[index] = (com.queplix.core.modules.config.jxb.Form) _formList.get(index);
        }
        return mArray;
    } //-- com.queplix.core.modules.config.jxb.Form[] getForm() 

    /**
     * Method getFormCount
     * 
     * 
     * 
     * @return int
     */
    public int getFormCount()
    {
        return _formList.size();
    } //-- int getFormCount() 

    /**
     * Returns the value of field 'grid'.
     * 
     * @return Boolean
     * @return the value of field 'grid'.
     */
    public java.lang.Boolean getGrid()
    {
        return this._grid;
    } //-- java.lang.Boolean getGrid() 

    /**
     * Returns the value of field 'helplink'. The field 'helplink'
     * has the following description: Link to the Help Guide
     * section
     * 
     * @return String
     * @return the value of field 'helplink'.
     */
    public java.lang.String getHelplink()
    {
        return this._helplink;
    } //-- java.lang.String getHelplink() 

    /**
     * Returns the value of field 'inframelinks'.
     * 
     * @return Boolean
     * @return the value of field 'inframelinks'.
     */
    public java.lang.Boolean getInframelinks()
    {
        return this._inframelinks;
    } //-- java.lang.Boolean getInframelinks() 

    /**
     * Returns the value of field 'name'. The field 'name' has the
     * following description: The name of focus tab
     * 
     * @return String
     * @return the value of field 'name'.
     */
    public java.lang.String getName()
    {
        return this._name;
    } //-- java.lang.String getName() 

    /**
     * Returns the value of field 'order'.
     * 
     * @return Integer
     * @return the value of field 'order'.
     */
    public java.lang.Integer getOrder()
    {
        return this._order;
    } //-- java.lang.Integer getOrder() 

    /**
     * Returns the value of field 'subFocus'.
     * 
     * @return String
     * @return the value of field 'subFocus'.
     */
    public java.lang.String getSubFocus()
    {
        return this._subFocus;
    } //-- java.lang.String getSubFocus() 

    /**
     * Method isValid
     * 
     * 
     * 
     * @return boolean
     */
    public boolean isValid()
    {
        try {
            validate();
        }
        catch (org.exolab.castor.xml.ValidationException vex) {
            return false;
        }
        return true;
    } //-- boolean isValid() 

    /**
     * Method marshal
     * 
     * 
     * 
     * @param out
     */
    public void marshal(java.io.Writer out)
        throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
    {
        
        Marshaller.marshal(this, out);
    } //-- void marshal(java.io.Writer) 

    /**
     * Method marshal
     * 
     * 
     * 
     * @param handler
     */
    public void marshal(org.xml.sax.ContentHandler handler)
        throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
    {
        
        Marshaller.marshal(this, handler);
    } //-- void marshal(org.xml.sax.ContentHandler) 

    /**
     * Method removeForm
     * 
     * 
     * 
     * @param vForm
     * @return boolean
     */
    public boolean removeForm(com.queplix.core.modules.config.jxb.Form vForm)
    {
        boolean removed = _formList.remove(vForm);
        return removed;
    } //-- boolean removeForm(com.queplix.core.modules.config.jxb.Form) 

    /**
     * Sets the value of field 'caption'.
     * 
     * @param caption the value of field 'caption'.
     */
    public void setCaption(java.lang.String caption)
    {
        this._caption = caption;
    } //-- void setCaption(java.lang.String) 

    /**
     * Sets the value of field 'captions'. The field 'captions' has
     * the following description: The focus tab captions collection
     * 
     * @param captions the value of field 'captions'.
     */
    public void setCaptions(com.queplix.core.modules.config.jxb.Captions captions)
    {
        this._captions = captions;
    } //-- void setCaptions(com.queplix.core.modules.config.jxb.Captions) 

    /**
     * Method setForm
     * 
     * 
     * 
     * @param index
     * @param vForm
     */
    public void setForm(int index, com.queplix.core.modules.config.jxb.Form vForm)
        throws java.lang.IndexOutOfBoundsException
    {
        //-- check bounds for index
        if ((index < 0) || (index > _formList.size())) {
            throw new IndexOutOfBoundsException();
        }
        _formList.set(index, vForm);
    } //-- void setForm(int, com.queplix.core.modules.config.jxb.Form) 

    /**
     * Method setForm
     * 
     * 
     * 
     * @param formArray
     */
    public void setForm(com.queplix.core.modules.config.jxb.Form[] formArray)
    {
        //-- copy array
        _formList.clear();
        for (int i = 0; i < formArray.length; i++) {
            _formList.add(formArray[i]);
        }
    } //-- void setForm(com.queplix.core.modules.config.jxb.Form) 

    /**
     * Sets the value of field 'grid'.
     * 
     * @param grid the value of field 'grid'.
     */
    public void setGrid(java.lang.Boolean grid)
    {
        this._grid = grid;
    } //-- void setGrid(java.lang.Boolean) 

    /**
     * Sets the value of field 'helplink'. The field 'helplink' has
     * the following description: Link to the Help Guide section
     * 
     * @param helplink the value of field 'helplink'.
     */
    public void setHelplink(java.lang.String helplink)
    {
        this._helplink = helplink;
    } //-- void setHelplink(java.lang.String) 

    /**
     * Sets the value of field 'inframelinks'.
     * 
     * @param inframelinks the value of field 'inframelinks'.
     */
    public void setInframelinks(java.lang.Boolean inframelinks)
    {
        this._inframelinks = inframelinks;
    } //-- void setInframelinks(java.lang.Boolean) 

    /**
     * Sets the value of field 'name'. The field 'name' has the
     * following description: The name of focus tab
     * 
     * @param name the value of field 'name'.
     */
    public void setName(java.lang.String name)
    {
        this._name = name;
    } //-- void setName(java.lang.String) 

    /**
     * Sets the value of field 'order'.
     * 
     * @param order the value of field 'order'.
     */
    public void setOrder(java.lang.Integer order)
    {
        this._order = order;
    } //-- void setOrder(java.lang.Integer) 

    /**
     * Sets the value of field 'subFocus'.
     * 
     * @param subFocus the value of field 'subFocus'.
     */
    public void setSubFocus(java.lang.String subFocus)
    {
        this._subFocus = subFocus;
    } //-- void setSubFocus(java.lang.String) 

    /**
     * Method unmarshal
     * 
     * 
     * 
     * @param reader
     * @return Object
     */
    public static java.lang.Object unmarshal(java.io.Reader reader)
        throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
    {
        return (com.queplix.core.modules.config.jxb.Tab) Unmarshaller.unmarshal(com.queplix.core.modules.config.jxb.Tab.class, reader);
    } //-- java.lang.Object unmarshal(java.io.Reader) 

    /**
     * Method validate
     * 
     */
    public void validate()
        throws org.exolab.castor.xml.ValidationException
    {
        org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
        validator.validate(this);
    } //-- void validate() 

}
