/*******************************************************************************
 * 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.internal.ui.views.attributes.page;

import org.eclipse.birt.report.designer.internal.ui.views.attributes.widget.PropertyDescriptorFactory;
import org.eclipse.birt.report.designer.ui.views.attributes.IPropertyDescriptor;
import org.eclipse.birt.report.model.api.SimpleMasterPageHandle;
import org.eclipse.birt.report.model.api.elements.ReportDesignConstants;
import org.eclipse.swt.widgets.Composite;

/**
 * The Header/Footer attribute page of SimpleMasterPage element.
 */
public class HeaderFooterPage extends AttributePage
{

	/**
	 * @param parent
	 *            A widget which will be the parent of the new instance (cannot
	 *            be null)
	 * @param style
	 *            The style of widget to construct
	 */
	public HeaderFooterPage( Composite parent, int style )
	{
		super( parent, style );
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.eclipse.birt.report.designer.internal.ui.views.attributes.page.AttributePage#buildUI()
	 */
	protected void buildUI( )
	{
		setLayout( WidgetUtil.createGridLayout( 2 ) );

		String[] properties = {
				SimpleMasterPageHandle.SHOW_HEADER_ON_FIRST_PROP,
				SimpleMasterPageHandle.SHOW_FOOTER_ON_LAST_PROP,
				// SimpleMasterPageHandle.FLOATING_FOOTER,
		};
				
		for ( int i = 0; i < properties.length; i++ )
		{
			IPropertyDescriptor descriptor = PropertyDescriptorFactory.getPropertyDescriptor( ReportDesignConstants.SIMPLE_MASTER_PAGE_ELEMENT,
					properties[i] );
			propertiesMap.put( properties[i], descriptor );
			descriptor.createControl( this );
		}
	}
}