Package org.apache.jmeter.gui

Examples of org.apache.jmeter.gui.ReportGuiPackage


            log.error("", err);
        }
    }

    protected void addObjectToTree(TestElement el) {
        ReportGuiPackage guiPackage = ReportGuiPackage.getInstance();
        ReportTreeNode node = new ReportTreeNode(el, guiPackage.getTreeModel());
        guiPackage.getTreeModel().insertNodeInto(node,
                guiPackage.getTreeListener().getCurrentNode(),
                guiPackage.getTreeListener().getCurrentNode().getChildCount());
        TestElement curNode =
            (TestElement)guiPackage.getTreeListener().getCurrentNode().getUserObject();
        if (curNode != null) {
            curNode.addTestElement(el);
            guiPackage.getMainFrame().getTree().setSelectionPath(
                    new TreePath(node.getPath()));
        }
    }
View Full Code Here


     */
    public void doAction(ActionEvent e) {
        ReportActionRouter.getInstance().doActionNow(
                new ActionEvent(e.getSource(), e.getID(),
                        ReportCheckDirty.CHECK_DIRTY));
        ReportGuiPackage guiPackage = ReportGuiPackage.getInstance();
        if (guiPackage.isDirty()) {
            if (JOptionPane.showConfirmDialog(ReportGuiPackage.getInstance()
                    .getMainFrame(), JMeterUtils
                    .getResString("cancel_new_to_save"), JMeterUtils
                    .getResString("Save?"), JOptionPane.YES_NO_OPTION,
                    JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION) {
                ReportActionRouter.getInstance().doActionNow(
                        new ActionEvent(e.getSource(), e.getID(), ActionNames.SAVE));
            }
        }
        guiPackage.getTreeModel().clearTestPlan();
        guiPackage.getTreeListener().getJTree().setSelectionRow(1);

        // Clear the name of the test plan file
        ReportGuiPackage.getInstance().setReportPlanFile(null);

        ReportActionRouter.getInstance().actionPerformed(
View Full Code Here

    /**
     * @see org.apache.jmeter.gui.action.Command#doAction(ActionEvent)
     */
    @Override
    public void doAction(ActionEvent e) {
        ReportGuiPackage guiPack = ReportGuiPackage.getInstance();
        ReportTreeNode[] currentNodes = guiPack.getTreeListener().getSelectedNodes();

        ReportCopy.setCopiedNodes(currentNodes);
        for (int i = 0; i < currentNodes.length; i++) {
            guiPack.getTreeModel().removeNodeFromParent(currentNodes[i]);
        }
        guiPack.getMainFrame().repaint();
    }
View Full Code Here

            addTree.traverse(this);
        } else if (action.equals(ADD_ALL)) {
            previousGuiItems.clear();
            ReportGuiPackage.getInstance().getTreeModel().getReportPlan().traverse(this);
        } else if (action.equals(REMOVE)) {
            ReportGuiPackage guiPackage = ReportGuiPackage.getInstance();
            ReportTreeNode[] nodes = guiPackage.getTreeListener().getSelectedNodes();
            removeMode = true;
            for (int i = nodes.length - 1; i >= 0; i--) {
                guiPackage.getTreeModel().getCurrentSubTree(nodes[i]).traverse(this);
            }
            removeMode = false;
        }
        checkMode = true;
        dirty = false;
View Full Code Here

            enableComponents(nodes, false);
        }
    }

    private void enableComponents(ReportTreeNode[] nodes, boolean enable) {
        ReportGuiPackage pack = ReportGuiPackage.getInstance();
        for (int i = 0; i < nodes.length; i++) {
            nodes[i].setEnabled(enable);
            pack.getGui(nodes[i].getTestElement()).setEnabled(enable);
        }
    }
