Integrated first version of new SWT Browser (MSIE under Windows; Mozilla under Linux)
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / views / browser / BrowserView.java
1 /*******************************************************************************
2  * Copyright (c) 2000, 2003 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials 
4  * are made available under the terms of the Common Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/cpl-v10.html
7  * 
8  * Contributors:
9  *     IBM Corporation - initial API and implementation
10  *******************************************************************************/
11 package net.sourceforge.phpeclipse.views.browser;
12 import org.eclipse.swt.widgets.Composite;
13 import org.eclipse.ui.part.ViewPart;
14 /**
15  * <code>BrowserView</code> is a simple demonstration of the SWT Browser
16  * widget. It consists of a workbench view and tab folder where each tab in the
17  * folder allows the user to interact with a control.
18  * 
19  * @see ViewPart
20  */
21 public class BrowserView extends ViewPart {
22   public final static String ID_BROWSER = "net.sourceforge.phpeclipse.views.browser";
23   PHPBrowser instance = null;
24   /**
25    * Create the example
26    * 
27    * @see ViewPart#createPartControl
28    */
29   public void createPartControl(Composite frame) {
30     instance = new PHPBrowser(frame);
31   }
32   /**
33    * Called when we must grab focus.
34    * 
35    * @see org.eclipse.ui.part.ViewPart#setFocus
36    */
37   public void setFocus() {
38     instance.setFocus();
39   }
40   /**
41    * Called when the View is to be disposed
42    */
43   public void dispose() {
44     instance.dispose();
45     instance = null;
46     super.dispose();
47   }
48   public void setUrl(String url) {
49     instance.browser.setUrl(url);
50   }
51 }