/*
 * Created on Dec 30, 2003
 *
 */
package LumiSoft.UI.Controls;

import java.awt.*;

/**
 * Tab control tab page.
 */
public class WTabControlPage 
{
	private WTabBarItem m_pTab     = null;
	private Component   m_pTabPage = null;
	private Object      m_pTag     = null;
	
	/**
	 * Default constructor.
	 * @param tab
	 * @param tabPage
	 */
	public WTabControlPage(WTabBarItem tab,Component tabPage)
	{
		m_pTab     = tab;
		m_pTabPage = tabPage;
	}
	
		
	/**
	 * Gets caption text.
	 * @return
	 */
	public String getText()
	{
		return m_pTab.getText();
	}
	/**
	 * Sets caption text.
	 * @param value
	 */
	public void setText(String value)
	{
		m_pTab.setText(value);
	}
	
	/**
	 * Gets tag (user data).
	 * @return
	 */
	public Object getTag()
	{
		return m_pTag;
	}
	/**
	 * Sets tag (user data).
	 * @param value
	 */
	public void setTag(Object value)
	{
		if(m_pTag != value){
			m_pTag = value;
		}
	}
	
	/**
	 * Gets control what fills tab area.
	 * @return
	 */
	public Component getTabPage()
	{
		return m_pTabPage;
	}
	
	/**
	 * Gets if tab page is visible.
	 * @return
	 */
	public boolean getVisible()
	{
		return m_pTab.getVisible();
	}
	/**
	 * Sets if tab page is visible.
	 * @param value
	 */
	public void setVisible(boolean value)
	{
		m_pTab.setVisible(false);
	}

}
