/**
 * 
 */
package org.gcube.portlets.user.td.client.ribbon;

import com.allen_sauer.gwt.log.client.Log;
import com.google.web.bindery.event.shared.EventBus;
import com.sencha.gxt.widget.core.client.TabPanel;
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer;
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.VerticalLayoutData;


/**
 * 
 * @author "Giancarlo Panichi" 
 * <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a> 
 *
 */
public class TabularDataRibbon {

	protected TabPanel ribbon;
	
	//protected PlainTabPanel ribbon;
	    
	protected FileToolBar fileToolBar;
	protected ReviewToolBar reviewToolBar;
	protected FormulasToolBar formulasToolBar;
	protected ChartsToolBar chartsToolBar;

	public TabularDataRibbon(EventBus eventBus) {
		try {
			ribbon = new TabPanel();
			ribbon.setId("Ribbon");
			ribbon.setHeight("106px");
			
			VerticalLayoutData vldata=new VerticalLayoutData(1, -1);
			
			fileToolBar = new FileToolBar(eventBus);
			VerticalLayoutContainer con = new VerticalLayoutContainer();
			con.add(fileToolBar.getToolBar(), vldata);
			ribbon.add(con, "Home");
			
			reviewToolBar = new ReviewToolBar(eventBus);
			con = new VerticalLayoutContainer();
			
			con.add(reviewToolBar.getToolBar(), vldata);
			ribbon.add(con, "Review");

			formulasToolBar = new FormulasToolBar(eventBus);
			con = new VerticalLayoutContainer();
			con.add(formulasToolBar.getToolBar(), vldata);
			ribbon.add(con, "Modify");

			chartsToolBar = new ChartsToolBar(eventBus);
			con = new VerticalLayoutContainer();
			con.add(chartsToolBar.getToolBar(), vldata);
			ribbon.add(con, "Applications");
			
		} catch (Exception e) {
			e.printStackTrace();
			Log.error("Ribbon error:" + e.getLocalizedMessage());
		}

	}

	/**
	 * @return the container
	 */
	public TabPanel getContainer() {
		return ribbon;
	}

}
