01: /*******************************************************************************
02: * Copyright (c) 2000, 2005 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.jface.text.contentassist;
11:
12: import org.eclipse.swt.graphics.Image;
13:
14: /**
15: * The interface of context information presented to the user and
16: * generated by content assist processors.
17: * <p>
18: * In order to provide backward compatibility for clients of
19: * <code>IContextInformation</code>, extension interfaces are used to
20: * provide a means of evolution. The following extension interfaces
21: * exist:
22: * <ul>
23: * <li>{@link org.eclipse.jface.text.contentassist.IContextInformationExtension}
24: * since version 2.0 introducing the ability to freely position the
25: * context information.</li>
26: * </ul>
27: * </p>
28: * <p>
29: * The interface can be implemented by clients. By default, clients use
30: * {@link org.eclipse.jface.text.contentassist.ContextInformation} as
31: * the standard implementer of this interface.
32: * </p>
33: *
34: * @see IContentAssistProcessor
35: */
36: public interface IContextInformation {
37:
38: /**
39: * Returns the string to be displayed in the list of contexts.
40: * This method is used to supply a unique presentation for
41: * situations where the context is ambiguous. These strings are
42: * used to allow the user to select the specific context.
43: *
44: * @return the string to be displayed for the context
45: */
46: String getContextDisplayString();
47:
48: /**
49: * Returns the image for this context information.
50: * The image will be shown to the left of the display string.
51: *
52: * @return the image to be shown or <code>null</code> if no image is desired
53: */
54: Image getImage();
55:
56: /**
57: * Returns the string to be displayed in the tool tip like information popup.
58: *
59: * @return the string to be displayed
60: */
61: String getInformationDisplayString();
62:
63: /**
64: * Compares the given object with this receiver. Two context informations are
65: * equal if there information display strings and their context display strings
66: * are equal.
67: *
68: * @see Object#equals(Object)
69: */
70: boolean equals(Object object);
71: }
|