}
if (dragStart >= 0) {
dragOverIndex--;
return new StackDropResult(lastTabBounds, new Integer(
dragOverIndex));
}
// Make the drag-over rectangle look like a tab at the end of the tab region.
// We don't actually know how wide the tab will be when it's dropped, so just
// make it 3 times wider than it is tall.
Rectangle dropRectangle = titleArea;
dropRectangle.x = lastTabBounds.x + lastTabBounds.width;
dropRectangle.width = 3 * dropRectangle.height;
return new StackDropResult(dropRectangle, new Integer(
dragOverIndex));
} else {
// If the closest side is the side with the tabs, consider this a stack operation.
// Otherwise, let the drop fall through to whatever the default behavior is
Rectangle displayBounds = DragUtil.getDisplayBounds(tabFolder.getControl());
int closestSide = Geometry.getClosestSide(displayBounds, location);
if (closestSide == tabFolder.getTabPosition()) {
return new StackDropResult(displayBounds, null);
}
return null;
}
}
if (!tabUnderPointer.isShowing()) {
return null;
}
Rectangle tabBounds = tabUnderPointer.getBounds();
if (tabBounds.isEmpty()) {
return null;
}
return new StackDropResult(tabBounds, new DragCookie(tabFolder
.indexOf(tabUnderPointer)));
}