Mercurial > projects > dwt-addons
comparison dwtx/jface/viewers/SWTFocusCellManager.d @ 70:46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Thu, 22 May 2008 01:36:46 +0200 |
parents | b6c35faf97c8 |
children | 5df4896124c7 |
comparison
equal
deleted
inserted
replaced
69:07b9d96fd764 | 70:46a6e0e6ccd4 |
---|---|
1 /******************************************************************************* | 1 /******************************************************************************* |
2 * Copyright (c) 2007 IBM Corporation and others. | 2 * Copyright (c) 2007, 2008 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 |
6 * http://www.eclipse.org/legal/epl-v10.html | 6 * http://www.eclipse.org/legal/epl-v10.html |
7 * | 7 * |
8 * Contributors: | 8 * Contributors: |
9 * IBM Corporation - initial API and implementation | 9 * IBM Corporation - initial API and implementation |
10 * Tom Schindl <tom.schindl@bestsolution.at> - initial API and implementation | 10 * Tom Schindl <tom.schindl@bestsolution.at> - initial API and implementation |
11 * - bug fix for bug 187189 | 11 * - bug fix for bug 187189, 182800, 215069 |
12 * Port to the D programming language: | 12 * Port to the D programming language: |
13 * Frank Benoit <benoit@tionex.de> | 13 * Frank Benoit <benoit@tionex.de> |
14 ******************************************************************************/ | 14 *******************************************************************************/ |
15 | 15 |
16 module dwtx.jface.viewers.SWTFocusCellManager; | 16 module dwtx.jface.viewers.SWTFocusCellManager; |
17 | 17 |
18 import dwtx.jface.viewers.CellNavigationStrategy; | 18 import dwtx.jface.viewers.CellNavigationStrategy; |
19 import dwtx.jface.viewers.ColumnViewer; | 19 import dwtx.jface.viewers.ColumnViewer; |
50 | 50 |
51 private FocusCellHighlighter cellHighlighter; | 51 private FocusCellHighlighter cellHighlighter; |
52 | 52 |
53 private DisposeListener itemDeletionListener; | 53 private DisposeListener itemDeletionListener; |
54 | 54 |
55 | |
55 /** | 56 /** |
56 * @param viewer | 57 * @param viewer |
57 * @param focusDrawingDelegate | 58 * @param focusDrawingDelegate |
58 * @param navigationDelegate | 59 * @param navigationDelegate |
59 */ | 60 */ |
112 event.doit = false; | 113 event.doit = false; |
113 } | 114 } |
114 } | 115 } |
115 | 116 |
116 private void handleSelection(Event event) { | 117 private void handleSelection(Event event) { |
117 if (focusCell !is null && focusCell.getItem() !is event.item | 118 if ((event.detail & DWT.CHECK) is 0 && focusCell !is null && focusCell.getItem() !is event.item |
118 && event.item !is null) { | 119 && event.item !is null ) { |
119 ViewerRow row = viewer.getViewerRowFromItem_package(event.item); | 120 ViewerRow row = viewer.getViewerRowFromItem_package(event.item); |
120 Assert | 121 Assert |
121 .isNotNull(row, | 122 .isNotNull(row, |
122 "Internal Structure invalid. Row item has no row ViewerRow assigned"); //$NON-NLS-1$ | 123 "Internal Structure invalid. Row item has no row ViewerRow assigned"); //$NON-NLS-1$ |
123 ViewerCell tmp = row.getCell(focusCell.getColumnIndex()); | 124 ViewerCell tmp = row.getCell(focusCell.getColumnIndex()); |
178 public ViewerCell getFocusCell() { | 179 public ViewerCell getFocusCell() { |
179 return focusCell; | 180 return focusCell; |
180 } | 181 } |
181 | 182 |
182 void setFocusCell(ViewerCell focusCell) { | 183 void setFocusCell(ViewerCell focusCell) { |
184 ViewerCell oldCell = this.focusCell; | |
185 | |
183 if( this.focusCell !is null && ! this.focusCell.getItem().isDisposed() ) { | 186 if( this.focusCell !is null && ! this.focusCell.getItem().isDisposed() ) { |
184 this.focusCell.getItem().removeDisposeListener(itemDeletionListener); | 187 this.focusCell.getItem().removeDisposeListener(itemDeletionListener); |
185 } | 188 } |
186 | 189 |
187 this.focusCell = focusCell; | 190 this.focusCell = focusCell; |
188 | 191 |
189 if( this.focusCell !is null && ! this.focusCell.getItem().isDisposed() ) { | 192 if( this.focusCell !is null && ! this.focusCell.getItem().isDisposed() ) { |
190 this.focusCell.getItem().addDisposeListener(itemDeletionListener); | 193 this.focusCell.getItem().addDisposeListener(itemDeletionListener); |
191 } | 194 } |
192 | 195 |
193 this.cellHighlighter.focusCellChanged_package(focusCell); | 196 this.cellHighlighter.focusCellChanged/*_package*/(focusCell,oldCell); |
194 } | 197 } |
195 | 198 |
196 ColumnViewer getViewer() { | 199 ColumnViewer getViewer() { |
197 return viewer; | 200 return viewer; |
198 } | 201 } |