jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1416174 - in /jmeter/trunk: src/core/org/apache/jmeter/gui/action/SearchTreeDialog.java src/core/org/apache/jmeter/resources/messages.properties src/core/org/apache/jmeter/resources/messages_fr.properties xdocs/changes.xml
Date Sun, 02 Dec 2012 13:42:57 GMT
Author: pmouawad
Date: Sun Dec  2 13:42:56 2012
New Revision: 1416174

URL: http://svn.apache.org/viewvc?rev=1416174&view=rev
Log:
Bug 54232 - Search Feature : Add a button to search and expand results
Bugzilla Id: 54232

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/gui/action/SearchTreeDialog.java
    jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties
    jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties
    jmeter/trunk/xdocs/changes.xml

Modified: jmeter/trunk/src/core/org/apache/jmeter/gui/action/SearchTreeDialog.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/gui/action/SearchTreeDialog.java?rev=1416174&r1=1416173&r2=1416174&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/gui/action/SearchTreeDialog.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/gui/action/SearchTreeDialog.java Sun Dec  2 13:42:56
2012
@@ -41,6 +41,8 @@ import javax.swing.JDialog;
 import javax.swing.JFrame;
 import javax.swing.JPanel;
 import javax.swing.JRootPane;
+import javax.swing.JTree;
+import javax.swing.tree.TreePath;
 
 import org.apache.commons.lang3.StringUtils;
 import org.apache.jmeter.gui.GuiPackage;
@@ -78,6 +80,8 @@ public class SearchTreeDialog extends JD
 	 * Store last search
 	 */
 	private transient String lastSearch = null;
+
+    private JButton searchAndExpandButton;
 	
 	public SearchTreeDialog() {
         super((JFrame) null, JMeterUtils.getResString("search_tree_title"), true); //$NON-NLS-1$
@@ -147,9 +151,12 @@ public class SearchTreeDialog extends JD
         
         searchButton = new JButton(JMeterUtils.getResString("search")); //$NON-NLS-1$
         searchButton.addActionListener(this);
+        searchAndExpandButton = new JButton(JMeterUtils.getResString("search_expand")); //$NON-NLS-1$
+        searchAndExpandButton.addActionListener(this);
         cancelButton = new JButton(JMeterUtils.getResString("cancel")); //$NON-NLS-1$
         cancelButton.addActionListener(this);
         buttonsPanel.add(searchButton);
+        buttonsPanel.add(searchAndExpandButton);
         buttonsPanel.add(cancelButton);
         searchPanel.add(buttonsPanel, BorderLayout.SOUTH);
         this.getContentPane().add(searchPanel);
@@ -177,6 +184,7 @@ public class SearchTreeDialog extends JD
 	 * @param e {@link ActionEvent}
 	 */
 	private void doSearch(ActionEvent e) {
+	    boolean expand = e.getSource()==searchAndExpandButton;
 		String wordToSearch = searchTF.getText();
     	if(StringUtils.isEmpty(wordToSearch)) {
             return;
@@ -211,9 +219,15 @@ public class SearchTreeDialog extends JD
                 logger.error("Error occured searching for word:"+ wordToSearch, ex);
             }
         }
+        GuiPackage guiInstance = GuiPackage.getInstance();
+        JTree jTree = guiInstance.getMainFrame().getTree();
+        
         for (Iterator<JMeterTreeNode> iterator = nodes.iterator(); iterator.hasNext();)
{
             JMeterTreeNode jMeterTreeNode = iterator.next();
             jMeterTreeNode.setMarkedBySearch(true);
+            if (expand) {
+                jTree.expandPath(new TreePath(jMeterTreeNode.getPath()));
+            }
         }
         GuiPackage.getInstance().getMainFrame().repaint();
         searchTF.requestFocusInWindow();

Modified: jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties?rev=1416174&r1=1416173&r2=1416174&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties Sun Dec  2 13:42:56
2012
@@ -873,6 +873,7 @@ search_text_msg_not_found=Text not found
 search_text_title_not_found=Not found
 search_tree_title=Search Tree
 search=Search
+search_expand=Search & Expand
 searchbase=Search base
 searchfilter=Search Filter
 searchtest=Search test

Modified: jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties?rev=1416174&r1=1416173&r2=1416174&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties Sun Dec  2 13:42:56
2012
@@ -856,6 +856,7 @@ scheduler_configuration=Configuration du
 scope=Port\u00E9e
 search=Rechercher
 search_base=Base de recherche
+search_expand=Rechercher & D\u00E9plier
 search_filter=Filtre de recherche
 search_test=Recherche
 search_text_button_close=Fermer

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1416174&r1=1416173&r2=1416174&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml (original)
+++ jmeter/trunk/xdocs/changes.xml Sun Dec  2 13:42:56 2012
@@ -211,6 +211,7 @@ to the elements View Results Tree, Asser
 <li><bugzilla>54165</bugzilla> - Proxy Server: Improve rendering of target
controller</li>
 <li><bugzilla>46677</bugzilla> - Copying Test Elements between test plans</li>
 <li><bugzilla>54204</bugzilla> - Result Status Action Handler : Add start
next thread loop option</li>
+<li><bugzilla>54232</bugzilla> - Search Feature : Add a button to search
and expand results</li>
 </ul>
 
 <h2>Non-functional changes</h2>



Mime
View raw message