*/
public int compare( Viewer viewer, Object o1, Object o2 )
{
if ( o1 instanceof StudioRunnableWithProgress )
{
StudioRunnableWithProgress runnable = ( StudioRunnableWithProgress ) o1;
for ( Object lockedObject : runnable.getLockedObjects() )
{
if ( lockedObject instanceof ISearch )
{
ISearch search = ( ISearch ) lockedObject;
if ( o1 == search.getTopSearchRunnable() )
{
return lessThan();
}
else if ( o1 == search.getNextSearchRunnable() )
{
return greaterThan();
}
}
else if ( lockedObject instanceof IEntry )
{
IEntry entry = ( IEntry ) lockedObject;
if ( o1 == entry.getTopPageChildrenRunnable() )
{
return lessThan();
}
else if ( o1 == entry.getNextPageChildrenRunnable() )
{
return greaterThan();
}
}
}
return lessThan();
}
if ( o2 instanceof StudioRunnableWithProgress )
{
StudioRunnableWithProgress runnable = ( StudioRunnableWithProgress ) o2;
for ( Object lockedObject : runnable.getLockedObjects() )
{
if ( lockedObject instanceof ISearch )
{
ISearch search = ( ISearch ) lockedObject;
if ( o2 == search.getTopSearchRunnable() )