Home » jakarta-jmeter-2.3.4_src » org.apache.jmeter.gui » [javadoc | source]
org.apache.jmeter.gui
public final class: GuiPackage [javadoc | source]
java.lang.Object
   org.apache.jmeter.gui.GuiPackage

All Implemented Interfaces:
    LocaleChangeListener

GuiPackage is a static class that provides convenient access to information about the current state of JMeter's GUI. Any GUI class can grab a handle to GuiPackage by calling the static method #getInstance() and then use it to query the GUI about it's state. When actions, for instance, need to affect the GUI, they typically use GuiPackage to get access to different parts of the GUI.
Method from org.apache.jmeter.gui.GuiPackage Summary:
addSubTree,   clearTestPlan,   clearTestPlan,   createTestElement,   createTestElement,   displayPopUp,   displayPopUp,   getCurrentElement,   getCurrentGui,   getCurrentNode,   getCurrentSubTree,   getGui,   getGui,   getInstance,   getInstance,   getMainFrame,   getNodeOf,   getReplacer,   getTestPlanFile,   getTreeListener,   getTreeModel,   isDirty,   localeChanged,   removeNode,   setDirty,   setMainFrame,   setTestPlanFile,   setTreeListener,   setTreeModel,   showErrorMessage,   showInfoMessage,   showMessage,   showWarningMessage,   updateCurrentGui,   updateCurrentNode
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.jmeter.gui.GuiPackage Detail:
 public HashTree addSubTree(HashTree subTree) throws IllegalUserActionException 
    Add a subtree to the currently selected node.
 public  void clearTestPlan() 
    Clears the test plan and associated objects. Clears the test plan file name.
 public  void clearTestPlan(TestElement element) 
    Clears the test plan element and associated object
 public TestElement createTestElement(String objClass) 
    Create a TestElement for a GUI or TestBean class.

    This is a utility method to help actions do with one single String parameter.

 public TestElement createTestElement(Class guiClass,
    Class testClass) 
    Create a TestElement corresponding to the specified GUI class.
 public  void displayPopUp(MouseEvent e,
    JPopupMenu popup) 
    Display the specified popup menu with the source component and location from the specified mouse event.
 public  void displayPopUp(Component invoker,
    MouseEvent e,
    JPopupMenu popup) 
    Display the specified popup menu at the location specified by a mouse event with the specified source component.
 public TestElement getCurrentElement() 
 public JMeterGUIComponent getCurrentGui() 
    Convenience method for grabbing the gui for the current node.
 public JMeterTreeNode getCurrentNode() 
 public HashTree getCurrentSubTree() 
    Get the currently selected subtree.
 public JMeterGUIComponent getGui(TestElement node) 
    Get a JMeterGUIComponent for the specified test element. If the GUI has already been created, that instance will be returned. Otherwise, if a GUI component of the same type has been created, and the component is not marked as an UnsharedComponent , that shared component will be returned. Otherwise, a new instance of the component will be created. The TestElement's GUI_CLASS property will be used to determine the appropriate type of GUI component to use.
 public JMeterGUIComponent getGui(TestElement node,
    Class guiClass,
    Class testClass) 
    Get a JMeterGUIComponent for the specified test element. If the GUI has already been created, that instance will be returned. Otherwise, if a GUI component of the same type has been created, and the component is not marked as an UnsharedComponent , that shared component will be returned. Otherwise, a new instance of the component will be created.
 public static GuiPackage getInstance() 
    Retrieve the singleton GuiPackage instance.
 public static GuiPackage getInstance(JMeterTreeListener listener,
    JMeterTreeModel treeModel) 
    When GuiPackage is requested for the first time, it should be given handles to JMeter's Tree Listener and TreeModel.
 public MainFrame getMainFrame() 
    Get the main JMeter frame.
 public JMeterTreeNode getNodeOf(TestElement userObject) 
    Find the JMeterTreeNode for a certain TestElement object.
 public ValueReplacer getReplacer() 
    Get a ValueReplacer for the test tree.
 public String getTestPlanFile() 
 public JMeterTreeListener getTreeListener() 
    Get the listener for JMeter's test tree.
 public JMeterTreeModel getTreeModel() 
    Get the model for JMeter's test tree.
 public boolean isDirty() 
    Retrieves the state of the 'dirty' property, a flag that indicates if there are test tree components that have been modified since they were last saved.
 public  void localeChanged(LocaleChangeEvent event) 
 public  void removeNode(TestElement node) 
    Remove a test element from the tree. This removes the reference to any associated GUI component.
 public  void setDirty(boolean dirty) 
    The dirty property is a flag that indicates whether there are parts of JMeter's test tree that the user has not saved since last modification. Various (@link Command actions) set this property when components are modified/created/saved.
 public  void setMainFrame(MainFrame newMainFrame) 
    Set the main JMeter frame.
 public  void setTestPlanFile(String f) 
    Sets the filepath of the current test plan. It's shown in the main frame title and used on saving.
 public  void setTreeListener(JMeterTreeListener newTreeListener) 
    Set the listener for JMeter's test tree.
 public  void setTreeModel(JMeterTreeModel newTreeModel) 
    Set the model for JMeter's test tree.
 public static  void showErrorMessage(String message,
    String title) 
 public static  void showInfoMessage(String message,
    String title) 
 public static  void showMessage(String message,
    String title,
    int type) 
 public static  void showWarningMessage(String message,
    String title) 
 public  void updateCurrentGui() 
    Update the GUI for the currently selected node. The GUI component is configured to reflect the settings in the current tree node.
 public  void updateCurrentNode() 
    This method should be called in order for GuiPackage to change the current node. This will save any changes made to the earlier node before choosing the new node.