OpenGLExample(Composite parent) { tabFolder = new TabFolder(parent, SWT.NONE); tabs = new OpenGLTab[] { new AntialiasingTab(), new AreaTab(), new FogTab(), new GradientTab(), new LightTab(), new NurbTab(), new ObjectsTab(), new ReflectionTab(), new StencilTab(), new TextureTab(), new TransparencyTab() };  for (int i = 0; i < tabs.length; i++) { TabItem item = new TabItem(tabFolder, SWT.NONE); item.setText(tabs[i].getTabText()); item.setControl(tabs[i].createTabFolderPage(tabFolder)); }  tabFolder.addListener(SWT.Selection, new Listener() { public void handleEvent(Event e) { OpenGLTab tab = tabs[tabFolder.getSelectionIndex()]; tab.setCurrent(); sleep = tab.getSleepLength(); } }); if (tabs.length > 0) { tabs[0].setCurrent(); sleep = tabs[0].getSleepLength(); }  Runnable timer = new Runnable() { public void run() { if (tabFolder.isDisposed()) return; display(); tabFolder.getDisplay().timerExec(sleep, this); } }; timer.run(); tabFolder.addListener(SWT.Dispose, new Listener() { public void handleEvent(Event e) { dispose(); } }); }
public OpenGLExample() {}
	OpenGLExample(Composite parent) {				tabFolder = new TabFolder(parent, SWT.NONE);		tabs =			new OpenGLTab[] {				new AntialiasingTab(),				new AreaTab(),				new FogTab(),				new GradientTab(),				new LightTab(),				new NurbTab(),				new ObjectsTab(),				new ReflectionTab(),				new StencilTab(),				new TextureTab(),				new TransparencyTab()			};						for (int i = 0; i < tabs.length; i++) {			TabItem item = new TabItem(tabFolder, SWT.NONE);			item.setText(tabs[i].getTabText());			item.setControl(tabs[i].createTabFolderPage(tabFolder));		}				tabFolder.addListener(SWT.Selection, new Listener() {			public void handleEvent(Event e) {				OpenGLTab tab = tabs[tabFolder.getSelectionIndex()];				tab.setCurrent();				sleep = tab.getSleepLength();			}		});		if (tabs.length > 0) {			tabs[0].setCurrent();			sleep = tabs[0].getSleepLength();		}				Runnable timer = new Runnable() {			public void run() {				if (tabFolder.isDisposed()) return;				display();				tabFolder.getDisplay().timerExec(sleep, this);			}		};		timer.run();		tabFolder.addListener(SWT.Dispose, new Listener() {			public void handleEvent(Event e) {				dispose();			}		});	}