/*******************************************************************************
 * Copyright (c) 2004 Actuate Corporation.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *  Actuate Corporation  - initial API and implementation
 *******************************************************************************/

package org.eclipse.birt.report.designer.ui.views.attributes;

import java.util.List;

import org.eclipse.birt.report.designer.internal.ui.views.attributes.page.HighlightsPage;
import org.eclipse.birt.report.designer.internal.ui.views.attributes.page.MapPage;
import org.eclipse.birt.report.designer.nls.Messages;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.TabFolder;
import org.eclipse.swt.widgets.TabItem;

/**
 * Instances of ColumnPageGenerator take change of creating attribute page
 * correspond to TableRow element.
 */
public class RowPageGenerator extends CategoryPageGenerator
{

	/**
	 * SWT widgets presented highlights properties of DE Table element
	 */
	private HighlightsPage highlightsPage;

	private MapPage mapPage;

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.eclipse.birt.report.designer.ui.views.attributes.IPageGenerator#createTabItems(org.eclipse.swt.widgets.TabFolder,
	 *      java.util.List)
	 */
	public void createTabItems( TabFolder tabFolder, List input )
	{
		super.createTabItems( tabFolder, input );

		TabItem tabItem;

		if ( mapPage == null )
		{
			if ( mapPage == null )
			{
				mapPage = new MapPage( tabFolder, SWT.NONE );
				tabItem = new TabItem( tabFolder, SWT.NONE );
				tabItem.setText( Messages.getString( "RowPageGenerator.TabItem.map" ) ); //$NON-NLS-1$
				tabItem.setControl( mapPage );
			}
		}
		mapPage.setInput( input );

		if ( highlightsPage == null )
		{
			if ( highlightsPage == null )
			{
				highlightsPage = new HighlightsPage( tabFolder, SWT.NONE );
				tabItem = new TabItem( tabFolder, SWT.NONE );
				tabItem.setText( Messages.getString( "RowPageGenerator.TabItem.Highlights" ) ); //$NON-NLS-1$
				tabItem.setControl( highlightsPage );
			}
		}
		highlightsPage.setInput( input );
	}
}