package com.gx.obe.evaluation.step.composite.boq;

import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.StackLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;

import com.gx.obe.DictValueEnum;
import com.gx.obe.evaluation.step.inter.IDwgcDetail;
import com.gx.obe.util.utils.LogUtils;
import com.gx.obe.web.entity.boq.ConstructProject;

/**
 * @Description: 工料机汇总
 * @author guoyr
 */
public class GljHzDetailComposite extends Composite implements IDwgcDetail {
	{
		LogUtils.logClass(GljHzDetailComposite.class);
	}
	private Composite composite;
	private StackLayout stackLayout = new StackLayout();
	
	/**
	 * Create the composite.
	 * 
	 * @param parent
	 * @param style
	 */
	public GljHzDetailComposite(Composite parent, int style) {
		super(parent, style);
		GridLayout gridLayout = new GridLayout(1, false);
		gridLayout.verticalSpacing = 0;
		gridLayout.marginHeight = 0;
		gridLayout.marginWidth = 0;
		setLayout(gridLayout);
		
		composite = new Composite(this, SWT.NONE);
		composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
		composite.setLayout(stackLayout);
		init();
	}
	
	/**
	 * @Description: 初始化界面
	 * @author guoyr
	 */
	private void init() {}
	
	/**
	 * @Description: 刷新工料机明细
	 * @author guoyr
	 * @param unitConstructProject
	 */
	public void refreshDetail(ConstructProject unitConstructProject) {
		GljItemDetailComposite gljDetail = new GljItemDetailComposite(composite, SWT.NONE);
		gljDetail.refreshDetail(unitConstructProject, DictValueEnum.MaterialSummary.ZC);
		stackLayout.topControl = gljDetail.getComposite();
		composite.layout();
	}
	
	public Composite getComposite() {
		return this;
	}
	
	protected void checkSubclass() {}
}
