On 18 October 2010 00:07, Milamber <milam...@apache.org> wrote:

>  Hello,
>
> With last commit (r1023592) it's possible to add this behavior on Arguments
> Panel (in HTTP sampler and Java sampler):
> * When user double click in the table on a cell which has a String value,
> JMeter display a text box to edit the value.
>
> It's more user-friendly for a long parameter value (like SOAP parameter, or
> values from dev web framework (spring, struts, etc))
>
> But, this new functionality will remove the default behavior : actually a
> double click on cell allows inline editing (directly in cell). Now if you
> want a edit directly on cell, you must use F2 key.
>
>
I tried the patch, and it's still possible to edit the text by clicking in
the box - one does not have to use F2.


> I think that this text box functionality is good, and improve JMeter. What
> is your opinion ?
>

Yes, definitely better for editting larger amounts of data.
However, at present it's a bit confusing, as the pop-up accepts new lines,
but these are dropped when the value is saved.
For fields that don't allow multiple lines, it would be better if the popup
only displayed a single line

Also it might be useful if <escape> acted as a cancel button.


> (I have attached the patch (only 1 new line) to ArgumentsPanel if you want
> test)
>
> Thanks
>
> Milamber
>
>
>
> -------- Original Message --------  Subject: svn commit: r1023592 -
> /jakarta/jmeter/trunk/src/core/org/apache/jmeter/gui/util/TextBoxDialoger.java
>   Date:
> Sun, 17 Oct 2010 22:36:36 -0000  From: milam...@apache.org  Reply-To:
> dev@jakarta.apache.org  To: notificati...@jakarta.apache.org
>
>
> Author: milamber
> Date: Sun Oct 17 22:36:35 2010
> New Revision: 1023592
>
> URL: http://svn.apache.org/viewvc?rev=1023592&view=rev
> Log:
> Adding a new inner class to allow display a text box to edit cell content in 
> Jtable (futur use in ArgumentsPanel)
>
> Modified:
>     
> jakarta/jmeter/trunk/src/core/org/apache/jmeter/gui/util/TextBoxDialoger.java
>
> Modified: 
> jakarta/jmeter/trunk/src/core/org/apache/jmeter/gui/util/TextBoxDialoger.java
> URL: 
> http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/core/org/apache/jmeter/gui/util/TextBoxDialoger.java?rev=1023592&r1=1023591&r2=1023592&view=diff
> ==============================================================================
> --- 
> jakarta/jmeter/trunk/src/core/org/apache/jmeter/gui/util/TextBoxDialoger.java 
> (original)
> +++ 
> jakarta/jmeter/trunk/src/core/org/apache/jmeter/gui/util/TextBoxDialoger.java 
> Sun Oct 17 22:36:35 2010
> @@ -86,8 +86,8 @@ public class TextBoxDialoger implements
>       * @param editable - allow to modify text
>       */
>      public TextBoxDialoger(String text, boolean editable) {
> -        init(text);
>          this.editable = editable;
> +        init(text);
>      }
>
>      private void init(String text) {
> @@ -191,5 +191,36 @@ public class TextBoxDialoger implements
>          }
>      }
>
> +    /**
> +     * Class to edit in a dialog box the cell's content
> +     * when double (pressed) click on a table's cell which is editable
> +     *
> +     */
> +    public static class TextBoxDoubleClickPressed extends MouseAdapter {
> +
> +        private JTable table = null;
> +
> +        public TextBoxDoubleClickPressed(JTable table) {
> +            super();
> +            this.table = table;
> +        }
> +
> +        @Override
> +        public void mousePressed(MouseEvent e) {
> +            if (e.getClickCount() == 2) { // double (pressed) click
> +                TableModel tm = table.getModel();
> +                Object value = tm.getValueAt(table.getSelectedRow(), 
> table.getSelectedColumn());
> +                if (value instanceof String) {
> +                    if (table.getCellEditor() != null) {
> +                        table.getCellEditor().cancelCellEditing(); // in 
> main table (evt mousePressed because cell is editable)
> +                    }
> +                    TextBoxDialoger tbd = new 
> TextBoxDialoger(value.toString(), true);
> +                    tm.setValueAt(tbd.getTextBox(), table.getSelectedRow(), 
> table.getSelectedColumn());
> +                } // else do nothing (cell isn't a string to edit)
> +            }
> +        }
> +
> +    }
> +
>
>  }
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: notifications-unsubscr...@jakarta.apache.org
> For additional commands, e-mail: notifications-h...@jakarta.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@jakarta.apache.org
> For additional commands, e-mail: dev-h...@jakarta.apache.org
>

Reply via email to