Lines 19-24
Link Here
|
19 |
import org.eclipse.swt.graphics.Color; |
19 |
import org.eclipse.swt.graphics.Color; |
20 |
import org.eclipse.swt.graphics.Font; |
20 |
import org.eclipse.swt.graphics.Font; |
21 |
import org.eclipse.swt.graphics.Image; |
21 |
import org.eclipse.swt.graphics.Image; |
|
|
22 |
import org.eclipse.swt.graphics.Point; |
22 |
import org.eclipse.swt.graphics.Rectangle; |
23 |
import org.eclipse.swt.graphics.Rectangle; |
23 |
import org.eclipse.swt.widgets.Control; |
24 |
import org.eclipse.swt.widgets.Control; |
24 |
import org.eclipse.swt.widgets.Tree; |
25 |
import org.eclipse.swt.widgets.Tree; |
Lines 395-403
Link Here
|
395 |
} |
396 |
} |
396 |
|
397 |
|
397 |
protected boolean scrollCellIntoView(int columnIndex) { |
398 |
protected boolean scrollCellIntoView(int columnIndex) { |
398 |
item.getParent().showItem(item); |
399 |
Tree tree = item.getParent(); |
399 |
if( hasColumns() ) { |
400 |
Rectangle itemBnds = getBounds(); |
400 |
item.getParent().showColumn(item.getParent().getColumn(columnIndex)); |
401 |
Rectangle clientArea = tree.getClientArea(); |
|
|
402 |
boolean reDrwTogl = false; |
403 |
try { |
404 |
boolean updRow = !(clientArea.contains(new Point(clientArea.x |
405 |
+ clientArea.width / 2/* since we check only y for rows */ |
406 |
, itemBnds.y + itemBnds.height))); |
407 |
if (updRow) { // only if showItem required |
408 |
reDrwTogl = true; |
409 |
tree.setRedraw(false); |
410 |
tree.showItem(item); |
411 |
} |
412 |
itemBnds = getBounds(columnIndex); |
413 |
boolean updColumn = !(clientArea.contains(new Point( |
414 |
/* SWT sets scroll to similar value. Check only x for column */ |
415 |
itemBnds.x + itemBnds.width, itemBnds.y))); |
416 |
if (hasColumns() && updColumn) { // only if showColumn required |
417 |
if (!reDrwTogl) { |
418 |
reDrwTogl = true; |
419 |
tree.setRedraw(false); |
420 |
} |
421 |
tree.showColumn(tree.getColumn(columnIndex)); |
422 |
} |
423 |
} finally { |
424 |
if (reDrwTogl) |
425 |
tree.setRedraw(true); |
401 |
} |
426 |
} |
402 |
return true; |
427 |
return true; |
403 |
} |
428 |
} |