/**
* Set the listener for JMeter's test tree.
*
* @param newTreeListener
* the new JMeter test tree listener
*/
public void setTreeListener( [[#variabledfba660]] newTreeListener) {
treeListener = newTreeListener;
}
/**
* Get the listener for JMeter's test tree.
*
* @return the JMeter test tree listener
*/
public [[#variabledfba660]] getTreeListener() {
return treeListener;
}
/**
* Display the specified popup menu with the source component and location
* from the specified mouse event.
*
* @param e
* the mouse event causing this popup to be displayed
* @param popup
* the popup menu to display
*/
public void displayPopUp(MouseEvent e, JPopupMenu popup) {
displayPopUp((Component) e.getSource(), e, popup);
}
/**
* Display the specified popup menu at the location specified by a mouse
* event with the specified source component.
*
* @param invoker
* the source component
* @param e
* the mouse event causing this popup to be displayed
* @param popup
* the popup menu to display
*/
public void displayPopUp(Component invoker, MouseEvent e, JPopupMenu popup) {
if (popup != null) {
log.debug("Showing pop up for " + invoker + " at x,y = " + e.getX() + "," + e.getY());
popup.pack();
popup.show(invoker, e.getX(), e.getY());
popup.setVisible(true);
popup.requestFocus();
}
}
/*
* (non-Javadoc)
*
* @see org.apache.jmeter.util.LocaleChangeListener#localeChanged(org.apache.jmeter.util.LocaleChangeEvent)
*/
public void localeChanged(LocaleChangeEvent event) {
// FIrst make sure we save the content of the current GUI (since we
// will flush it away):
updateCurrentNode();
// Forget about all GUIs we've created so far: we'll need to re-created
// them all!
guis = new HashMap();
nodesToGui = new HashMap();
testBeanGUIs = new HashMap();
// BeanInfo objects also contain locale-sensitive data -- flush them
// away:
Introspector.flushCaches();
[[#variabledfb8680]] mf = getMainFrame(); // Fetch once
if (mf == null) // Probably caused by unit testing on headless system
{
log.warn("Mainframe is null");
}
else {
mf.setMainPanel((javax.swing.JComponent) getCurrentGui());
mf.setEditMenu(getTreeListener().getCurrentNode().createPopupMenu());
}
}
private String [[#variabledfbaa00]];
|