Return-Path: X-Original-To: apmail-jmeter-dev-archive@minotaur.apache.org Delivered-To: apmail-jmeter-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E19FC19E74 for ; Sat, 12 Mar 2016 22:32:01 +0000 (UTC) Received: (qmail 73339 invoked by uid 500); 12 Mar 2016 22:32:01 -0000 Delivered-To: apmail-jmeter-dev-archive@jmeter.apache.org Received: (qmail 73310 invoked by uid 500); 12 Mar 2016 22:32:01 -0000 Mailing-List: contact dev-help@jmeter.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jmeter.apache.org Delivered-To: mailing list dev@jmeter.apache.org Received: (qmail 73298 invoked by uid 99); 12 Mar 2016 22:32:01 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 12 Mar 2016 22:32:01 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id E0B531A080D for ; Sat, 12 Mar 2016 22:32:00 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.198 X-Spam-Level: * X-Spam-Status: No, score=1.198 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id Hb3aAH7qYAf3 for ; Sat, 12 Mar 2016 22:31:58 +0000 (UTC) Received: from mail-qg0-f53.google.com (mail-qg0-f53.google.com [209.85.192.53]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 77BC15F5CC for ; Sat, 12 Mar 2016 22:31:58 +0000 (UTC) Received: by mail-qg0-f53.google.com with SMTP id t4so126466308qge.0 for ; Sat, 12 Mar 2016 14:31:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to; bh=mAAh80aZhf4qfOhmC+2Jg41v0HNNa+QbAGrxdAKXdSI=; b=edrUsHuZz2gK/unG+DFguGQW8TJ7ByT5R9GTwC7nm9j3oUhdpc/LbdcSr3ycfRke6+ yKeTbItUd64pEiLOGwWhhKfPqC7b0cEb2u16Y4XTSfF4BGurAvdxPzA8vOtVhQutp9rt 7a/IOK8BDjWk7eHtR3Nwvbsw+KOq6WIHu9hMsJsOrdQg1IXlXKaUxPrgdFiFqYMnbT3r O2Yx+EoUDq0MkNxYupq7t/J/5kho2qhdDnC2y7rrEJEly0BWXlJfPyun27/9Al0X9OYN uB6goNu8SbCm84vBsy8t1HC4s8P3nP27bniZ4GqUIqprLC3+/aBcVnIaZ4mW6MTVwoMC lvtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to; bh=mAAh80aZhf4qfOhmC+2Jg41v0HNNa+QbAGrxdAKXdSI=; b=TPRgHZuGFoMkpTZEFaA6zPCkYkel4nUbnrJAHmemx/9bHla4u1ZlQeMXMGi1DqYyPW qUY0cePM2BCv/D4fHlQs7ixHArn+XHpsZ4MomZe5qxFu9eNoQfoaYcanQb52PQqBPahE /QTOgZ8upEv/XEfbEKnZbjb8n59g2zk8DTlNX2R7xc1JoyfFtLXFAuf4JiJCYJVUA5yn ejWwdVr6YJL3jVrqi2pkXogdiaUbWZtzcEVlgs3bt3Za1my6rc1wFwFpsdu3ync/Tdly YLcauOVXu85zioJc82zK+3ScSFMPmjfaaxnGgftvDqQdAzN5TT76+4aJGn9bE8zfBHjF 2b6Q== X-Gm-Message-State: AD7BkJKoZQuRu8u2yXCLTcq8vFkKfgejcGWL474W4aVLc3p4XVm5pyF8FcWTrSBuFWKsd64b/pinWvLFqKl9FA== MIME-Version: 1.0 X-Received: by 10.140.93.84 with SMTP id c78mr20554804qge.101.1457821917873; Sat, 12 Mar 2016 14:31:57 -0800 (PST) Received: by 10.55.116.65 with HTTP; Sat, 12 Mar 2016 14:31:57 -0800 (PST) In-Reply-To: References: <20160312213742.AA5023A043C@svn01-us-west.apache.org> Date: Sat, 12 Mar 2016 23:31:57 +0100 Message-ID: Subject: Re: svn commit: r1734740 - /jmeter/trunk/src/core/org/apache/jmeter/gui/SavePropertyDialog.java From: Philippe Mouawad To: "dev@jmeter.apache.org" Content-Type: multipart/alternative; boundary=001a1139bf968f8ef3052de19d8a --001a1139bf968f8ef3052de19d8a Content-Type: text/plain; charset=UTF-8 On Sat, Mar 12, 2016 at 11:30 PM, sebb wrote: > On 12 March 2016 at 21:53, Philippe Mouawad > wrote: > > Hi, > > I commented before the bugzilla comment so ok :-) > > I also commented the patch to which you replied. > > Both in the log message and in the code. > > I'm not sure what more I could have done. > Nothing more, I failed to read the comment. It is ok for me > > > Regards > > > > > > On Sat, Mar 12, 2016 at 10:48 PM, sebb wrote: > > > >> On 12 March 2016 at 21:41, Philippe Mouawad > > >> wrote: > >> > Hello, > >> > -1 for a new property saveconfig.sort > >> > >> Please read the bug and the patch. > >> The sortOrder field is temporary. > >> > >> > Let's decide of a sort order and impose it. > >> > >> +1 > >> > >> > Regards > >> > > >> > On Sat, Mar 12, 2016 at 10:37 PM, wrote: > >> > > >> >> Author: sebb > >> >> Date: Sat Mar 12 21:37:42 2016 > >> >> New Revision: 1734740 > >> >> > >> >> URL: http://svn.apache.org/viewvc?rev=1734740&view=rev > >> >> Log: > >> >> Sample Result SaveConfig Dialog is generated in random order > >> >> TODO - remove the test code when the sort order is decided > >> >> Bugzilla Id: 59171 > >> >> > >> >> Modified: > >> >> > jmeter/trunk/src/core/org/apache/jmeter/gui/SavePropertyDialog.java > >> >> > >> >> Modified: > >> >> jmeter/trunk/src/core/org/apache/jmeter/gui/SavePropertyDialog.java > >> >> URL: > >> >> > >> > http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/gui/SavePropertyDialog.java?rev=1734740&r1=1734739&r2=1734740&view=diff > >> >> > >> >> > >> > ============================================================================== > >> >> --- > jmeter/trunk/src/core/org/apache/jmeter/gui/SavePropertyDialog.java > >> >> (original) > >> >> +++ > jmeter/trunk/src/core/org/apache/jmeter/gui/SavePropertyDialog.java > >> >> Sat Mar 12 21:37:42 2016 > >> >> @@ -28,7 +28,11 @@ import java.awt.event.ActionEvent; > >> >> import java.awt.event.ActionListener; > >> >> import java.lang.reflect.InvocationTargetException; > >> >> import java.lang.reflect.Method; > >> >> +import java.util.ArrayList; > >> >> +import java.util.Collections; > >> >> +import java.util.Comparator; > >> >> import java.util.HashMap; > >> >> +import java.util.List; > >> >> import java.util.Map; > >> >> > >> >> import javax.swing.JButton; > >> >> @@ -98,6 +102,7 @@ public class SavePropertyDialog extends > >> >> int x = (countMethods(methods) / 3) + 1; > >> >> log.debug("grid panel is " + 3 + " by " + x); > >> >> JPanel checkPanel = new JPanel(new GridLayout(x, 3)); > >> >> + List checks = new ArrayList<>(); > >> >> for (Method method : methods) { > >> >> String name = method.getName(); > >> >> if (name.startsWith(NAME_SAVE_PFX) && > >> >> method.getParameterTypes().length == 0) { > >> >> @@ -106,7 +111,7 @@ public class SavePropertyDialog extends > >> >> JCheckBox check = new JCheckBox( > >> >> > JMeterUtils.getResString(RESOURCE_PREFIX + > >> >> name), > >> >> ((Boolean) method.invoke(saveConfig, new > >> >> Object[0])).booleanValue()); > >> >> - checkPanel.add(check, BorderLayout.NORTH); > >> >> + checks.add(check); > >> >> check.addActionListener(this); > >> >> String actionCommand = NAME_SET_PREFIX + name; > // > >> >> $NON-NLS-1$ > >> >> check.setActionCommand(actionCommand); > >> >> @@ -118,6 +123,22 @@ public class SavePropertyDialog extends > >> >> } > >> >> } > >> >> } > >> >> + // sortOrder is a temporary hack to allow easy testing of > sort > >> >> alternatives (Bug 59171) > >> >> + final String sortOrder = > >> >> JMeterUtils.getPropDefault("saveconfig.sort", ""); > >> >> + if (sortOrder.length() > 0) { > >> >> + Collections.sort(checks, new Comparator(){ > >> >> + @Override > >> >> + public int compare(JCheckBox o1, JCheckBox o2) { > >> >> + if ("text".equals(sortOrder)) { > >> >> + return > >> >> o1.getText().compareToIgnoreCase(o2.getText()); // depends on > language > >> >> + } else { > >> >> + return > >> >> o1.getActionCommand().compareToIgnoreCase(o2.getActionCommand()); // > >> >> propName > >> >> + } > >> >> + }}); > >> >> + } > >> >> + for(JCheckBox check : checks) { > >> >> + checkPanel.add(check, BorderLayout.NORTH); > >> >> + } > >> >> getContentPane().add(checkPanel, BorderLayout.NORTH); > >> >> JButton exit = new > JButton(JMeterUtils.getResString("done")); > >> // > >> >> $NON-NLS-1$ > >> >> this.getContentPane().add(exit, BorderLayout.SOUTH); > >> >> > >> >> > >> >> > >> > > >> > > >> > -- > >> > Cordialement. > >> > Philippe Mouawad. > >> > > > > > > > > -- > > Cordialement. > > Philippe Mouawad. > -- Cordialement. Philippe Mouawad. --001a1139bf968f8ef3052de19d8a--