blob: 4cc30329070213c94d9eebc8e99717ac1e277727 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
/*******************************************************************************
* Copyright (c) 2011 Formal Mind GmbH and University of Dusseldorf.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Michael Jastram - initial API and implementation
******************************************************************************/
package org.eclipse.rmf.pror.reqif10.editor.agilegrid;
import org.agilemore.agilegrid.AgileGrid;
import org.agilemore.agilegrid.Cell;
import org.eclipse.swt.widgets.Composite;
/**
* We override the default implementation to slightly change the behavior when
* opening the context menu.
*
* @author jastram
*
*/
public class ProrAgileGrid extends AgileGrid {
protected Cell dndHoverCell;
public ProrAgileGrid(Composite parent, int style) {
super(parent, style);
// By default, the selection doesn't change if we right-click an
// unselected cell. But that's what we want.
// TODO This doesn't work, and therefore enableing this code is deceiving.
// addMenuDetectListener(new MenuDetectListener() {
//
// @Override
// public void menuDetected(MenuDetectEvent e) {
// Point pos = toControl(e.x, e.y);
// Cell clickedCell = getCell(pos.x, pos.y);
// if (!isCellSelected(clickedCell.row, clickedCell.column)) {
// selectCells(new Cell[] { clickedCell });
// }
// }
// });
}
}
|