You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by pm...@apache.org on 2017/12/07 22:07:49 UTC

svn commit: r1817429 - in /jmeter/trunk/src/core/org/apache/jmeter: gui/action/ActionNames.java gui/action/OpenLinkAction.java gui/util/JMeterMenuBar.java resources/messages.properties resources/messages_fr.properties

Author: pmouawad
Date: Thu Dec  7 22:07:49 2017
New Revision: 1817429

URL: http://svn.apache.org/viewvc?rev=1817429&view=rev
Log:
Bug 61785 : Add Help >Useful links  to create issues and download nightly build
Bugzilla Id: 61785

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/gui/action/ActionNames.java
    jmeter/trunk/src/core/org/apache/jmeter/gui/action/OpenLinkAction.java
    jmeter/trunk/src/core/org/apache/jmeter/gui/util/JMeterMenuBar.java
    jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties
    jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties

Modified: jmeter/trunk/src/core/org/apache/jmeter/gui/action/ActionNames.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/gui/action/ActionNames.java?rev=1817429&r1=1817428&r2=1817429&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/gui/action/ActionNames.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/gui/action/ActionNames.java Thu Dec  7 22:07:49 2017
@@ -61,6 +61,7 @@ public final class ActionNames {
     public static final String HEAP_DUMP        = "heap_dump"; // $NON-NLS-1$
     public static final String LAF_PREFIX       = "laf:"; // Look and Feel prefix
     public static final String LINK_BUG_TRACKER = "link_bug_tracker:"; // URI of bug tracker
+    public static final String LINK_COMP_REF    = "link_component_reference:"; // URI of nightly build
     public static final String LINK_NIGHTLY_BUILD = "link_nightly_build:"; // URI of nightly build
     public static final String LINK_RELEASE_NOTES = "link_release_notes"; // URI of the release note
     public static final String LOGGER_PANEL_ENABLE_DISABLE     = "logger_panel_enable_disable"; // $NON-NLS-1$

Modified: jmeter/trunk/src/core/org/apache/jmeter/gui/action/OpenLinkAction.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/gui/action/OpenLinkAction.java?rev=1817429&r1=1817428&r2=1817429&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/gui/action/OpenLinkAction.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/gui/action/OpenLinkAction.java Thu Dec  7 22:07:49 2017
@@ -20,7 +20,9 @@ package org.apache.jmeter.gui.action;
 
 import java.awt.event.ActionEvent;
 import java.io.IOException;
+import java.util.HashMap;
 import java.util.HashSet;
+import java.util.Map;
 import java.util.Set;
 
 import org.slf4j.Logger;
@@ -29,30 +31,36 @@ import org.slf4j.LoggerFactory;
 public class OpenLinkAction extends AbstractAction {
 
     private static final Logger log = LoggerFactory.getLogger(OpenLinkAction.class);
+    
+    private static final Map<String, String> LINK_MAP = 
+            initLinkMap();
 
     private static final Set<String> commands = new HashSet<>();
 
     static {
         commands.add(ActionNames.LINK_BUG_TRACKER);
+        commands.add(ActionNames.LINK_COMP_REF);
         commands.add(ActionNames.LINK_NIGHTLY_BUILD);
         commands.add(ActionNames.LINK_RELEASE_NOTES);
     }
 
+    private static final Map<String, String> initLinkMap() {
+        Map<String, String> map = new HashMap<>(4);
+        map.put(ActionNames.LINK_BUG_TRACKER, "https://jmeter.apache.org/issues.html");
+        map.put(ActionNames.LINK_COMP_REF, "https://jmeter.apache.org/usermanual/component_reference.html");
+        map.put(ActionNames.LINK_NIGHTLY_BUILD, "https://jmeter.apache.org/nightly.html");
+        map.put(ActionNames.LINK_RELEASE_NOTES, "https://jmeter.apache.org/changes.html");
+        return map;
+    }
     /**
      * @see org.apache.jmeter.gui.action.Command#doAction(ActionEvent)
      */
     @Override
     public void doAction(ActionEvent e) {
-        String url;
-        if (e.getActionCommand().equals(ActionNames.LINK_BUG_TRACKER)) {
-            url = "https://jmeter.apache.org/issues.html";
-        } else if (e.getActionCommand().equals(ActionNames.LINK_NIGHTLY_BUILD)) {
-            url = "https://jmeter.apache.org/nightly.html";
-        } else if (e.getActionCommand().equals(ActionNames.LINK_RELEASE_NOTES)) {
-            url = "https://jmeter.apache.org/changes.html";
-        } else {
+        String url = LINK_MAP.get(e.getActionCommand());
+        if(url == null) {
             log.warn("Action {} not handled by this class", e.getActionCommand());
-            return;
+            return; 
         }
         try {
             java.awt.Desktop.getDesktop().browse(java.net.URI.create(url));

Modified: jmeter/trunk/src/core/org/apache/jmeter/gui/util/JMeterMenuBar.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/gui/util/JMeterMenuBar.java?rev=1817429&r1=1817428&r2=1817429&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/gui/util/JMeterMenuBar.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/gui/util/JMeterMenuBar.java Thu Dec  7 22:07:49 2017
@@ -247,6 +247,7 @@ public class JMeterMenuBar extends JMenu
         
         JMenu usefulLinks = makeMenuRes("useful_links");//$NON-NLS-1$
         usefulLinks.add(makeMenuItemRes("link_bug_tracker", ActionNames.LINK_BUG_TRACKER));
+        usefulLinks.add(makeMenuItemRes("link_comp_ref", ActionNames.LINK_COMP_REF));
         usefulLinks.add(makeMenuItemRes("link_nightly_build", ActionNames.LINK_NIGHTLY_BUILD));
 
         JMenuItem helpAbout = makeMenuItemRes("about", 'A', ActionNames.ABOUT);

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=1817429&r1=1817428&r2=1817429&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties Thu Dec  7 22:07:49 2017
@@ -618,6 +618,7 @@ ldapext_sample_title=LDAP Extended Reque
 ldapext_testing_title=LDAP Extended Request
 library=Library
 link_bug_tracker=Create an issue
+link_comp_ref=Component Reference Documentation
 link_nightly_build=Nightly builds
 load=Load
 locale_format=String format of a locale (ex\: fr_FR , en_EN) (optional)

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=1817429&r1=1817428&r2=1817429&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 Thu Dec  7 22:07:49 2017
@@ -608,6 +608,7 @@ ldapext_sample_title=Requ\u00EAte LDAP \
 ldapext_testing_title=Requ\u00EAte LDAP \u00E9tendue
 library=Librairie
 link_bug_tracker=Cr\u00E9er un ticket
+link_comp_ref=R\u00e9f\u00e9rence des composants 
 link_nightly_build=Versions de d\u00E9veloppement
 load=Charger
 locale_format=Text representant la langue et le pays (ex\: fr_FR , en_EN) (optionnel)