public Collection<String> getMenuCategories() { try { return GuiPackage.getInstance().getGui(getTestElement()).getMenuCategories(); } catch (Exception e) { log.error("Can't get popup menu for gui", e); return null; } }
public JPopupMenu createPopupMenu() { try { return GuiPackage.getInstance().getGui(getTestElement()).createPopupMenu(); } catch (Exception e) { log.error("Can't get popup menu for gui", e); return null; } }
guiClass = Class.forName(guiClassName); return getGui(node, guiClass, testClass); } catch (ClassNotFoundException e) { log.error("Could not get GUI for " + node, e);
public String getStaticLabel() { return GuiPackage.getInstance().getGui((TestElement) getUserObject()).getStaticLabel(); }
public String getDocAnchor() { return GuiPackage.getInstance().getGui((TestElement) getUserObject()).getDocAnchor(); }
/** * Refresh GUI from node state. * This method does not update the current node from GUI at the * difference of {@link GuiPackage#updateCurrentGui()} */ public void refreshCurrentGui() { currentNode = treeListener.getCurrentNode(); TestElement element = currentNode.getTestElement(); JMeterGUIComponent comp = getGui(element); if (comp == null) { log.debug("No component found for {}", currentNode.getName()); return; } comp.configure(element); currentNodeUpdated = false; }
private void enableComponents(JMeterTreeNode[] nodes, boolean enable) { GuiPackage pack = GuiPackage.getInstance(); for (JMeterTreeNode node : nodes) { node.setEnabled(enable); pack.getGui(node.getTestElement()).setEnabled(enable); } }
/** * Convenience method for grabbing the gui for the current node. * * @return the GUI component associated with the currently selected node */ public JMeterGUIComponent getCurrentGui() { try { updateCurrentNode(); TestElement curNode = treeListener.getCurrentNode().getTestElement(); JMeterGUIComponent comp = getGui(curNode); if (comp == null) { log.debug("No Component found for {}.", treeListener.getCurrentNode().getName()); return null; } comp.clearGui(); log.debug("Updating gui to new node"); comp.configure(curNode); currentNodeUpdated = false; return comp; } catch (Exception e) { log.error("Problem retrieving current gui", e); return null; } }
private void toggleComponents(JMeterTreeNode[] nodes) { GuiPackage pack = GuiPackage.getInstance(); for (JMeterTreeNode node : nodes) { boolean enable = !node.isEnabled(); node.setEnabled(enable); pack.getGui(node.getTestElement()).setEnabled(enable); } }
@Override public void doAction(ActionEvent e) { GuiPackage guiPackage = GuiPackage.getInstance(); final String actionCommand = e.getActionCommand(); if (actionCommand.equals(ActionNames.CLEAR)) { JMeterGUIComponent guiComp = guiPackage.getCurrentGui(); if (guiComp instanceof Clearable){ ((Clearable) guiComp).clearData(); } } else { guiPackage.getMainFrame().clearData(); for (JMeterTreeNode node : guiPackage.getTreeModel().getNodesOfType(Clearable.class)) { JMeterGUIComponent guiComp = guiPackage.getGui(node.getTestElement()); if (guiComp instanceof Clearable){ Clearable item = (Clearable) guiComp; try { item.clearData(); } catch (Exception ex) { log.error("Can't clear: {} {}", node, guiComp, ex); } } } } } }
if (currentNode != null && !currentNodeUpdated) { log.debug("Updating current node {}", currentNode.getName()); JMeterGUIComponent comp = getGui(currentNode.getTestElement()); if (comp == null) { log.debug("No component found for {}", currentNode.getName());
JMeterGUIComponent guicomp = guiPackage.getGui(component); guicomp.clearGui(); guicomp.configure(component);