package ru.rsdn.patterns.mvc.samples;

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

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

/**
 * Демонстрация
 */
public class SwitchDemo {
	public static void main(String[] args) {
		final Display display = new Display();
		final Shell shell = new Shell(display);
		shell.setLayout(new FillLayout());
		shell.setText("Переключатель");
		final SwitchView view = new SwitchView(shell);
		view.setModel(new Model<Switch>(new Switch()));
		shell.pack();
		shell.open();
		while (!shell.isDisposed())
			if (!display.readAndDispatch())
				display.sleep();
		display.dispose();
	}
}
