1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/*******************************************************************************
 * Copyright (c) 2000, 2007 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.help.ui.internal.browser;

import org.eclipse.help.browser.*;
import org.eclipse.help.ui.internal.*;
import org.eclipse.help.ui.internal.util.*;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.program.*;

/**
 * Implmentation of IBrowser interface, using org.eclipse.swt.Program
 */
public class SystemBrowserAdapter implements IBrowser {
    String[] cmdarray;

    /**
     * Adapter constructor.
     */
    public SystemBrowserAdapter() {
    }

    /*
     * @see IBrowser#close()
     */
    public void close() {
    }

    /*
     * @see IBrowser#displayURL(String)
     */
    public void displayURL(String url) {
        //      if (Constants.WS_WIN32.equalsIgnoreCase(Platform.getOS())) {
        if (!Program.launch(url)) {
            HelpUIPlugin
                    .logError(
                            "Browser adapter for System Browser failed.  The system has no program registered for file " //$NON-NLS-1$
                                    + url
                                    + ".  Change the file association or choose a different help web browser in the preferences.", //$NON-NLS-1$
                            null);
            ErrorUtil.displayErrorDialog(NLS.bind(Messages.SystemBrowser_noProgramForURL, url));
        }
        //      } else {
        //          Program b = Program.findProgram("html");
        //          if (b == null || !b.execute(url)) {
        //              ErrorUtil.displayErrorDialog(
        //                  HelpUIResources.getString(
        //                      "SystemBrowser.noProgramForHTML",
        //                      url));
        //          }
        //      }
    }

    /*
     * @see IBrowser#isCloseSupported()
     */
    public boolean isCloseSupported() {
        return false;
    }

    /*
     * @see IBrowser#isSetLocationSupported()
     */
    public boolean isSetLocationSupported() {
        return false;
    }

    /*
     * @see IBrowser#isSetSizeSupported()
     */
    public boolean isSetSizeSupported() {
        return false;
    }

    /*
     * @see IBrowser#setLocation(int, int)
     */
    public void setLocation(int x, int y) {
    }

    /*
     * @see IBrowser#setSize(int, int)
     */
    public void setSize(int width, int height) {
    }
}
			
			

Browsed Source: [clear]