My favorites | Sign in
Project Logo
                
New issue | Search
for
| Advanced search | Search tips
Issue 152: JListFixture#selectItems(JList, int, int) behavior
2 people starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  wanghy1101
Closed:  Jun 2008
Type-Defect
Priority-Critical
OpSys-All
Milestone-Release1.0
Module-fest-swing


Sign in to add a comment
 
Reported by csaba.juhos, Jun 10, 2008
I'm using version 1.0a1 of the FEST-Swing module.

The implementation for JListFixture#selectItems(JList, int, int) seems to
be wrong.

  public void selectItems(JList list, int start, int end) {
    int shift = VK_SHIFT;
    robot.pressKey(shift);
    for (int i = start; i <= end; i++) selectItem(list, i);
    robot.releaseKey(shift);
  }

The problem is that it selects every single item in the range. Only the
first item should be selected, then the shift key should be pressed, the
last item selected, and finally, the shift key released.

A possible implementation:

  public void selectItems(JList list, int start, int end) {
    int shift = VK_SHIFT;
    selectItem(list, start);
    robot.pressKey(shift);
    selectItem(list, end);
    robot.releaseKey(shift);
  }

I would also like to see a toggleItems with a range argument. See  issue 147 .

Comment 1 by csaba.juhos, Jun 10, 2008
Not only that every single item in the range is selected one-by-one, some additional
items might be selected, specifically, from the last click in the list to the first
item to be selected.

Comment 3 by wanghy1101, Jun 12, 2008
Fixed. Thanks a lot Csabi!

-Yvonne.
Status: Fixed
Comment 4 by csaba.juhos, Jun 14, 2008


:) I'm glad to have helped.

Csabi


Comment 5 by Alex.Ruiz.05, Nov 30, 2008
Set the module as a label, instead of being part of the title.
Summary: JListFixture#selectItems(JList, int, int) behavior
Labels: Module-fest-swing
Sign in to add a comment

Hosted by Google Code