/*
 * Created on 2005-03-25
 *
 * 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.runtime.IPath;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.TableWrapData;

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

/**
 * Shows the resources properties (file name) as on the Extra page
 * of the MMP editor 
 * 
 * @author mikolaj
 */
public class ResourcesPropertiesSection extends MMPSectionPart {

    public ResourcesPropertiesSection(Composite parent, FormToolkit toolkit,
            IMMPModel model, boolean system, int pos, String rootDir, IPath currentDir) {
        super(parent, toolkit, "Resources",
                (system?"The system resource file will be installed in " +
                		"Z:\\system\\data in the emulator (the installation " +
                		"location for the device can be chosen during packaging)":
                		    "The application resource file will be installed in " +
                    		"the application direcory in the emulator (the installation " +
                    		"location for the device can be chosen during packaging"), 2);
        fModel=model;
        fSystem=system;
        fPos=pos;
        if (system)
            fResource=fModel.getSystemResources()[fPos];
        	else fResource=fModel.getResources()[fPos];
        
        Label l=toolkit.createLabel(fContainer, "Resrouces source file: "+
                fResource.getFileStringType(rootDir, currentDir.toString())
                	.getStringName(), SWT.WRAP);
        TableWrapData td=new TableWrapData(TableWrapData.FILL);
        
//        Button b=toolkit.createButton(fContainer, "Change", SWT.PUSH);
        
        contentCreated();
    }
    
    boolean fSystem;
    int fPos;
    IMMPModel fModel;
    IPath currentDir;
    String rootDir;
    MMPFileReference fResource;
}
