eclipse / nebula

Nebula Project
https://eclipse.org/nebula
Eclipse Public License 2.0
85 stars 98 forks source link

Bug:-MultiChoice Widget adding Select all as an entry #454

Closed vnairathira closed 2 years ago

vnairathira commented 2 years ago

We are using org.eclipse.nebula.widgets.opal.multichoice.MultiChoice widget and We are using "Select All" functionality to select all or deselect all the checkboxes using setSelectionListener(new MultiChoiceSelectionListener(mcSL). But "Select All" is also added as an entry in text box. When I save this data to database it is an invalid data. please refer attached image. could you please provide a solution to avoid select all as an entry to textbox bug_MultiChoice .

wimjongman commented 2 years ago

Thanks for reporting @vnairathira. Are you able to supply a patch for this?

lcaron commented 2 years ago

Thank you for your report. It is not possible to implement a "select all" function without modifiying the code. We can help you if you decide to provide a patch. Feel free to ask !

lcaron commented 2 years ago

Once the Multichoiceobject is created, you can display the "Select All/Deselect All" links by calling the method setShowSelectUnselectAll(true)

image

vnairathira commented 2 years ago

Thankyou for the update. It really helps our requirement. But when I click on "Select All/Deselect All" list is not updating on Text field. setLabel() needs to be added in selectAllLink.addListener() and deselectAllLink.addListener()

selectAllLink.addListener(SWT.Selection, e -> { changeButtonState(true); setLabel(); }); deselectAllLink.addListener(SWT.Selection, e -> { changeButtonState(false); setLabel(); });

lcaron commented 2 years ago

You're right, I'm gonna fix it tonight and prepare a minor release

lcaron commented 2 years ago

Bug fixed in Nebula 2.7.1, which is (just) released.