TableItem showItem = null; int itemIndex = table.indexOf(item); if (coordinates.y - area.y < SCROLL_WIDTH) { showItem = table.getItem(Math.max(0, itemIndex - 1)); } else if ((area.y + area.height - coordinates.y) < SCROLL_WIDTH) { showItem = table.getItem(Math.min(table.getItemCount() - 1, itemIndex + 1));
int top = table.getTopIndex(); int newTop = -1;  int scroll_width = 2*table.getItemHeight(); if (coordinates.y < area.y + scroll_width) { newTop = Math.max(0, top - 1); } else if (coordinates.y > area.y + area.height - scroll_width) { newTop = Math.min(table.getItemCount() - 1, top + 1);
private void scroll(TableItem item, int x, int y) {	if (item == null) return;	Point coordinates = new Point(x, y);	coordinates = table.toControl(coordinates);	Rectangle area = table.getClientArea();	TableItem showItem = null;	int itemIndex = table.indexOf(item);	if (coordinates.y - area.y < SCROLL_WIDTH) {		showItem = table.getItem(Math.max(0, itemIndex - 1));	} else if ((area.y + area.height - coordinates.y) < SCROLL_WIDTH) {		showItem = table.getItem(Math.min(table.getItemCount() - 1, itemIndex + 1));	}	if (showItem != null) {		table.showItem(showItem);	}	}