/*
 * Created on 2005-01-01
 *
 * Part of the Symbian development plug-in for Eclipse
 * Copyright (C) Mikołaj Zalewski, 2005
 */
package pl.zalewski.mikolaj.symbdev.ui.mmpedit;

import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IPath;
import org.eclipse.swt.layout.GridData;
import org.eclipse.ui.forms.IManagedForm;
import org.eclipse.ui.forms.editor.FormEditor;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.ScrolledForm;

import pl.zalewski.mikolaj.symbdev.SymbianSDKEntry;
import pl.zalewski.mikolaj.symbdev.core.mmpmodel.IMMPModel;

/**
 * The Build page of the MMP editor
 * 
 * @author mikolaj
 */
public class BuildPage extends MMPFormPage {

    public static final String PAGE_ID="mmp_build";    
    
    /**
     * @param editor
     * @param model
     */
    public BuildPage(FormEditor editor, IMMPModel model, IProject project,
            SymbianSDKEntry sdk, IPath currPath) {
        super(editor, PAGE_ID, "Build");
        fModel=model;
        fSDK=sdk;
        fProject=project;
        fCurrPath=currPath;
    }
    
    protected void createFormContent(IManagedForm managedForm)
    {
        super.createFormContent(managedForm);
        ScrolledForm form=managedForm.getForm();
        form.setText("Options");
        FormToolkit toolkit=managedForm.getToolkit();
        
        fSources=new SourceSection(form.getBody(), toolkit, fModel, fProject, fSDK, fCurrPath);
		GridData gd = new GridData(GridData.FILL_BOTH);
		gd.horizontalSpan = 2;
		gd.verticalSpan = 1;
		fSources.getSection().setLayoutData(gd);
		
		fLibraries=new LibrariesOptionsSection(form.getBody(), toolkit, false, fModel, fProject);
		gd=new GridData(GridData.FILL_BOTH);
		fLibraries.getSection().setLayoutData(gd);
		fDebugLibraries=new LibrariesOptionsSection(form.getBody(), toolkit, true, fModel, fProject);
		gd=new GridData(GridData.FILL_BOTH);
		fDebugLibraries.getSection().setLayoutData(gd);
    }    

    SourceSection fSources;
    LibrariesOptionsSection fLibraries;
    LibrariesOptionsSection fDebugLibraries;    
    IMMPModel fModel;
    SymbianSDKEntry fSDK;
    IProject fProject;
    IPath fCurrPath;
}
