Author: pmouawad
Date: Fri Apr  6 18:30:23 2018
New Revision: 1828540

URL: http://svn.apache.org/viewvc?rev=1828540&view=rev
Log:
Bug 62269 - View Results Tree : Response and Request Tabs should contains 
Header and Body tabs
Bug 62270 - View Results Tree : Allow searching in Request headers, Response 
Headers, and Request body
Contributed by UbikLoadPack
Bugzilla Id: 62269

Added:
    jmeter/trunk/src/core/org/apache/jmeter/gui/util/JSyntaxSearchToolBar.java  
 (with props)
Modified:
    
jmeter/trunk/src/components/org/apache/jmeter/visualizers/RequestViewRaw.java
    
jmeter/trunk/src/components/org/apache/jmeter/visualizers/SamplerResultTab.java
    
jmeter/trunk/src/components/org/apache/jmeter/visualizers/SearchTextExtension.java
    jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties
    jmeter/trunk/src/core/org/apache/jmeter/resources/messages_es.properties
    jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties
    
jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/visualizers/RequestViewHTTP.java
    jmeter/trunk/xdocs/changes.xml

Modified: 
jmeter/trunk/src/components/org/apache/jmeter/visualizers/RequestViewRaw.java
URL: 
http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/visualizers/RequestViewRaw.java?rev=1828540&r1=1828539&r2=1828540&view=diff
==============================================================================
--- 
jmeter/trunk/src/components/org/apache/jmeter/visualizers/RequestViewRaw.java 
(original)
+++ 
jmeter/trunk/src/components/org/apache/jmeter/visualizers/RequestViewRaw.java 
Fri Apr  6 18:30:23 2018
@@ -21,8 +21,12 @@ package org.apache.jmeter.visualizers;
 import java.awt.BorderLayout;
 
 import javax.swing.JPanel;
-import javax.swing.JTextArea;
+import javax.swing.JScrollPane;
+import javax.swing.JTabbedPane;
 
+import org.apache.jmeter.gui.util.JSyntaxSearchToolBar;
+import org.apache.jmeter.gui.util.JSyntaxTextArea;
+import org.apache.jmeter.gui.util.JTextScrollPane;
 import org.apache.jmeter.samplers.SampleResult;
 import org.apache.jmeter.util.JMeterUtils;
 import org.apache.jorphan.gui.GuiUtils;
@@ -36,7 +40,8 @@ public class RequestViewRaw implements R
     // Used by Request Panel
     static final String KEY_LABEL = "view_results_table_request_tab_raw"; 
//$NON-NLS-1$
 
-    private JTextArea sampleDataField;
+    private JSyntaxTextArea headerData;
+    private JSyntaxTextArea sampleDataField;
 
     private JPanel paneRaw; /** request pane content */
 
@@ -46,12 +51,27 @@ public class RequestViewRaw implements R
     @Override
     public void init() {
         paneRaw = new JPanel(new BorderLayout(0, 5));
-        sampleDataField = new JTextArea();
+        
+        sampleDataField = JSyntaxTextArea.getInstance(20, 80, true);
         sampleDataField.setEditable(false);
         sampleDataField.setLineWrap(true);
         sampleDataField.setWrapStyleWord(true);
-
-        paneRaw.add(GuiUtils.makeScrollPane(sampleDataField));
+        JPanel requestAndSearchPanel = new JPanel(new BorderLayout());
+        requestAndSearchPanel.add(new 
JSyntaxSearchToolBar(sampleDataField).getToolBar(), BorderLayout.NORTH);
+        
requestAndSearchPanel.add(JTextScrollPane.getInstance(sampleDataField), 
BorderLayout.CENTER);
+        
+        headerData = JSyntaxTextArea.getInstance(20, 80, true);
+        headerData.setEditable(false);
+        headerData.setLineWrap(true);
+        headerData.setWrapStyleWord(true);
+        JPanel headerAndSearchPanel = new JPanel(new BorderLayout());
+        headerAndSearchPanel.add(new 
JSyntaxSearchToolBar(headerData).getToolBar(), BorderLayout.NORTH);
+        headerAndSearchPanel.add(JTextScrollPane.getInstance(headerData), 
BorderLayout.CENTER);
+
+        JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
+        
tabbedPane.addTab(JMeterUtils.getResString("view_results_request_body"), new 
JScrollPane(requestAndSearchPanel));
+        
tabbedPane.addTab(JMeterUtils.getResString("view_results_request_headers"), new 
JScrollPane(headerAndSearchPanel));
+        paneRaw.add(GuiUtils.makeScrollPane(tabbedPane));
 
     }
 
