use of org.apache.jmeter.gui.GuiPackage in project jmeter by apache.
the class CollapseExpand method doAction.
/**
* This method performs the actual command processing.
*
* @param e
* the generic UI action event
*/
@Override
public void doAction(ActionEvent e) {
boolean collapse = ActionNames.COLLAPSE_ALL.equals(e.getActionCommand());
GuiPackage guiInstance = GuiPackage.getInstance();
JTree jTree = guiInstance.getMainFrame().getTree();
if (collapse) {
for (int i = jTree.getRowCount() - 1; i >= 0; i--) {
jTree.collapseRow(i);
}
return;
}
for (int i = 0; i < jTree.getRowCount(); i++) {
jTree.expandRow(i);
}
}
use of org.apache.jmeter.gui.GuiPackage in project jmeter by apache.
the class Duplicate method doAction.
@Override
public void doAction(ActionEvent e) {
GuiPackage instance = GuiPackage.getInstance();
JMeterTreeListener treeListener = instance.getTreeListener();
JMeterTreeNode[] copiedNodes = Copy.cloneTreeNodes(treeListener.getSelectedNodes());
JMeterTreeNode currentNode = treeListener.getCurrentNode();
JMeterTreeNode parentNode = (JMeterTreeNode) currentNode.getParent();
JMeterTreeModel treeModel = instance.getTreeModel();
for (JMeterTreeNode copiedNode : copiedNodes) {
int index = parentNode.getIndex(currentNode) + 1;
treeModel.insertNodeInto(copiedNode, parentNode, index);
}
instance.getMainFrame().repaint();
}
use of org.apache.jmeter.gui.GuiPackage in project jmeter by apache.
the class EditCommand method doAction.
@Override
public void doAction(ActionEvent e) {
GuiPackage guiPackage = GuiPackage.getInstance();
JMeterGUIComponent currentGui = guiPackage.getCurrentGui();
guiPackage.getMainFrame().setMainPanel((javax.swing.JComponent) currentGui);
guiPackage.getMainFrame().setEditMenu(guiPackage.getTreeListener().getCurrentNode().createPopupMenu());
guiPackage.getMainFrame().setFileLoadEnabled(true);
guiPackage.getMainFrame().setFileSaveEnabled(true);
}
use of org.apache.jmeter.gui.GuiPackage in project jmeter by apache.
the class AddParent method doAction.
@Override
public void doAction(ActionEvent e) {
String name = ((Component) e.getSource()).getName();
GuiPackage guiPackage = GuiPackage.getInstance();
try {
guiPackage.updateCurrentNode();
TestElement controller = guiPackage.createTestElement(name);
addParentToTree(controller);
} catch (Exception err) {
log.error("Exception while adding a TestElement.", err);
}
}
use of org.apache.jmeter.gui.GuiPackage in project jmeter by apache.
the class SSLManager method getPassword.
/*
* The password can be defined as a property; this dialogue is provided to allow it
* to be entered at run-time.
*
* However, this does not gain much, as the dialogue does not (yet) support hidden input ...
*
*/
private String getPassword() {
String password = this.defaultpw;
if (null == password) {
final GuiPackage guiInstance = GuiPackage.getInstance();
if (guiInstance != null) {
synchronized (this) {
// TODO is sync really needed?
this.defaultpw = JOptionPane.showInputDialog(guiInstance.getMainFrame(), // $NON-NLS-1$
JMeterUtils.getResString("ssl_pass_prompt"), // $NON-NLS-1$
JMeterUtils.getResString("ssl_pass_title"), JOptionPane.QUESTION_MESSAGE);
System.setProperty(KEY_STORE_PASSWORD, this.defaultpw);
password = this.defaultpw;
}
} else {
log.warn("No password provided, and no GUI present so cannot prompt");
}
}
return password;
}
Aggregations