g-Eclipse
Release 1.0.0

eu.geclipse.ui.providers
Class GridModelComparator

java.lang.Object
  extended by eu.geclipse.ui.providers.GridModelComparator
All Implemented Interfaces:
java.io.Serializable, java.util.Comparator<java.lang.Object>

public class GridModelComparator
extends java.lang.Object
implements java.util.Comparator<java.lang.Object>, java.io.Serializable

Comparator implementation for sorting elements within the Grid model.

See Also:
Serialized Form

Constructor Summary
GridModelComparator()
           
 
Method Summary
 int compare(IGridElement e1, IGridElement e2)
          Compare the specified elements.
 int compare(java.lang.Object o1, java.lang.Object o2)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

GridModelComparator

public GridModelComparator()
Method Detail

compare

public int compare(java.lang.Object o1,
                   java.lang.Object o2)
Specified by:
compare in interface java.util.Comparator<java.lang.Object>

compare

public int compare(IGridElement e1,
                   IGridElement e2)
Compare the specified elements.

Parameters:
e1 - The first element.
e2 - The second element.
Returns:
The return value is calculated in order to prefer folders before files. If both elements are either folders or files the names of the elements are compared.

g-Eclipse
Release 1.0.0