KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > browser > browsers > NullBrowser


1 /*******************************************************************************
2  * Copyright (c) 2003, 2005 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - Initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.ui.internal.browser.browsers;
12
13 import java.net.URL JavaDoc;
14
15 import org.eclipse.ui.PartInitException;
16 import org.eclipse.ui.browser.AbstractWebBrowser;
17 import org.eclipse.ui.internal.browser.Messages;
18 import org.eclipse.ui.internal.browser.WebBrowserUIPlugin;
19
20 public class NullBrowser extends AbstractWebBrowser {
21     public NullBrowser(String JavaDoc id) {
22         super(id);
23     }
24
25     public void openURL(URL JavaDoc url) throws PartInitException {
26         WebBrowserUIPlugin.logError(
27             "There is no browser adapter configured to display " //$NON-NLS-1$
28
+ url
29             + ". Ensure that you have a required browser and adapter installed, and that the browser program is available on the system path.", //$NON-NLS-1$
30
null);
31         throw new PartInitException(Messages.errorNoBrowser);
32     }
33 }
Popular Tags