Bug 215069 [Viewers] Problems with FocusCellOwnerDrawHighlighter
I have been experimenting with using TreeViewerEditor and related facilities, such as FocusCellOwnerDrawHighlighter. Have noticed a few problems with the current implementation: 1. At least on Windows, the background color for the selection in the tree should alter depending on whether or not the overall tree widget has focus or not. FocusCellOwnerDrawHighlighter does not implement this feedback. 2. If you don't set SWT.FULL_SELECTION when creating the tree, the selection doesn't get painted on any column besides the first one. If this is expected behavior, this should at least be in javadoc. 3. Regardless of whether or not SWT.FULL_SELECTION is used, the selection extent in the first column is not restricted to the text (as it typical on Windows for trees). It goes all the way to the left margin of the tree widget and covers tree controls, icon and the checkbox. This doesn't look particularly good. Following native behavior here would be desirable. The FocusCellOwnerDrawHighlighter also needs javadoc since it's public API.
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/TableViewerRow.java
}
	public Object clone() {
		return new TableViewerRow(item);
	}
	public Object getElement() {
		return item.getData();
	}
	public int getVisualIndex(int creationIndex) {
		int[] order = item.getParent().getColumnOrder();
		for (int i = 0; i < order.length; i++) {
			if (order[i] == creationIndex) {
				return i;
			}
		}
		return super.getVisualIndex(creationIndex);
	}
	public int getCreationIndex(int visualIndex) {
		if( item != null && ! item.isDisposed() && hasColumns() && isValidOrderIndex(visualIndex) ) {
			return item.getParent().getColumnOrder()[visualIndex];
		}
		return super.getCreationIndex(visualIndex);
	}
	private boolean hasColumns() {
		return this.item.getParent().getColumnCount() != 0;
	}
	private boolean isValidOrderIndex(int currentIndex) {
		return currentIndex < this.item.getParent().getColumnOrder().length;
	}
}