Example usage for org.eclipse.jface.viewers ViewerRow getBounds

List of usage examples for org.eclipse.jface.viewers ViewerRow getBounds

Introduction

In this page you can find the example usage for org.eclipse.jface.viewers ViewerRow getBounds.

Prototype

public abstract Rectangle getBounds(int columnIndex);

Source Link

Document

Get the bounds of the entry at the columnIndex,

Usage

From source file:com.netxforge.screens.editing.base.tables.TreeViewerFocusBlockManager.java

License:Open Source License

ViewerCell getInitialFocusCell() {
    Tree tree = (Tree) getViewer().getControl();

    if (!tree.isDisposed() && tree.getItemCount() > 0 && !tree.getTopItem().isDisposed()) {

        OpenTreeViewer v = (OpenTreeViewer) getViewer();
        ViewerRow aViewerRow = v.getViewerRowFromItemExposed(tree.getTopItem());
        if (tree.getColumnCount() == 0) {
            return aViewerRow.getCell(0);
        }/*from  www .  j  av  a  2  s . c o  m*/

        Rectangle clientArea = tree.getClientArea();
        for (int i = 0; i < tree.getColumnCount(); i++) {
            // CB, getWidth() is not available through the API.
            int width = aViewerRow.getBounds(i).width;
            if (width > 0 && columnInVisibleArea(clientArea, aViewerRow, i))
                return aViewerRow.getCell(i);
        }
    }

    return null;
}

From source file:com.netxforge.screens.editing.base.tables.TreeViewerFocusBlockManager.java

License:Open Source License

private boolean columnInVisibleArea(Rectangle clientArea, ViewerRow row, int colIndex) {
    return row.getBounds(colIndex).x >= clientArea.x;
}