You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@jmeter.apache.org by bu...@apache.org on 2012/12/05 17:34:29 UTC

[Bug 54251] New: Add tristate checkbox implementation

https://issues.apache.org/bugzilla/show_bug.cgi?id=54251

            Bug ID: 54251
           Summary: Add tristate checkbox implementation
           Product: JMeter
           Version: unspecified
          Hardware: PC
                OS: Windows XP
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Main
          Assignee: issues@jmeter.apache.org
          Reporter: sebb@apache.org
    Classification: Unclassified

A tri-state checkbox would have three states:
- unselected
- selected
- indeterminate (i.e. neither)

The indeterminate state would be useful for handling defaults - e.g. if the
sampler checkbox is indeterminate, use the setting from the configuration.

There don't seem to be any existing implementations with a suitable license.

The following implementation is neat and simple:

[1] http://stackoverflow.com/questions/1263323/tristate-checkboxes-in-java

However, testing shows that it does not support ItemListener properly, as the
processing causes an additional item change. It also relies on its
ActionListener being processed first.

However, it does provide a useful hint - using a icon for the indeterminate
state.

Another implementation is at

[2] http://www.javaspecialists.eu/archive/Issue145.html

This works well, however the indeterminate state is not very obvious on the
display, particularly in the Motif LAF.

Another TriState implementation is here:

[3] http://www.coderanch.com/t/342563/GUI/java/TriState-CheckBox

It does not support ActionListener, however it does have a useful Icon
implementation which can be used to improve implementation [2].

Code and test case will be added shortly.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 54251] Add tristate checkbox implementation

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54251

--- Comment #13 from Sebb <se...@apache.org> ---
This should fix the compilation issues:

URL: http://svn.apache.org/viewvc?rev=1418045&view=rev
Log:
Fix up so does not use private Sun class; we get the icon size from the
UIManager defaults
Also change from cross to horizontal line
Bugzilla Id: 54251

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/gui/util/TristateCheckBox.java


Also changed the icon to a horizontal bar.
This is what GMail uses when some (but not all) mails in a list are selected,
so hopefully would be more obvious / less confusing than a cross.

Also, the code should now pick up the actual icon size, even if it varies from
the default.

Not yet sure if we need to allow for LAF changes or whether those will be
handled by recreating the relevant classes.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 54251] Add tristate checkbox implementation

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54251

--- Comment #4 from Sebb <se...@apache.org> ---
Created attachment 29715
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=29715&action=edit
WinXP Java 6 disabled

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 54251] Add tristate checkbox implementation

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54251

--- Comment #3 from Kurt Hong <ku...@uangel.com> ---
Created attachment 29714
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=29714&action=edit
TristateCheckBoxTest - Win7/Java7(with javax.swing.plaf.synth.SynthUI)

looks good for me except Nimbus. But it's using javax.swing.plaf.synth.SynthUI.

Thank you!

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 54251] Add tristate checkbox implementation

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54251

--- Comment #16 from Philippe Mouawad <p....@ubik-ingenierie.com> ---
Created attachment 29725
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=29725&action=edit
Mac OSX look

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 54251] Add tristate checkbox implementation

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54251

Philippe Mouawad <p....@ubik-ingenierie.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Hardware|PC                          |All
            Version|unspecified                 |2.8
                 OS|Windows XP                  |All

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 54251] Add tristate checkbox implementation

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54251

--- Comment #10 from Sebb <se...@apache.org> ---
Created attachment 29720
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=29720&action=edit
WinXP Java 6 enabled (icon/original) - Bar

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 54251] Add tristate checkbox implementation

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54251

--- Comment #9 from Sebb <se...@apache.org> ---
URL: http://svn.apache.org/viewvc?rev=1417803&view=rev
Log:
Fix up so Nimbus calls paint when disabling the button
Bugzilla Id: 54251

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/gui/util/TristateCheckBox.java

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 54251] Add tristate checkbox implementation

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54251

--- Comment #21 from Sebb <se...@apache.org> ---
(In reply to comment #14)
> Created attachment 29723 [details]
> Current in linux

The left shift is odd, because the code uses the supplied x,y coordinates.
Maybe a bug in the JVM? Also, the unix Nimbus look is very different from MacOS
and Windows.

It would be nice to fix these problems, but I don't think they are
show-stoppers.
If necessary they can be fixed later.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 54251] Add tristate checkbox implementation

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54251

--- Comment #12 from Sebb <se...@apache.org> ---
Created attachment 29722
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=29722&action=edit
WinXP Java 6 enabled (icon/original) - Bar

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 54251] Add tristate checkbox implementation

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54251

