Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 68d86f928d65ce5c50d72d70658891a8055cffd2 (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
/*******************************************************************************
 * Copyright (c) 2000, 2008 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.jface.text.contentassist;

import org.eclipse.swt.graphics.Image;


/**
 * The interface of context information presented to the user and
 * generated by content assist processors.
 * <p>
 * In order to provide backward compatibility for clients of
 * <code>IContextInformation</code>, extension interfaces are used to
 * provide a means of evolution. The following extension interfaces
 * exist:
 * <ul>
 * <li>{@link org.eclipse.jface.text.contentassist.IContextInformationExtension}
 * since version 2.0 introducing the ability to freely position the
 * context information.</li>
 * </ul>
 * </p>
 * <p>
 * The interface can be implemented by clients. By default, clients use
 * {@link org.eclipse.jface.text.contentassist.ContextInformation} as
 * the standard implementer of this interface.
 * </p>
 *
 * @see IContentAssistProcessor
 */
public interface IContextInformation {

	/**
	 * Returns the string to be displayed in the list of contexts.
	 * This method is used to supply a unique presentation for
	 * situations where the context is ambiguous. These strings are
	 * used to allow the user to select the specific context.
	 *
	 * @return the string to be displayed for the context
	 */
	String getContextDisplayString();

	/**
	 * Returns the image for this context information.
	 * The image will be shown to the left of the display string.
	 *
	 * @return the image to be shown or <code>null</code> if no image is desired
	 */
	Image getImage();

	/**
	 * Returns the string to be displayed in the tool tip like information popup.
	 *
	 * @return the string to be displayed
	 */
	String getInformationDisplayString();

	/**
	 * Compares the given object with this receiver. Two context informations are equal if there
	 * information display strings and their context display strings are equal.
	 * <p>
	 * <strong>Note:</strong> As specified in {@link Object#equals(Object)} clients will most likely
	 * also have to implement {@link Object#hashCode()}.
	 * </p>
	 *
	 * @see Object#equals(Object)
	 */
	@Override
	boolean equals(Object object);
}


Back to the top