Lines 18-23
Link Here
|
18 |
|
18 |
|
19 |
package org.apache.jmeter.gui.tree; |
19 |
package org.apache.jmeter.gui.tree; |
20 |
|
20 |
|
|
|
21 |
import java.awt.Component; |
22 |
import java.awt.Rectangle; |
21 |
import java.awt.event.ActionEvent; |
23 |
import java.awt.event.ActionEvent; |
22 |
import java.awt.event.ActionListener; |
24 |
import java.awt.event.ActionListener; |
23 |
import java.awt.event.InputEvent; |
25 |
import java.awt.event.InputEvent; |
Lines 30-35
Link Here
|
30 |
import javax.swing.JTree; |
32 |
import javax.swing.JTree; |
31 |
import javax.swing.event.TreeSelectionEvent; |
33 |
import javax.swing.event.TreeSelectionEvent; |
32 |
import javax.swing.event.TreeSelectionListener; |
34 |
import javax.swing.event.TreeSelectionListener; |
|
|
35 |
import javax.swing.tree.TreeNode; |
33 |
import javax.swing.tree.TreePath; |
36 |
import javax.swing.tree.TreePath; |
34 |
|
37 |
|
35 |
import org.apache.jmeter.gui.GuiPackage; |
38 |
import org.apache.jmeter.gui.GuiPackage; |
Lines 210-216
Link Here
|
210 |
actionName = ActionNames.COLLAPSE; |
213 |
actionName = ActionNames.COLLAPSE; |
211 |
} else if (KeyStrokes.matches(e, KeyStrokes.SHIFT_RIGHT_ARROW)) { |
214 |
} else if (KeyStrokes.matches(e, KeyStrokes.SHIFT_RIGHT_ARROW)) { |
212 |
actionName = ActionNames.EXPAND; |
215 |
actionName = ActionNames.EXPAND; |
213 |
} |
216 |
} else if (KeyStrokes.matches(e, KeyStrokes.CONTEXT_MENU) || |
|
|
217 |
KeyStrokes.matches(e, KeyStrokes.SHIFT_F10)) { |
218 |
displayPopUp(e); |
219 |
} |
214 |
|
220 |
|
215 |
if (actionName != null) { |
221 |
if (actionName != null) { |
216 |
final ActionRouter actionRouter = ActionRouter.getInstance(); |
222 |
final ActionRouter actionRouter = ActionRouter.getInstance(); |
Lines 231-236
Link Here
|
231 |
return e.isPopupTrigger() || (InputEvent.BUTTON2_MASK & e.getModifiers()) > 0 || (InputEvent.BUTTON3_MASK == e.getModifiers()); |
237 |
return e.isPopupTrigger() || (InputEvent.BUTTON2_MASK & e.getModifiers()) > 0 || (InputEvent.BUTTON3_MASK == e.getModifiers()); |
232 |
} |
238 |
} |
233 |
|
239 |
|
|
|
240 |
private void displayPopUp(KeyEvent e) { |
241 |
JMeterTreeNode currentNode = getCurrentNode(); |
242 |
JPopupMenu pop = currentNode.createPopupMenu(); |
243 |
|
244 |
TreeNode[] path = currentNode.getPath(); |
245 |
Rectangle rectangle = tree.getPathBounds(new TreePath(path)); |
246 |
GuiPackage.getInstance().displayPopUp((Component) e.getSource(), |
247 |
rectangle.x + rectangle.width / 2, |
248 |
rectangle.y + rectangle.height / 2, pop); |
249 |
} |
250 |
|
234 |
private void displayPopUp(MouseEvent e) { |
251 |
private void displayPopUp(MouseEvent e) { |
235 |
JPopupMenu pop = getCurrentNode().createPopupMenu(); |
252 |
JPopupMenu pop = getCurrentNode().createPopupMenu(); |
236 |
GuiPackage.getInstance().displayPopUp(e, pop); |
253 |
GuiPackage.getInstance().displayPopUp(e, pop); |