Skip to main content
summaryrefslogtreecommitdiffstats
blob: c3d068e0ded6f920bdfef5cfd039c258c7a5cfa6 (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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/*******************************************************************************
 * Copyright (c) 2006 Sybase, Inc. and others.
 *
 * 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:
 *     Sybase, Inc. - initial API and implementation
 *******************************************************************************/
package org.eclipse.jst.pagedesigner.tableedit;

import org.eclipse.gef.EditPart;
import org.eclipse.gef.tools.DragEditPartsTracker;

/**
 * This is the tracker for the TableSideItem. It will be responsible to track
 * the right mouse down event and popup a menu.
 * 
 * @author mengbo
 * @version 1.5
 */
public class TableSideItemDragTracker extends DragEditPartsTracker {
	private boolean _isRow;

	private int _index;

	/**
	 * 
	 * @param sourceEditPart
	 * @param isrow
	 * @param index
	 */
	public TableSideItemDragTracker(EditPart sourceEditPart, boolean isrow,
			int index) {
		super(sourceEditPart);
		this._isRow = isrow;
		this._index = index;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.eclipse.gef.tools.DragEditPartsTracker#handleButtonUp(int)
	 */
	protected boolean handleButtonUp(int button) {
		boolean result = super.handleButtonUp(button);
		//
		// if (button == 3)
		// {
		// MenuManager m = new MenuManager();
		// if (_isRow)
		// {
		// m.add(new InsertRowColumnAction("Insert row before",
		// getSourceEditPart(), _index, _isRow, true));
		// m.add(new InsertRowColumnAction("Insert row after",
		// getSourceEditPart(), _index, _isRow, false));
		// m.add(new DeleteRowColumnAction("Delete row", getSourceEditPart(),
		// _index, _isRow));
		// }
		// else
		// {
		// m.add(new InsertRowColumnAction("Insert column before",
		// getSourceEditPart(), _index, _isRow, true));
		// m.add(new InsertRowColumnAction("Insert column after",
		// getSourceEditPart(), _index, _isRow, false));
		// m.add(new DeleteRowColumnAction("Delete column", getSourceEditPart(),
		// _index, _isRow));
		// }
		// m.createContextMenu(this.getCurrentViewer().getControl()).setVisible(true);
		// }
		return result;
	}
}

Back to the top