How to create a dialog with checkboxes that allows multiple selections

mor222

Having read this link, I want to create a dialog where I can select multiple items which to be in the form of check boxes. ElementListSelectionDialog doesn't show any elements in the dialog.

final ElementListSelectionDialog dialog = new     ElementListSelectionDialog(PlatformUI.getWorkbench().getDisplay().getActiveShell(), new LabelProvider());
dialog.setElements(new String[] { "1", "2", "3" });
dialog.setTitle("Numbers");
dialog.setMultipleSelection(true);
dialog.setInitialSelections(new String[] { "1", "2", "3" });
dialog.open();

Using the code above, I get the items in the dialog sometimes, but there are two problems:

  1. I only get them sometimes
  2. It is not in the form of checkboxes.

If you know a better way of doing this, please let me know. I really appreciate any help :)

greg-449

ElementListSelectionDialog does not support check box selection.

You may be able to use org.eclipse.ui.dialogs.ListSelectionDialog:

String [] elements = ...

ListSelectionDialog dialog = 
   new ListSelectionDialog(shell, elements, ArrayContentProvider.getInstance(),
            new LabelProvider(), "selection message");

dialog.setTitle("dialog title");

dialog.setInitialSelections(new Object []{....selections});

dialog.open();

Object [] result = dialog.getResult();

or you can always write your own dialog using CheckboxTableViewer.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to create a dialog with checkboxes that allows multiple selections

From Dev

How to create a dialog like component that allows drop other controls inside it?

From Dev

How to show alert dialog when multiple checkboxes are checked

From Dev

Create multiple Checkboxes with JavaScript

From Dev

How to target multiple selections with xclip

From Dev

How to avoid Multiple Jbutton selections

From Dev

How to save multiple button selections?

From Dev

How to create multiple checkboxes grouped by fieldsets in Cakephp 3

From Dev

How to create a custom pipe for filtering with multiple checkboxes? Angular 4

From Dev

How to create a list of checkboxes

From Dev

How to validate multiple checkboxes

From Dev

How to select multiple lines for non matching selections?

From Dev

How to choose and save multiple selections in a tableview

From Dev

How to create a dialog to select multiple files using winapi?

From Dev

Java Threads: How to find the right place in code to create a new thread for a program that allows multiple clients to connect to the server

From Dev

How to check multiple checkboxes with JavaScript?

From Dev

How to use multiple checkboxes in jmeter?

From Dev

how to manage multiple checkboxes in ember?

From Dev

How to create a backdrop for a dialog?

From Dev

Bash - How to make each menu selections in 1 line instead of multiple selections in 1 line

From Dev

How to Show or Hide multiple divs with multiple checkboxes

From Dev

How do I allow for multiple selections in a numbered menu?

From Dev

How to implement a comment feature that works with multiple selections in QScintilla?

From Dev

How can I concatenate multiple clipboard selections in Quicksilver?

From Dev

how to pass accurate multiple selections data using ui-selectable

From Dev

How do I allow for multiple selections in a numbered menu?

From Dev

How to use multiple selections from VBA Userform Multiselect Listbox in path

From Dev

Angular Material Checkboxes and bulk selections with custom datasource

From Dev

How to get data from textview and checkboxes from dialog?

Related Related

  1. 1

    How to create a dialog with checkboxes that allows multiple selections

  2. 2

    How to create a dialog like component that allows drop other controls inside it?

  3. 3

    How to show alert dialog when multiple checkboxes are checked

  4. 4

    Create multiple Checkboxes with JavaScript

  5. 5

    How to target multiple selections with xclip

  6. 6

    How to avoid Multiple Jbutton selections

  7. 7

    How to save multiple button selections?

  8. 8

    How to create multiple checkboxes grouped by fieldsets in Cakephp 3

  9. 9

    How to create a custom pipe for filtering with multiple checkboxes? Angular 4

  10. 10

    How to create a list of checkboxes

  11. 11

    How to validate multiple checkboxes

  12. 12

    How to select multiple lines for non matching selections?

  13. 13

    How to choose and save multiple selections in a tableview

  14. 14

    How to create a dialog to select multiple files using winapi?

  15. 15

    Java Threads: How to find the right place in code to create a new thread for a program that allows multiple clients to connect to the server

  16. 16

    How to check multiple checkboxes with JavaScript?

  17. 17

    How to use multiple checkboxes in jmeter?

  18. 18

    how to manage multiple checkboxes in ember?

  19. 19

    How to create a backdrop for a dialog?

  20. 20

    Bash - How to make each menu selections in 1 line instead of multiple selections in 1 line

  21. 21

    How to Show or Hide multiple divs with multiple checkboxes

  22. 22

    How do I allow for multiple selections in a numbered menu?

  23. 23

    How to implement a comment feature that works with multiple selections in QScintilla?

  24. 24

    How can I concatenate multiple clipboard selections in Quicksilver?

  25. 25

    how to pass accurate multiple selections data using ui-selectable

  26. 26

    How do I allow for multiple selections in a numbered menu?

  27. 27

    How to use multiple selections from VBA Userform Multiselect Listbox in path

  28. 28

    Angular Material Checkboxes and bulk selections with custom datasource

  29. 29

    How to get data from textview and checkboxes from dialog?

HotTag

Archive