Package org.eclipse.wst.sse.ui.internal.util

Examples of org.eclipse.wst.sse.ui.internal.util.Sorter


  protected IExtension[] orderExtensions(IExtension[] extensions) {
    // By default, the order is based on plugin id sorted
    // in ascending order. The order for a plugin providing
    // more than one extension for an extension point is
    // dependent in the order listed in the XML file.
    Sorter sorter = new Sorter() {
      public boolean compare(Object extension1, Object extension2) {
        String s1 = ((IExtension) extension1).getNamespace().toUpperCase();
        String s2 = ((IExtension) extension2).getNamespace().toUpperCase();
        //Return true if elementTwo is 'greater than' elementOne
        return s2.compareTo(s1) > 0;
      }
    };

    Object[] sorted = sorter.sort(extensions);
    IExtension[] sortedExtension = new IExtension[sorted.length];
    System.arraycopy(sorted, 0, sortedExtension, 0, sorted.length);
    return sortedExtension;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.wst.sse.ui.internal.util.Sorter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.