package ru.rsdn.defensive.sample;

import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

import ru.rsdn.patterns.mvc.model.Model;

/**
 * Демонстрация
 */
public class CompanyDemo {
	public static void main(String[] args) {
		final Display display = new Display();
		final Shell shell = new Shell(display);
		shell.setLayout(new GridLayout());
		shell.setText("Компания");
		final CompanyView view = new CompanyView(shell);
		view.setModel(new Model<Company>(new Company()));
		shell.pack();
		shell.open();
		while (!shell.isDisposed())
			if (!display.readAndDispatch())
				display.sleep();
		display.dispose();
	}
}
