package org.simantics.scl.ui.browser; import org.eclipse.swt.SWTError; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell; import org.junit.Test; public class TestSCLDocumentationBrowser { @Test public void testDocumentationBrowser() throws Exception { Display display = new Display(); Shell shell = new Shell(display); shell.setText("SCL module documentation"); //$NON-NLS-1$ shell.setLayout(new FillLayout()); SCLDocumentationBrowser browser; try { browser = new SCLDocumentationBrowser(shell); } catch (SWTError e) { System.out.println("Could not instantiate Browser: " + e.getMessage()); //$NON-NLS-1$ display.dispose(); return; } browser.setLocation("Prelude"); //$NON-NLS-1$ shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); } }