package com.interpress_project.modernshare.client.view.wizard;

import java.util.Date;

import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;

/**
 * @stereotype Confirm page
 */
public class ExportConfirmPage extends WizardPage {
	private Label lblPath = null, lblRevision = null, lblModified = null;

	/**
	 * CheckoutConfirmPage
	 */
	public ExportConfirmPage() {
		super("ExportConfirmPage");

		setTitle("取り出し内容の確認");
		setDescription("以下のデータを取り出します。");
		setPageComplete(true);
	}

	/**
	 * createControl
	 */
	public void createControl(Composite parent) {
		Composite composite = new Composite(parent, SWT.NULL);

		GridLayout layout = new GridLayout();
		composite.setLayout(layout);
		layout.numColumns = 2;
		layout.verticalSpacing = 9;

		new Label(composite, SWT.NONE).setText("エキスポート先: ");
		lblPath = new Label(composite, SWT.NONE);
		GridData gd = new GridData(GridData.FILL_HORIZONTAL);
		lblPath.setLayoutData(gd);

		new Label(composite, SWT.NONE).setText("更新日: ");
		lblModified = new Label(composite, SWT.NONE);
		gd = new GridData(GridData.FILL_HORIZONTAL);
		lblModified.setLayoutData(gd);

		new Label(composite, SWT.NONE).setText("リビジョン番号: ");
		lblRevision = new Label(composite, SWT.NONE);
		gd = new GridData(GridData.FILL_HORIZONTAL);
		lblRevision.setLayoutData(gd);

		setControl(composite);
	}

	/**
	 * setPath
	 * @param path String
	 */
	public void setPath(String path) {
		lblPath.setText(path);
	}

	/**
	 * getPath
	 * @return
	 */
	public String getPath() {
		return lblPath.getText();
	}

	/**
	 * setRevision
	 * @param rev
	 */
	public void setRevision(long rev) {
		lblRevision.setText(String.valueOf(rev));
	}

	/**
	 * setModified
	 * @param date
	 */
	public void setModified(Date date) {
		lblModified.setText(date.toString());
	}
}
