Class CompletionProposalComparator

java.lang.Object
org.eclipse.jdt.ui.text.java.CompletionProposalComparator
All Implemented Interfaces:
Comparator<org.eclipse.jface.text.contentassist.ICompletionProposal>

public final class CompletionProposalComparator extends Object implements Comparator<org.eclipse.jface.text.contentassist.ICompletionProposal>
Comparator for java completion proposals. Completion proposals can be sorted by relevance or alphabetically.

Note: this comparator imposes orderings that are inconsistent with equals.

Since:
3.1
  • Constructor Details

    • CompletionProposalComparator

      public CompletionProposalComparator()
      Creates a comparator that sorts by relevance.
  • Method Details

    • setOrderAlphabetically

      public void setOrderAlphabetically(boolean orderAlphabetically)
      Sets the sort order. Default is false, i.e. order by relevance.
      Parameters:
      orderAlphabetically - true to order alphabetically, false to order by relevance
    • compare

      public int compare(org.eclipse.jface.text.contentassist.ICompletionProposal p1, org.eclipse.jface.text.contentassist.ICompletionProposal p2)
      Specified by:
      compare in interface Comparator<org.eclipse.jface.text.contentassist.ICompletionProposal>
      Since:
      3.7