View Full Code Here

     * @see org.apache.jmeter.gui.action.Command#doAction(ActionEvent)
     */
    @Override
    public void doAction(ActionEvent e) {
        String action = e.getActionCommand();
        ReportGuiPackage guiPackage = ReportGuiPackage.getInstance();
        ReportTreeNode[] draggedNodes = guiPackage.getTreeListener().getDraggedNodes();
        ReportTreeListener treeListener = guiPackage.getTreeListener();
        ReportTreeNode currentNode = treeListener.getCurrentNode();
        ReportTreeNode parentNode = (ReportTreeNode) currentNode.getParent();
        TestElement te = currentNode.getTestElement();
        if (te instanceof TestPlan || te instanceof WorkBench) {
            parentNode = null; // So elements can only be added as children
View Full Code Here

    public void doAction(ActionEvent e) {
        ReportActionRouter.getInstance().actionPerformed(
                new ActionEvent(e.getSource(), e.getID(),
                        ReportCheckDirty.REMOVE));
        ReportGuiPackage guiPackage = ReportGuiPackage.getInstance();
        ReportTreeNode[] nodes = guiPackage.getTreeListener()
                .getSelectedNodes();
        TreePath newTreePath = // Save parent node for later
        guiPackage.getTreeListener().removedSelectedNode();
        for (int i = nodes.length - 1; i >= 0; i--) {
            removeNode(nodes[i]);
        }
        guiPackage.getTreeListener().getJTree().setSelectionPath(newTreePath);
        guiPackage.updateCurrentGui();
    }
View Full Code Here

    public Set<String> getActionNames() {
        return commands;
    }

    protected void addParentToTree(TestElement newParent) {
        ReportGuiPackage guiPackage = ReportGuiPackage.getInstance();
        ReportTreeNode newNode = new ReportTreeNode(newParent, guiPackage
                .getTreeModel());
        ReportTreeNode currentNode = guiPackage.getTreeListener()
                .getCurrentNode();
        ReportTreeNode parentNode = (ReportTreeNode) currentNode.getParent();
        int index = parentNode.getIndex(currentNode);
        guiPackage.getTreeModel().insertNodeInto(newNode, parentNode, index);
        ReportTreeNode[] nodes = guiPackage.getTreeListener()
                .getSelectedNodes();
        for (int i = 0; i < nodes.length; i++) {
            moveNode(guiPackage, nodes[i], newNode);
        }
    }
View Full Code Here

    public ReportEditCommand() {
    }

    public void doAction(ActionEvent e) {
        ReportGuiPackage guiPackage = ReportGuiPackage.getInstance();
        guiPackage.getMainFrame().setMainPanel((javax.swing.JComponent) guiPackage.getCurrentGui());
        guiPackage.getMainFrame().setEditMenu(guiPackage.getTreeListener().getCurrentNode().createPopupMenu());
        // TODO: I believe the following code (to the end of the method) is
        // obsolete,
        // since NamePanel no longer seems to be the GUI for any component:
        if (!(guiPackage.getCurrentGui() instanceof NamePanel)) {
            guiPackage.getMainFrame().setFileLoadEnabled(true);
            guiPackage.getMainFrame().setFileSaveEnabled(true);
        } else {
            guiPackage.getMainFrame().setFileLoadEnabled(false);
            guiPackage.getMainFrame().setFileSaveEnabled(false);
        }
    }
View Full Code Here

  /**
   * @see org.apache.jmeter.gui.action.Command#doAction(ActionEvent)
   */
  public void doAction(ActionEvent e) {
    String action = e.getActionCommand();
    ReportGuiPackage guiPackage = ReportGuiPackage.getInstance();
    ReportTreeNode[] draggedNodes = guiPackage.getTreeListener().getDraggedNodes();
    ReportTreeListener treeListener = guiPackage.getTreeListener();
    ReportTreeNode currentNode = treeListener.getCurrentNode();
    ReportTreeNode parentNode = (ReportTreeNode) currentNode.getParent();
    TestElement te = currentNode.getTestElement();
    if (te instanceof TestPlan || te instanceof WorkBench) {
      parentNode = null; // So elements can only be added as children
View Full Code Here

TOP

Related Classes of org.apache.jmeter.gui.ReportGuiPackage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.