Skip to main content
summaryrefslogtreecommitdiffstats
blob: 4ca0794ec1a16efcbad29bc85a6670af9dae280e (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
/**
 * Copyright (c) 2012 Darmstadt University of Technology 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:
 *     Marcel Bruch, bruch@cs.tu-darmstadt.de - [content assist] Allow to re-sort proposals - https://bugs.eclipse.org/bugs/show_bug.cgi?id=350991
 */
package org.eclipse.jface.text.contentassist;


/**
 * An <code>ICompletionProposalSorter</code> provides support for sorting proposals of a content
 * assistant.
 * <p>
 * Implementors of this interface have to register this sorter with the content assist whenever
 * needed. See {@link ContentAssistant#setSorter(ICompletionProposalSorter)} for more information on
 * how to register a proposal sorter.
 * </p>
 *
 * @since 3.8
 */
public interface ICompletionProposalSorter {

	/**
	 * The orderings imposed by an implementation need not be consistent with equals.
	 *
	 * @param p1 the first proposal to be compared
	 * @param p2 the second proposal to be compared
	 * @return a negative integer, zero, or a positive integer as the first argument is less than,
	 *         equal to, or greater than the second
	 * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
	 */
	public int compare(ICompletionProposal p1, ICompletionProposal p2);

}

Back to the top