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

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

Introduction

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

Prototype

public abstract int getColumnCount();

Source Link

Document

Return the number of columns for the receiver.

Usage

From source file:com.gorillalogic.monkeyconsole.tableview.MonkeyTalkTabularEditor.java

License:Open Source License

private static ViewerCell getNeighbor(ViewerCell currentCell, int directionMask, boolean sameLevel) {
    ViewerRow row;

    if ((directionMask & ViewerCell.ABOVE) == ViewerCell.ABOVE) {
        row = currentCell.getViewerRow().getNeighbor(ViewerRow.ABOVE, sameLevel);
    } else if ((directionMask & ViewerCell.BELOW) == ViewerCell.BELOW) {
        row = currentCell.getViewerRow().getNeighbor(ViewerRow.BELOW, sameLevel);
    } else {//from  ww w  .  jav  a  2s .c o m
        row = currentCell.getViewerRow();
    }

    if (row != null) {
        int columnIndex;
        columnIndex = getVisualIndex(row, currentCell.getColumnIndex());

        int modifier = 0;

        if ((directionMask & ViewerCell.LEFT) == ViewerCell.LEFT) {
            modifier = -1;
        } else if ((directionMask & ViewerCell.RIGHT) == ViewerCell.RIGHT) {
            modifier = 1;
        }

        columnIndex += modifier;

        if (columnIndex >= 0 && columnIndex < row.getColumnCount()) {
            ViewerCell cell = getCellAtVisualIndex(row, columnIndex);
            if (cell != null) {
                while (cell != null && columnIndex < row.getColumnCount() - 1 && columnIndex > 0) {
                    if (isVisible(cell)) {
                        break;
                    }

                    columnIndex += modifier;
                    cell = getCellAtVisualIndex(row, columnIndex);
                    if (cell == null) {
                        break;
                    }
                }
            }

            return cell;
        }
    }
    return null;
}

From source file:org.eclipse.babel.tapiji.tools.core.ui.widgets.provider.ResKeyTreeLabelProvider.java

License:Open Source License

public void updateTreeViewer(TreeViewer treeViewer) {

    for (TreeItem item : treeViewer.getTree().getItems()) {
        Rectangle bounds = item.getBounds();
        ViewerCell cell = treeViewer.getCell(new Point(bounds.x, bounds.y));
        ViewerRow viewerRow = cell.getViewerRow();

        for (int i = 0; i < viewerRow.getColumnCount(); i++) {
            updateCell(viewerRow.getCell(i));
        }//from  ww w . j av  a2s. co m
    }
}