FileDocCategorySizeDatePackage
Ch08_06.javaAPI DocExample1089Wed Dec 03 18:21:50 GMT 2003org.eclipsebook.ch08

Ch08_06

public class Ch08_06 extends Object

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)

		
		final Display display = new Display();
		Shell shell = new Shell(display);
		shell.setSize(600, 400);
		shell.setLayout(new FillLayout());
		
		OleControlSite oleControlSite;
		
		OleFrame oleFrame = new OleFrame(shell, SWT.NONE);
		oleControlSite = new OleControlSite(oleFrame, SWT.NONE, "Shell.Explorer");
		oleControlSite.doVerb(OLE.OLEIVERB_INPLACEACTIVATE);
		shell.open();
		
		final OleAutomation browser = new OleAutomation(oleControlSite);
	
		int[] browserIDs = browser.getIDsOfNames(new String[]{"Navigate", "URL"}); 
		Variant[] address = new Variant[] {new Variant("http://www.oreilly.com")};
		browser.invoke(browserIDs[0], address, new int[]{browserIDs[1]});
			
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch())
				display.sleep();
		}
	
		browser.dispose();
		display.dispose();