KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > ui > text > java > RelevanceSorter


1 /*******************************************************************************
2  * Copyright (c) 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jdt.internal.ui.text.java;
12
13 import java.util.Comparator JavaDoc;
14
15 import org.eclipse.jface.text.contentassist.ICompletionProposal;
16
17 import org.eclipse.jdt.ui.text.java.AbstractProposalSorter;
18 import org.eclipse.jdt.ui.text.java.CompletionProposalComparator;
19
20 /**
21  * A relevance based sorter.
22  *
23  * @since 3.2
24  */

25 public final class RelevanceSorter extends AbstractProposalSorter {
26
27     private final Comparator JavaDoc fComparator= new CompletionProposalComparator();
28
29     public RelevanceSorter() {
30     }
31     
32     /*
33      * @see org.eclipse.jdt.ui.text.java.AbstractProposalSorter#compare(org.eclipse.jface.text.contentassist.ICompletionProposal, org.eclipse.jface.text.contentassist.ICompletionProposal)
34      */

35     public int compare(ICompletionProposal p1, ICompletionProposal p2) {
36         return fComparator.compare(p1, p2);
37     }
38 }
39
Popular Tags