|
Lines 1-5
Link Here
|
| 1 |
/******************************************************************************* |
1 |
/******************************************************************************* |
| 2 |
* Copyright (c) 2007, 2008 IBM Corporation and others. |
2 |
* Copyright (c) 2007, 2012 IBM Corporation and others. |
| 3 |
* All rights reserved. This program and the accompanying materials |
3 |
* All rights reserved. This program and the accompanying materials |
| 4 |
* are made available under the terms of the Eclipse Public License v1.0 |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
| 5 |
* which accompanies this distribution, and is available at |
5 |
* which accompanies this distribution, and is available at |
|
Lines 83-98
Link Here
|
| 83 |
} |
83 |
} |
| 84 |
} |
84 |
} |
| 85 |
|
85 |
|
| 86 |
private void removeSelectionInformation(Event event, ViewerCell cell) { |
|
|
| 87 |
GC gc = event.gc; |
| 88 |
gc.setBackground(cell.getViewerRow().getBackground( |
| 89 |
cell.getColumnIndex())); |
| 90 |
gc.setForeground(cell.getViewerRow().getForeground( |
| 91 |
cell.getColumnIndex())); |
| 92 |
gc.fillRectangle(cell.getBounds()); |
| 93 |
event.detail &= ~SWT.SELECTED; |
| 94 |
} |
| 95 |
|
| 96 |
private void hookListener(final ColumnViewer viewer) { |
86 |
private void hookListener(final ColumnViewer viewer) { |
| 97 |
|
87 |
|
| 98 |
Listener listener = new Listener() { |
88 |
Listener listener = new Listener() { |
|
Lines 108-118
Link Here
|
| 108 |
|
98 |
|
| 109 |
ViewerCell cell = row.getCell(event.index); |
99 |
ViewerCell cell = row.getCell(event.index); |
| 110 |
|
100 |
|
| 111 |
if (focusCell == null || !cell.equals(focusCell)) { |
101 |
if (focusCell != null && cell.equals(focusCell)) { |
| 112 |
removeSelectionInformation(event, cell); |
102 |
markFocusedCell(event, cell); |
| 113 |
} else { |
103 |
} |
| 114 |
markFocusedCell(event, cell); |
|
|
| 115 |
} |
| 116 |
} |
104 |
} |
| 117 |
} |
105 |
} |
| 118 |
|
106 |
|
|
Lines 129-135
Link Here
|
| 129 |
* @return the color or <code>null</code> to use the default |
117 |
* @return the color or <code>null</code> to use the default |
| 130 |
*/ |
118 |
*/ |
| 131 |
protected Color getSelectedCellBackgroundColor(ViewerCell cell) { |
119 |
protected Color getSelectedCellBackgroundColor(ViewerCell cell) { |
| 132 |
return null; |
120 |
return cell.getItem().getDisplay().getSystemColor(SWT.COLOR_LIST_SELECTION); |
| 133 |
} |
121 |
} |
| 134 |
|
122 |
|
| 135 |
/** |
123 |
/** |