@@ -60,7 +80,8 @@ public class RequestViewRaw implements R
      */
     @Override
     public void clearData() {
-        sampleDataField.setText(""); //$NON-NLS-1$
+        sampleDataField.setInitialText(""); //$NON-NLS-1$
+        headerData.setInitialText(""); //$NON-NLS-1$
     }
 
     /* (non-Javadoc)
@@ -68,26 +89,18 @@ public class RequestViewRaw implements R
      */
     @Override
     public void setSamplerResult(Object objectResult) {
-
         if (objectResult instanceof SampleResult) {
             SampleResult sampleResult = (SampleResult) objectResult;
-            String rh = sampleResult.getRequestHeaders();
-            StringBuilder sb = new StringBuilder();
-            String sd = sampleResult.getSamplerData();
-            if (sd != null) {
-                sb.append(sd);
-                sb.append("\n"); //$NON-NLS-1$
-            } 
             // Don't display Request headers label if rh is null or empty
-            if (rh != null && rh.length() > 0) {
-                
sb.append(JMeterUtils.getResString("view_results_request_headers")); 
//$NON-NLS-1$
-                sb.append("\n"); //$NON-NLS-1$
-                sb.append(rh);
-                sb.append("\n"); //$NON-NLS-1$
+            String rh = sampleResult.getRequestHeaders();
+            if (rh != null && !rh.isEmpty()) {
+                headerData.setInitialText(rh);
+                sampleDataField.setCaretPosition(0);
             }
-            if (sb.length() > 0) {
-                sampleDataField.setText(sb.toString());
-                sampleDataField.setCaretPosition(1);
+            String data = sampleResult.getSamplerData();
+            if (data != null && !data.isEmpty()) {
+                sampleDataField.setText(data);
+                sampleDataField.setCaretPosition(0);
             } else {
                 // add a message when no request data (ex. Java request)
                 sampleDataField.setText(JMeterUtils

Modified: 
jmeter/trunk/src/components/org/apache/jmeter/visualizers/SamplerResultTab.java
URL: 
http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/visualizers/SamplerResultTab.java?rev=1828540&r1=1828539&r2=1828540&view=diff
==============================================================================
--- 
jmeter/trunk/src/components/org/apache/jmeter/visualizers/SamplerResultTab.java 
(original)
+++ 
jmeter/trunk/src/components/org/apache/jmeter/visualizers/SamplerResultTab.java 
Fri Apr  6 18:30:23 2018
@@ -22,6 +22,7 @@ package org.apache.jmeter.visualizers;
 import java.awt.BorderLayout;
 import java.awt.Color;
 import java.awt.Component;
+import java.awt.GridLayout;
 import java.text.DateFormat;
 import java.text.SimpleDateFormat;
 import java.util.Date;
@@ -50,9 +51,13 @@ import javax.swing.text.StyledDocument;
 
 import org.apache.jmeter.assertions.AssertionResult;
 import org.apache.jmeter.gui.util.HeaderAsPropertyRenderer;
+import org.apache.jmeter.gui.util.JSyntaxSearchToolBar;
+import org.apache.jmeter.gui.util.JSyntaxTextArea;
+import org.apache.jmeter.gui.util.JTextScrollPane;
 import org.apache.jmeter.gui.util.TextBoxDialoger.TextBoxDoubleClick;
 import org.apache.jmeter.samplers.SampleResult;
 import org.apache.jmeter.util.JMeterUtils;
+import 
org.apache.jmeter.visualizers.SearchTextExtension.JEditorPaneSearchProvider;
 import org.apache.jorphan.gui.GuiUtils;
 import org.apache.jorphan.gui.ObjectTableModel;
 import org.apache.jorphan.gui.RendererUtils;
@@ -64,6 +69,7 @@ import org.apache.jorphan.reflect.Functo
  */
 public abstract class SamplerResultTab implements ResultRenderer {
 
+    
     // N.B. these are not multi-threaded, so don't make it static
     private final DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd 
HH:mm:ss z"); // ISO format $NON-NLS-1$
 
@@ -93,6 +99,7 @@ public abstract class SamplerResultTab i
     /** Contains results; contained in resultsPane */
     protected JScrollPane resultsScrollPane;
     
+    private JSyntaxTextArea headerData;
     /** Response Data shown here */
     protected JEditorPane results;
 
@@ -114,8 +121,6 @@ public abstract class SamplerResultTab i
 
     protected SearchTextExtension searchTextExtension;
 
-    private JPanel searchPanel = null;
-
     protected boolean activateSearchExtension = true; // most current 
subclasses can process text
 
     private Color backGround;
@@ -200,6 +205,7 @@ public abstract class SamplerResultTab i
     @Override
     public void clearData() {
         results.setText("");// Response Data // $NON-NLS-1$
+        headerData.setInitialText(""); // $NON-NLS-1$
         requestPanel.clearData();// Request Data // $NON-NLS-1$
         stats.setText(""); // Sampler result // $NON-NLS-1$
         resultModel.clearData();
@@ -324,11 +330,6 @@ public abstract class SamplerResultTab i
                                 
.getResString("view_results_response_message")) //$NON-NLS-1$
                         .append(responseMsgStr).append(NL);
                 statsBuff.append(NL);
-                statsBuff
-                        .append(JMeterUtils
-                                
.getResString("view_results_response_headers")) //$NON-NLS-1$
-                        .append(NL);
-                statsBuff.append(sampleResult.getResponseHeaders()).append(NL);
                 statsBuff.append(NL);
                 statsBuff
                         .append(typeResult + " " //$NON-NLS-1$
@@ -396,7 +397,9 @@ public abstract class SamplerResultTab i
                 for (Entry<String, String> entry : keySet) {
                     resHeadersModel.addRow(new RowResult(entry.getKey(), 
entry.getValue()));
                 }
-                
+
+                headerData.setInitialText(sampleResult.getResponseHeaders());
+
                 // Fields table
                 resFieldsModel.addRow(new RowResult("Type Result ", 
typeResult)); //$NON-NLS-1$
                 //not sure needs I18N?
@@ -558,23 +561,35 @@ public abstract class SamplerResultTab i
         results = new JEditorPane();
         results.setEditable(false);
 
+        headerData = JSyntaxTextArea.getInstance(20, 80, true);
+        headerData.setEditable(false);
+        headerData.setLineWrap(true);
+        headerData.setWrapStyleWord(true);
+
+        JPanel headersAndSearchPanel = new JPanel(new BorderLayout());
+        headersAndSearchPanel.add(new 
JSyntaxSearchToolBar(headerData).getToolBar(), BorderLayout.NORTH);
+        headersAndSearchPanel.add(JTextScrollPane.getInstance(headerData), 
BorderLayout.CENTER);
+
         resultsScrollPane = GuiUtils.makeScrollPane(results);
         imageLabel = new JLabel();
 
-        JPanel panel = new JPanel(new BorderLayout());
-        panel.add(resultsScrollPane, BorderLayout.CENTER);
+        JPanel resultAndSearchPanel = new JPanel(new BorderLayout());
+        resultAndSearchPanel.add(resultsScrollPane, BorderLayout.CENTER);
+
 
         if (activateSearchExtension) {
             // Add search text extension
-            searchTextExtension = new SearchTextExtension();
-            searchTextExtension.init(panel);
-            searchPanel = searchTextExtension.createSearchTextExtensionPane();
-            searchTextExtension.setResults(results);
-            searchPanel.setVisible(true);
-            panel.add(searchPanel, BorderLayout.PAGE_END);
+            searchTextExtension = new SearchTextExtension(new 
JEditorPaneSearchProvider(results));
+            resultAndSearchPanel.add(searchTextExtension.getSearchToolBar(), 
BorderLayout.NORTH);
         }
 
-        return panel;
+        JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
+        
tabbedPane.addTab(JMeterUtils.getResString("view_results_response_body"), new 
JScrollPane(resultAndSearchPanel));
+        
tabbedPane.addTab(JMeterUtils.getResString("view_results_response_headers"), 
new JScrollPane(headersAndSearchPanel));
+
+        JPanel gPanel = new JPanel(new GridLayout(1,1));
+        gPanel.add(tabbedPane);
+        return gPanel;
     }
 
     private void showImage(Icon image) {

Modified: 
jmeter/trunk/src/components/org/apache/jmeter/visualizers/SearchTextExtension.java
URL: 
http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/visualizers/SearchTextExtension.java?rev=1828540&r1=1828539&r2=1828540&view=diff
==============================================================================
--- 
jmeter/trunk/src/components/org/apache/jmeter/visualizers/SearchTextExtension.java
 (original)
+++ 
jmeter/trunk/src/components/org/apache/jmeter/visualizers/SearchTextExtension.java
 Fri Apr  6 18:30:23 2018
@@ -20,7 +20,6 @@
 package org.apache.jmeter.visualizers;
 
 import java.awt.Color;
-import java.awt.Dimension;
 import java.awt.Font;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
@@ -30,18 +29,14 @@ import java.util.regex.PatternSyntaxExce
 
 import javax.swing.AbstractAction;
 import javax.swing.ActionMap;
-import javax.swing.BorderFactory;
-import javax.swing.Box;
-import javax.swing.BoxLayout;
 import javax.swing.InputMap;
 import javax.swing.JButton;
 import javax.swing.JCheckBox;
 import javax.swing.JComponent;
 import javax.swing.JEditorPane;
-import javax.swing.JLabel;
 import javax.swing.JOptionPane;
-import javax.swing.JPanel;
 import javax.swing.JTextField;
+import javax.swing.JToolBar;
 import javax.swing.UIManager;
 import javax.swing.event.DocumentEvent;
 import javax.swing.event.DocumentListener;
@@ -66,8 +61,6 @@ public class SearchTextExtension impleme
 
     private static final String SEARCH_TEXT_COMMAND = "search_text"; // 
$NON-NLS-1$
 
-    private JLabel label;
-
     private JButton findButton;
 
     private JTextField textToFindField;
@@ -75,25 +68,17 @@ public class SearchTextExtension impleme
     private JCheckBox caseChkBox;
 
     private JCheckBox regexpChkBox;
-
-    private JPanel searchPanel;
     
     private String lastTextTofind;
     
     private ISearchTextExtensionProvider searchProvider;
 
-    public void init(JPanel resultsPane) {}
+    private JToolBar toolBar;
 
-    public void setResults(JEditorPane results) {
-        setSearchProvider(new JEditorPaneSearchProvider(results));
-    }
-    
-    public void setSearchProvider(ISearchTextExtensionProvider searchProvider) 
{
-        if (this.searchProvider != null) {
-            this.searchProvider.resetTextToFind();
-        }
-        
+    public SearchTextExtension(ISearchTextExtensionProvider searchProvider) {
         this.searchProvider = searchProvider;
+        searchProvider.resetTextToFind();
+        createSearchToolBar();
     }
 
     /**
@@ -113,7 +98,7 @@ public class SearchTextExtension impleme
                 Pattern pattern = createPattern(textToFindField.getText());
                 boolean found = searchProvider.executeAndShowTextFind(pattern);
                 if(found) {
-                    
findButton.setText(JMeterUtils.getResString("search_text_button_next"));// 
$NON-NLS-1$
+                    
findButton.setText(JMeterUtils.getResString("search_text_button_find"));// 
$NON-NLS-1$
                     lastTextTofind = textToFind;
                     textToFindField.setBackground(Color.WHITE);
                     textToFindField.setForeground(Color.BLACK);
@@ -131,23 +116,27 @@ public class SearchTextExtension impleme
             }
         }
     }
+    
+    /**
+     * 
+     * @return {@link JToolBar} the search toolbat component
+     */
+    public JToolBar getSearchToolBar() {
+        return toolBar;
+    }
 
     /**
      * Create the text find task pane
      *
      * @return Text find task pane
      */
-    private JPanel createSearchTextPanel() {
+    private JToolBar createSearchToolBar() {
         // Search field
-        searchPanel = new JPanel();
-        searchPanel.setLayout(new BoxLayout(searchPanel, BoxLayout.X_AXIS));
-        searchPanel.setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3));
-        label = new JLabel(JMeterUtils.getResString("search_text_field")); // 
$NON-NLS-1$
-        label.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 5));
-        searchPanel.add(label);
         textToFindField = new JTextField(); // $NON-NLS-1$
-        searchPanel.add(textToFindField);
-        searchPanel.add(Box.createRigidArea(new Dimension(5,0)));
+        this.toolBar = new JToolBar();
+        toolBar.setFloatable(false);
+        toolBar.setFont(FONT_SMALL);
+        toolBar.add(textToFindField);
 
         // add listener to intercept texttofind changes and reset search
         textToFindField.getDocument().addDocumentListener(this);
@@ -158,17 +147,17 @@ public class SearchTextExtension impleme
         findButton.setFont(FONT_SMALL);
         findButton.setActionCommand(SEARCH_TEXT_COMMAND);
         findButton.addActionListener(this);
-        searchPanel.add(findButton);
+        toolBar.add(findButton);
 
         // checkboxes
         caseChkBox = new JCheckBox(JMeterUtils
                 .getResString("search_text_chkbox_case"), false); // 
$NON-NLS-1$
         caseChkBox.setFont(FONT_SMALL);
-        searchPanel.add(caseChkBox);
+        toolBar.add(caseChkBox);
         regexpChkBox = new JCheckBox(JMeterUtils
                 .getResString("search_text_chkbox_regexp"), false); // 
$NON-NLS-1$
         regexpChkBox.setFont(FONT_SMALL);
-        searchPanel.add(regexpChkBox);
+        toolBar.add(regexpChkBox);
 
         // when Enter is pressed, search start
         InputMap im = textToFindField
@@ -176,18 +165,9 @@ public class SearchTextExtension impleme
         im.put(KeyStrokes.ENTER, SEARCH_TEXT_COMMAND);
         ActionMap am = textToFindField.getActionMap();
         am.put(SEARCH_TEXT_COMMAND, new EnterAction());
-
-        // default not visible
-        searchPanel.setVisible(true);
-        return searchPanel;
+        return toolBar;
     }
 
-    public JPanel createSearchTextExtensionPane() {
-        JPanel pane = new JPanel();
-        pane.setLayout(new BoxLayout(pane, BoxLayout.X_AXIS));
-        pane.add(createSearchTextPanel());
-        return pane;
-    }
 
     /**
      * Display the response as text or as rendered HTML. Change the text on the
@@ -269,7 +249,7 @@ public class SearchTextExtension impleme
      * JEditorPane search provider
      * Should probably be moved in its on file
      */
-    private static class JEditorPaneSearchProvider implements 
ISearchTextExtensionProvider {
+    public static class JEditorPaneSearchProvider implements 
ISearchTextExtensionProvider {
 
         private static volatile int LAST_POSITION_DEFAULT = 0;
         private static final Color HIGHLIGHT_COLOR = Color.GREEN;

Added: 
jmeter/trunk/src/core/org/apache/jmeter/gui/util/JSyntaxSearchToolBar.java
URL: 
http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/gui/util/JSyntaxSearchToolBar.java?rev=1828540&view=auto
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/gui/util/JSyntaxSearchToolBar.java 
(added)
+++ jmeter/trunk/src/core/org/apache/jmeter/gui/util/JSyntaxSearchToolBar.java 
Fri Apr  6 18:30:23 2018
@@ -0,0 +1,136 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed  under the  License is distributed on an "AS IS" BASIS,
+ * WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
+ * implied.
+ * 
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jmeter.gui.util;
+
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JTextField;
+import javax.swing.JToolBar;
+import javax.swing.UIManager;
+
+import org.apache.jmeter.util.JMeterUtils;
+import org.fife.ui.rtextarea.SearchContext;
+import org.fife.ui.rtextarea.SearchEngine;
+
+/**
+ * Search toolbar associated to {@link JSyntaxTextArea}
+ * @since 4.1
+ */
+public final class JSyntaxSearchToolBar implements ActionListener {
+    public static final Color LIGHT_RED = new Color(0xFF, 0x80, 0x80);
+
+    private static final Font FONT_DEFAULT = 
UIManager.getDefaults().getFont("TextField.font");
+
+    private static final Font FONT_SMALL = new Font("SansSerif", Font.PLAIN, 
(int) Math.round(FONT_DEFAULT.getSize() * 0.8));
+
+    public static final String FIND_ACTION = "Find";
+
+    private JToolBar toolBar;
+
+    private JTextField searchField;
+    
+    private JCheckBox regexCB;
+
+    private JCheckBox matchCaseCB;
+    
+    /**
+     * The component where we Search
+     */
+    private JSyntaxTextArea dataField;
+
+    /**
+     * @param dataField {@link JSyntaxTextArea} to use for searching
+     */
+    public JSyntaxSearchToolBar(JSyntaxTextArea dataField) {
+        this.dataField = dataField;
+        init();
+    }
+    
+    private void init() {
+        this.searchField = new JTextField(30);
+        searchField.setFont(FONT_SMALL);
+        final JButton findButton = new 
JButton(JMeterUtils.getResString("search_text_button_find"));
+        findButton.setFont(FONT_SMALL);
+        findButton.setActionCommand(FIND_ACTION);
+        findButton.addActionListener(this);
+        regexCB = new 
JCheckBox(JMeterUtils.getResString("search_text_chkbox_regexp"));
+        regexCB.setFont(FONT_SMALL);
+
+        matchCaseCB = new 
JCheckBox(JMeterUtils.getResString("search_text_chkbox_case"));
+        matchCaseCB.setFont(FONT_SMALL);
+
+        this.toolBar = new JToolBar();
+        toolBar.setFloatable(false);
+        toolBar.setFont(FONT_SMALL);
+        toolBar.add(searchField);
+        toolBar.add(findButton);
+        toolBar.add(matchCaseCB);
+        toolBar.add(regexCB);
+        searchField.addActionListener(e -> findButton.doClick(0));
+    }
+    
+    public JToolBar getToolBar() {
+        return toolBar;
+    }
+
+    @Override
+    public void actionPerformed(ActionEvent evt) {
+        String text = searchField.getText();
+        toggleSearchField(searchField, true);
+        
+        if (!text.isEmpty()) {
+            SearchContext context = createSearchContext(
+                    text, true, matchCaseCB.isSelected(), 
regexCB.isSelected());
+            boolean found = SearchEngine.find(dataField, context).wasFound();
+            toggleSearchField(searchField, found);
+            if(!found) {
+                dataField.setCaretPosition(0);
+            }
+        }
+    }
+
+    protected void toggleSearchField(JTextField textToFindField, boolean 
matchFound) {
+        if(!matchFound) {
+            textToFindField.setBackground(LIGHT_RED);
+            textToFindField.setForeground(Color.WHITE);
+        } else {
+            textToFindField.setBackground(Color.WHITE);
+            textToFindField.setForeground(Color.BLACK);
+        }
+    }
+    
+    private SearchContext createSearchContext(String text, boolean forward, 
boolean matchCase, 
+            boolean isRegex) {
+        SearchContext context = new SearchContext();
+        context.setSearchFor(text);
+        context.setMatchCase(matchCase);
+        context.setRegularExpression(isRegex);
+        context.setSearchForward(forward);
+        context.setMarkAll(false);
+        context.setSearchSelectionOnly(false);
+        context.setWholeWord(false);
+        return context;
+    }
+}

Propchange: 
jmeter/trunk/src/core/org/apache/jmeter/gui/util/JSyntaxSearchToolBar.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
jmeter/trunk/src/core/org/apache/jmeter/gui/util/JSyntaxSearchToolBar.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

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=1828540&r1=1828539&r2=1828540&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties 
(original)
+++ jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties Fri 
Apr  6 18:30:23 2018
@@ -1044,7 +1044,6 @@ search_search_all_expand=Search All & Ex
 search_test=Search Test
 search_text_button_close=Close
 search_text_button_find=Find
-search_text_button_next=Find next
 search_text_chkbox_case=Case sensitive
 search_text_chkbox_regexp=Regular exp.
 search_text_field=Search\: 
@@ -1328,9 +1327,11 @@ view_results_render_html_formatted=HTML
 view_results_render_json=JSON
 view_results_render_text=Text
 view_results_render_xml=XML
-view_results_request_headers=Request Headers:
+view_results_request_body=Request Body
+view_results_request_headers=Request Headers
 view_results_response_code=Response code: 
-view_results_response_headers=Response headers:
+view_results_response_body=Response Body
+view_results_response_headers=Response headers
 view_results_response_message=Response message: 
 view_results_response_missing_tika=Missing tika-app.jar in classpath. Unable 
to convert to plain text this kind of document.\nDownload the tika-app-x.x.jar 
file from http://tika.apache.org/download.html\nAnd put the file in 
<JMeter>/lib directory.
 view_results_response_partial_message=Start of message:

Modified: 
jmeter/trunk/src/core/org/apache/jmeter/resources/messages_es.properties
URL: 
http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/resources/messages_es.properties?rev=1828540&r1=1828539&r2=1828540&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/resources/messages_es.properties 
(original)
+++ jmeter/trunk/src/core/org/apache/jmeter/resources/messages_es.properties 
Fri Apr  6 18:30:23 2018
@@ -687,7 +687,6 @@ search_filter=Filtro de B\u00FAsqueda
 search_test=Prueba de B\u00FAsqueda
 search_text_button_close=Cerrar
 search_text_button_find=Encontrar
-search_text_button_next=Encontrar siguiente
 search_text_chkbox_case=Sensible a may\u00FAsculas
 search_text_chkbox_regexp=Expresi\u00F3n regular
 search_text_field=Buscar\:

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=1828540&r1=1828539&r2=1828540&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 
Fri Apr  6 18:30:23 2018
@@ -1033,7 +1033,6 @@ search_search_all_expand=Tout Rechercher
 search_test=Recherche
 search_text_button_close=Fermer
 search_text_button_find=Rechercher
-search_text_button_next=Suivant
 search_text_chkbox_case=Consid\u00E9rer la casse
 search_text_chkbox_regexp=Exp. r\u00E9guli\u00E8re
 search_text_field=Rechercher \:
@@ -1317,9 +1316,11 @@ view_results_render_html_formatted=Code
 view_results_render_json=JSON
 view_results_render_text=Texte brut
 view_results_render_xml=XML
-view_results_request_headers=Ent\u00EAtes de requ\u00EAte \:
+view_results_request_body=Corps de requ\u00EAte
+view_results_request_headers=Ent\u00EAtes de requ\u00EAte
 view_results_response_code=Code de retour \: 
-view_results_response_headers=Ent\u00EAtes de r\u00E9ponse \:
+view_results_response_body=Corps de r\u00E9ponse
+view_results_response_headers=Ent\u00EAtes de r\u00E9ponse
 view_results_response_message=Message de retour \: 
 view_results_response_missing_tika=Manque l'archive tika-app.jar dans le 
classpath. Impossible de convertir en texte ce type de 
document.\nT\u00E9l\u00E9charger le fichier tika-app-x.x.jar depuis 
http\://tika.apache.org/download.html\nPuis ajouter ce fichier dans le 
r\u00E9pertoire <JMeter>/lib
 view_results_response_partial_message=D\u00E9but du message\:

Modified: 
jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/visualizers/RequestViewHTTP.java
URL: 
http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/visualizers/RequestViewHTTP.java?rev=1828540&r1=1828539&r2=1828540&view=diff
==============================================================================
--- 
jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/visualizers/RequestViewHTTP.java
 (original)
+++ 
jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/visualizers/RequestViewHTTP.java
 Fri Apr  6 18:30:23 2018
@@ -150,14 +150,9 @@ public class RequestViewHTTP implements
     @Override
     public void init() {
         paneParsed = new JPanel(new BorderLayout(0, 5));
-        paneParsed.add(createRequestPane());
-        this.searchTextExtension = new SearchTextExtension();
-        this.searchTextExtension.init(paneParsed);
-        JPanel searchPanel = 
this.searchTextExtension.createSearchTextExtensionPane();
-        searchPanel.setBorder(null);
-        this.searchTextExtension.setSearchProvider(new 
RequestViewHttpSearchProvider());
-        searchPanel.setVisible(true);
-        paneParsed.add(searchPanel, BorderLayout.PAGE_END);
+        paneParsed.add(createRequestPane(), BorderLayout.CENTER);
+        this.searchTextExtension = new SearchTextExtension(new 
RequestViewHttpSearchProvider());
+        paneParsed.add(searchTextExtension.getSearchToolBar(), 
BorderLayout.NORTH);
     }
 
     /* (non-Javadoc)

Modified: jmeter/trunk/xdocs/changes.xml
URL: 
http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1828540&r1=1828539&r2=1828540&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml [utf-8] (original)
+++ jmeter/trunk/xdocs/changes.xml [utf-8] Fri Apr  6 18:30:23 2018
@@ -106,6 +106,8 @@ this behaviour, set <code>httpclient.res
 <ul>
     <li><bug>62195</bug>Save Responses to a file : Improve component and UI. 
Contributed by Ubik Load Pack (support at ubikloadpack.com)</li>
     <li><bug>62209</bug>InfluxBackendListenerClient: First Assertion Failure 
Message must be sent if error code and response code are empty or ok</li>
+    <li><bug>62269</bug>Bug 62269 - View Results Tree : Response and Request 
Tabs should contains Header and Body tabs. Contributed by Ubik Load Pack 
(support at ubikloadpack.com)</li>
+    <li><bug>62270</bug>View Results Tree : Allow searching in Request 
headers, Response Headers, and Request body. Contributed by Ubik Load Pack 
(support at ubikloadpack.com)</li>
 </ul>
 
 <h3>Timers, Assertions, Config, Pre- &amp; Post-Processors</h3>


Reply via email to