Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 964bb5959c6266f3eba8293ffa92dbb83b8994d2 (plain) (blame)
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
/*******************************************************************************
 * Copyright (c) 2003, 2015 IBM Corporation and others.
 *
 * This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License 2.0
 * which accompanies this distribution, and is available at
 * https://www.eclipse.org/legal/epl-2.0/
 *
 * SPDX-License-Identifier: EPL-2.0
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.ui.help;

import java.net.URL;

import org.eclipse.help.IContext;

/**
 * Abstract base class for the help system UI.
 * <p>
 * The Eclipse platform provides an extension point (<code>"org.eclipse.ui.helpSupport"</code>)
 * for plugging in a help system UI. The help system UI is an optional
 * component; applications may provide a UI for presenting help to the user by
 * implementing a subclass and including the name of their class in the
 * <code>&lt;config&gt;</code> element in an extension to the
 * <code>"org.eclipse.ui.helpSupport"</code> extension point.
 * </p>
 * <p>
 * Note that the standard implementation of the help system UI is provided by
 * the <code>"org.eclipse.help.ui"</code> plug-in. Since the platform can only
 * make use of a single help system UI implementation, make sure that the
 * platform is not configured with more than one plug-in trying to extend this
 * extension point.
 * </p>
 *
 * @since 3.0
 */
public abstract class AbstractHelpUI {

	/**
	 * Displays the entire help bookshelf.
	 */
	public abstract void displayHelp();

	/**
	 * Displays the help search facility. For backward compatibility, the
	 * default implementation does nothing.
	 *
	 * @since 3.1
	 */
	public void displaySearch() {
		// do nothing
	}

	/**
	 * Displays the dynamic help for the active context. For backward
	 * compatibility, the default implementation does nothing.
	 *
	 * @since 3.1
	 */
	public void displayDynamicHelp() {
		// do nothing
	}

	/**
	 * Starts the help search using the help search facility. For backward
	 * compatibility, the default implementation does nothing.
	 *
	 * @param expression
	 *            the search expression
	 * @since 3.1
	 */
	public void search(String expression) {
		// do nothing
	}

	/**
	 * Resolves the help resource href according to the help system
	 * implementation.
	 *
	 * @param href
	 *            the help resource
	 * @param documentOnly
	 *            if <code>true</code>, the resulting URL must point at the
	 *            document referenced by href. Otherwise, it can be a URL that
	 *            contains additional elements like navigation that the help
	 *            system adds to the document.
	 * @return the fully resolved URL of the help resource or <code>null</code>
	 *         if not supported. Help systems that use application servers
	 *         typically return URLs with http: protocol. Simple help system
	 *         implementations can return URLs with file: protocol.
	 *
	 * @since 3.1
	 */
	public URL resolve(String href, boolean documentOnly) {
		return null;
	}

	/**
	 * Displays context-sensitive help for the given context.
	 * <p>
	 * (x,y) coordinates specify the location where the context sensitive help
	 * UI will be presented. These coordinates are screen-relative (ie: (0,0) is
	 * the top left-most screen corner). The platform is responsible for calling
	 * this method and supplying the appropriate location.
	 * </p>
	 *
	 * @param context
	 *            the context to display
	 * @param x
	 *            horizontal position
	 * @param y
	 *            verifical position
	 */
	public abstract void displayContext(IContext context, int x, int y);

	/**
	 * Displays help content for the help resource with the given URL.
	 * <p>
	 * This method is called by the platform to launch the help system UI,
	 * displaying the documentation identified by the <code>href</code>
	 * parameter.
	 * </p>
	 * <p>
	 * The help system makes no guarantee that all the help resources can be
	 * displayed or how they are displayed.
	 * </p>
	 *
	 * @param href
	 *            the URL of the help resource.
	 *            <p>
	 *            Valid href are as described in
	 *            {@link  org.eclipse.help.IHelpResource#getHref() IHelpResource.getHref()}
	 *            </p>
	 */
	public abstract void displayHelpResource(String href);

	/**
	 * Returns whether the context-sensitive help window is currently being
	 * displayed.
	 *
	 * @return <code>true</code> if the context-sensitive help window is
	 *         currently being displayed, <code>false</code> if not
	 */
	public abstract boolean isContextHelpDisplayed();
}

Back to the top