Bug 573221 - ListSelectionDialog: Improve usability and extend its API

Improve the usability of org.eclipse.ui.dialogs.ListSelectionDialog
(which is used e.g. in the "Save Resources" dialog: see bug 572939) and
extend its API in the following ways:

(a) Enabling/Disabling of the "Select All" and the "Deselect All"
buttons
Actual: Both buttons are always enabled.
Expected:
- When all elements are selected, the "Select All" button should be
disabled, otherwise enabled.
- When no elements are selected, the "Deselect All" button should be
disabled, otherwise enabled.

(b) Extend API
The class is marked as "@noextend This class is not intended to be
subclassed by clients.", but internally, it is extended several times
for different purposes. The goal is that subclassing should no longer be
necessary for customizations, to achieve more consistency and avoid
duplicate code, and to give clients the same capabilities as the dialogs
used internally.
The extended API should provide following additional possibilities via a
fluent API using the builder pattern:
- Dialog title (easier than via setTitle() after creating the dialog)
- OK button label:
  - When nothing is selected: For example, "Launch without Saving"
  - When one or more elements are selected: With {0} as placeholder for
the current selected elements and with {1} for the total number of
elements; for example, "Save {0} of {1} and Launch"
- Whether the dialog can be canceled (via Cancel button or by closing
the dialog window)
- Whether to use SWT#SHEET (modal dialog that is attached to a parent
window)
- Optional checkbox:
  - Label
  - Initial value
The existing constructor should be marked as deprecated in favor of the
new API.

Change-Id: I7a4f548bc41a346685751220e9853ee36df8e344
Signed-off-by: Holger Voormann <eclipse@voormann.de>
Reviewed-on: https://git.eclipse.org/r/c/platform/eclipse.platform.ui/+/179930
Tested-by: Platform Bot <platform-bot@eclipse.org>
Reviewed-by: Lars Vogel <Lars.Vogel@vogella.com>
3 files changed
tree: 11a9a1489ad3cb07279f148bfac25f605159f60b
  1. .mvn/
  2. bundles/
  3. examples/
  4. features/
  5. releng/
  6. tests/
  7. .gitignore
  8. CONTRIBUTING
  9. CONTRIBUTING.md
  10. Jenkinsfile
  11. LICENSE
  12. NOTICE
  13. pom.xml
  14. README.md
README.md

Contributing to Eclipse Platform UI project

Thanks for your interest in this project.

Project description:

Platform UI provides the basic building blocks for user interfaces built with Eclipse.

Some of these form the Eclipse Rich Client Platform (RCP) and can be used for arbitrary rich client applications, while others are specific to the Eclipse IDE. The Platform UI codebase is built on top of the Eclipse Standard Widget Toolkit (SWT), which is developed as an independent project.

Website: http://www.eclipse.org/platform/ui/

For more information, refer to the Platform UI wiki page.

How to contribute:

Contributions to Platform UI are most welcome. There are many ways to contribute, from entering high quality bug reports, to contributing code or documentation changes. For a complete guide, see the Platform UI - How to contribute wiki page page on the team wiki.

Test dependencies

Several test plug-ins have a dependency to the Mockito and Hamcrest libraries. Please install them from the Orbit Download page]3:

Currently the following plug-ins are required:

  • net.bytebuddy.byte-buddy
  • net.bytebuddy.byte-buddy-agent
  • org.hamcrest.core
  • org.mockito
  • org.objenesis

How to build on the command line

You need Maven 3.3.1 installed. After this you can run the build via the following command:

mvn clean verify -Pbuild-individual-bundles

Developer resources:

Information regarding source code management, builds, coding standards, and more.

Contributor License Agreement:

Before your contribution can be accepted by the project, you need to create and electronically sign the Eclipse Foundation Contributor License Agreement (CLA).

Search for bugs:

This project uses Bugzilla to track ongoing development and issues.

Create a new bug:

Be sure to search for existing bugs before you create another one. Remember that contributions are always welcome!

Contact:

Contact the project developers via the project's “dev” list.

License

Eclipse Public License (EPL) 2.0