Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 351814
Collapse All | Expand All

(-)src/org/eclipse/jface/viewers/FocusCellOwnerDrawHighlighter.java (-18 / +16 lines)
Lines 100-125 Link Here
100
//		GC gc = event.gc;
100
//		GC gc = event.gc;
101
//		gc.setBackground(cell.getViewerRow().getBackground(
101
//		gc.setBackground(cell.getViewerRow().getBackground(
102
//				cell.getColumnIndex()));
102
//				cell.getColumnIndex()));
103
	  Color tableBackground = cell.getControl().getBackground();
104
	  Color cellBackground
105
	    = cell.getViewerRow().getBackground( cell.getColumnIndex() );
106
	  if( !cellBackground.equals( tableBackground ) ) {
107
	    cell.setBackground( cellBackground );
108
	  } else {
109
	    cell.setBackground( null );
110
	  }
111
//		gc.setForeground(cell.getViewerRow().getForeground(
103
//		gc.setForeground(cell.getViewerRow().getForeground(
112
//				cell.getColumnIndex()));
104
//				cell.getColumnIndex()));
113
	  Color tableForeground = cell.getControl().getForeground();
114
	  Color cellForeground
115
	    = cell.getViewerRow().getForeground( cell.getColumnIndex() );
116
	  if( !cellForeground.equals( tableForeground ) ) {
117
	    cell.setForeground( cellForeground );
118
	  } else {
119
	    cell.setForeground( null );
120
	  }
121
//		gc.fillRectangle(cell.getBounds());
105
//		gc.fillRectangle(cell.getBounds());
122
//		event.detail &= ~SWT.SELECTED;
106
//		event.detail &= ~SWT.SELECTED;
107
	  Color cellBackground = null;
108
	  Color cellForeground = null;
109
	  CellLabelProvider labelProvider = viewer.getLabelProvider( cell.getColumnIndex() );
110
	  if( labelProvider instanceof ColumnLabelProvider ) {
111
	    ColumnLabelProvider columnLabelProvider = ( ColumnLabelProvider )labelProvider;
112
        cellBackground = columnLabelProvider.getBackground( cell.getElement() );
113
        cellForeground = columnLabelProvider.getForeground( cell.getElement() );
114
	  }
115
	  cell.setBackground( cellBackground );
116
	  cell.setForeground( cellForeground );
123
	}
117
	}
124
118
125
    private void hookListener(final ColumnViewer viewer) {
119
    private void hookListener(final ColumnViewer viewer) {
Lines 306-313 Link Here
306
//					true);
300
//					true);
307
//		}
301
//		}
308
        if( oldCell != null ) {
302
        if( oldCell != null ) {
309
          oldCell.setBackground( null );
303
          if(    newCell == null
310
          oldCell.setForeground( null );
304
              || !isItemSelected( oldCell.getItem() )
305
              || newCell.getColumnIndex() != oldCell.getColumnIndex() )
306
          {
307
            removeSelectionInformation( null, oldCell );
308
          }
311
// [if] Fix for bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=264226
309
// [if] Fix for bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=264226
312
// When selected item is deleted, the oldCell item and element are out of sync
310
// When selected item is deleted, the oldCell item and element are out of sync
313
//          viewer.updateItem( oldCell.getItem(), oldCell.getElement() );
311
//          viewer.updateItem( oldCell.getItem(), oldCell.getElement() );

Return to bug 351814