Initialize
[sdk/ide/product.git] / org.eclipse.jst.pagedesigner / src / org / eclipse / jst / pagedesigner / tableedit / TableSideItemDragTracker.java
1 /*******************************************************************************\r
2  * Copyright (c) 2006 Sybase, Inc. and others.\r
3  *\r
4  * All rights reserved. This program and the accompanying materials\r
5  * are made available under the terms of the Eclipse Public License v1.0\r
6  * which accompanies this distribution, and is available at\r
7  * http://www.eclipse.org/legal/epl-v10.html\r
8  *\r
9  * Contributors:\r
10  *     Sybase, Inc. - initial API and implementation\r
11  *******************************************************************************/\r
12 package org.eclipse.jst.pagedesigner.tableedit;\r
13 \r
14 import org.eclipse.gef.EditPart;\r
15 import org.eclipse.gef.tools.DragEditPartsTracker;\r
16 \r
17 /**\r
18  * This is the tracker for the TableSideItem. It will be responsible to track\r
19  * the right mouse down event and popup a menu.\r
20  * \r
21  * @author mengbo\r
22  * @version 1.5\r
23  */\r
24 public class TableSideItemDragTracker extends DragEditPartsTracker {\r
25     // TODO: dead?\r
26     //  private boolean _isRow;\r
27 //\r
28 //      private int _index;\r
29 \r
30         /**\r
31          * \r
32          * @param sourceEditPart\r
33          * @param isrow\r
34          * @param index\r
35          */\r
36         public TableSideItemDragTracker(EditPart sourceEditPart, boolean isrow,\r
37                         int index) {\r
38                 super(sourceEditPart);\r
39         // TODO: dead?\r
40 //              this._isRow = isrow;\r
41 //              this._index = index;\r
42         }\r
43 \r
44         /*\r
45          * (non-Javadoc)\r
46          * \r
47          * @see org.eclipse.gef.tools.DragEditPartsTracker#handleButtonUp(int)\r
48          */\r
49         protected boolean handleButtonUp(int button) {\r
50                 boolean result = super.handleButtonUp(button);\r
51                 //\r
52                 // if (button == 3)\r
53                 // {\r
54                 // MenuManager m = new MenuManager();\r
55                 // if (_isRow)\r
56                 // {\r
57                 // m.add(new InsertRowColumnAction("Insert row before",\r
58                 // getSourceEditPart(), _index, _isRow, true));\r
59                 // m.add(new InsertRowColumnAction("Insert row after",\r
60                 // getSourceEditPart(), _index, _isRow, false));\r
61                 // m.add(new DeleteRowColumnAction("Delete row", getSourceEditPart(),\r
62                 // _index, _isRow));\r
63                 // }\r
64                 // else\r
65                 // {\r
66                 // m.add(new InsertRowColumnAction("Insert column before",\r
67                 // getSourceEditPart(), _index, _isRow, true));\r
68                 // m.add(new InsertRowColumnAction("Insert column after",\r
69                 // getSourceEditPart(), _index, _isRow, false));\r
70                 // m.add(new DeleteRowColumnAction("Delete column", getSourceEditPart(),\r
71                 // _index, _isRow));\r
72                 // }\r
73                 // m.createContextMenu(this.getCurrentViewer().getControl()).setVisible(true);\r
74                 // }\r
75                 return result;\r
76         }\r
77 }\r