benjamin84 / fest

Automatically exported from code.google.com/p/fest
0 stars 0 forks source link

JListFixture#selectItems(JList, int, int) behavior #152

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
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.

Original issue reported on code.google.com by csaba.ju...@gmail.com on 10 Jun 2008 at 2:24

GoogleCodeExporter commented 9 years ago
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.

Original comment by csaba.ju...@gmail.com on 10 Jun 2008 at 2:26

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Fixed. Thanks a lot Csabi!

-Yvonne.

Original comment by wanghy1...@gmail.com on 13 Jun 2008 at 4:03

GoogleCodeExporter commented 9 years ago

:) I'm glad to have helped.

Csabi

Original comment by csaba.ju...@gmail.com on 14 Jun 2008 at 7:07

GoogleCodeExporter commented 9 years ago
Set the module as a label, instead of being part of the title.

Original comment by Alex.Rui...@gmail.com on 1 Dec 2008 at 2:02