Philippe Mouawad <p....@ubik-ingenierie.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 54251] Add tristate checkbox implementation

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54251

Sebb <se...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #29716|0                           |1
        is obsolete|                            |

--- Comment #7 from Sebb <se...@apache.org> ---
Created attachment 29718
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=29718&action=edit
WinXP Java 6 enabled (icon/original)

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 54251] Add tristate checkbox implementation

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54251

Sebb <se...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #29720|0                           |1
        is obsolete|                            |

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 54251] Add tristate checkbox implementation

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54251

--- Comment #18 from Philippe Mouawad <p....@ubik-ingenierie.com> ---
Created attachment 29726
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=29726&action=edit
MacOs Underterminate

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 54251] Add tristate checkbox implementation

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54251

Sebb <se...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #29715|0                           |1
        is obsolete|                            |

--- Comment #6 from Sebb <se...@apache.org> ---
Created attachment 29717
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=29717&action=edit
WinXP Java 6 disabled (icon/original)

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 54251] Add tristate checkbox implementation

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54251

--- Comment #14 from Milamber <mi...@apache.org> ---
Created attachment 29723
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=29723&action=edit
Current in linux

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 54251] Add tristate checkbox implementation

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54251

--- Comment #20 from Sebb <se...@apache.org> ---
(In reply to comment #17)
> Under MacOS X:
> - icon look is clear 
> - but "Tristate checkbox (original)" is not. There is no real difference
> between indeterminate and checked.

That is also the case for WinXP, which is why the icon solution attracted my
attention.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 54251] Add tristate checkbox implementation

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54251

--- Comment #5 from Sebb <se...@apache.org> ---
Created attachment 29716
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=29716&action=edit
WinXP Java 6 enabled

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 54251] Add tristate checkbox implementation

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54251

--- Comment #1 from Sebb <se...@apache.org> ---
Added initial implementation.

It needs a bit of work on the Nimbus UI.

Please try running 

test/src/org/apache/jmeter/gui/util/TristateCheckBoxTest.java

to see what how the UI behaves.


URL: http://svn.apache.org/viewvc?rev=1417726&view=rev
Log:
Add tristate checkbox implementation
Bugzilla Id: 54251

Added:
    jmeter/trunk/src/core/org/apache/jmeter/gui/util/TristateCheckBox.java  
(with props)
    jmeter/trunk/src/core/org/apache/jmeter/gui/util/TristateState.java   (with
props)
    jmeter/trunk/test/src/org/apache/jmeter/gui/util/TristateCheckBoxTest.java 
 (with props)
Modified:
    jmeter/trunk/xdocs/changes.xml

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 54251] Add tristate checkbox implementation

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54251

--- Comment #8 from Sebb <se...@apache.org> ---
Show how original design (no special icon) looked.

URL: http://svn.apache.org/viewvc?rev=1417789&view=rev
Log:
Add tests for original code - which did not use a special icon - for comparison
Bugzilla Id: 54251

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/gui/util/TristateCheckBox.java
    jmeter/trunk/test/src/org/apache/jmeter/gui/util/TristateCheckBoxTest.java

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 54251] Add tristate checkbox implementation

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54251

--- Comment #2 from Milamber <mi...@apache.org> ---
Created attachment 29713
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=29713&action=edit
Sample screenshot in Linux env

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 54251] Add tristate checkbox implementation

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54251

--- Comment #11 from Sebb <se...@apache.org> ---
Created attachment 29721
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=29721&action=edit
WinXP Java 6 disabled (icon/original) - Bar

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 54251] Add tristate checkbox implementation

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54251

Philippe Mouawad <p....@ubik-ingenierie.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |p.mouawad@ubik-ingenierie.c
                   |                            |om

--- Comment #17 from Philippe Mouawad <p....@ubik-ingenierie.com> ---
Under MacOS X:
- icon look is clear 
- but "Tristate checkbox (original)" is not. There is no real difference
between indeterminate and checked.

Thank you sebb.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 54251] Add tristate checkbox implementation

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54251

--- Comment #15 from Milamber <mi...@apache.org> ---
Created attachment 29724
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=29724&action=edit
round third state

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 54251] Add tristate checkbox implementation

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54251

--- Comment #19 from Philippe Mouawad <p....@ubik-ingenierie.com> ---
Created attachment 29727
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=29727&action=edit
enabled

-- 
You are receiving this mail because:
You are the assignee for the bug.