Help save net neutrality! Learn more.

#84 "Select none" does not update background color

Matthias K

When clicking "select none", all selected entries
become correctly unselected, the bullet disappears. But
the background color is still set to selected. I think
I have found the error and created a patch, which I
attach to this bug: In the source of "Select none"
model.setAllColorsAndFlags tests for
HIGHTLIGHT_BACKGROUND_COLOR, but of course the correct


  • sky_HALud

    sky_HALud - 2006-03-11

    Logged In: YES

    Thanks for taking your time in reporting this bug.
    Unfortunately I am unable to reproduce it. Could you please
    help me out in this by providing more information?

    Does this bug manifest in any directory or just in some?

    The code in FileTableControl.selectNone() seems correct to
    me because any entry with the HIGHLIGHT_BACKGROUND_COLOR
    backround color gets reset to the TEXT_BACKGROUND_COLOR
    background color, which is the desired behavior.

  • Nobody/Anonymous

    Logged In: NO

    I did some more testing on my Windows XP. The described
    behaviour took place every time I used "Select None". E.g:
    Start JCommander, "Select all", "Select None". Now, on my
    computer, every entry has a blue background, as after
    "Select All". The same in every directory I tested and on an
    Win2000-Laptop. It maybe interesting that "Invert Selection"
    works correctly. But when I use "Select All", "Select None",
    and then invert the selection, the wrong color is inverted
    also, and thus still wrong.

    I reproduced the behaviour with version 0.7 downloaded from about 3 days ago and with a version fetched
    from CVS 2 days ago, which i started from Eclipse.

    But nevertheless, JCommander is a great programm, I am
    already thinking of some improvements.

  • Matthias K

    Matthias K - 2006-03-12

    Logged In: YES

    sorry, that was me.

    I dit not yet fully understand, which colorname
    stands for what function. Because in the code of "Invert
    Selection", the function model.invertColorsAndFlags(...) is
    used, which is declared as

    public void invertColorsAndFlags(Color back1, Color back2,
    Color fore1, Color fore2, String flag1, String flag2){...}

    therefore first the two backgroundcolors, then the two
    foregroundcolors. But it is called in
    FileTableControl.invertSelection() as follows:


    which has the order background, foreground, foreground,
    background. Do I miss some important point?

  • sky_HALud

    sky_HALud - 2006-03-12

    Logged In: YES

    You are quite right in pointing out the semantic problems
    for the invertSelection() method call. Please see the fixed
    semantics in the latest version of the FileTableControl
    (1.84) and the reorganized method in FileControlModel (1.51)
    that I have committed to the CVS.

    That being said, I still cannot reproduce this bug. And this
    makes it even more alarming (hence the increased priority).
    Could you please set up a debug session and try to identify
    some flawed logic so that we can pinpoint the problem's
    origin? If you find anything, just post a comment here and
    we can walk through together in the whole logic.

    Thanks for the words of appreciation on JCommander. Please
    feel free to post your thoughts and ideas to the developers
    ( so
    that we can discuss them in detail, create feature requests
    for them and see how to include those in the development
    roadmap. And, of course, we always welcome new developers to
    the project :-)

  • Matthias K

    Matthias K - 2006-03-12

    Logged In: YES

    Thankyou, I found the corrections in FileTableControl and
    FileTableControlModel. But I think, there are some more
    corrections to make: SELECTION_BACKGROUND_COLOR and
    SELECTION_FOREGROUND_COLOR seems to be exchanged in most
    cases (I found FileTableControl.selectAll,
    FileTableControl.selectNone and

    With these changes I get the correct behaviour, at least as
    far as I can say after some some short tests.


Log in to post a comment.