Package org.eclipse.ui.dialogs
Class ListSelectionDialog.Builder
java.lang.Object
org.eclipse.ui.dialogs.ListSelectionDialog.Builder
- Enclosing class:
- ListSelectionDialog
The Builder to create
ListSelectionDialog
instances. It has a fluent
API (every method returns the same builder instance).- Since:
- 3.123
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionasSheet
(boolean asSheet) Sets whether to show the dialog as sheet.canCancel
(boolean canCancel) Sets whether the dialog can be canceled.checkboxText
(String checkboxText) Sets the label of the optional check box.checkboxValue
(boolean checkboxValue) Sets the selection state of the optional check box.contentProvider
(IStructuredContentProvider contentProvider) Sets the content provider.Creates and assembles the dialog.labelProvider
(ILabelProvider labelProvider) Sets the label provider.Sets the message.okButtonText
(String text) Sets the OK button label.Sets the OK button label that will be displayed when no item is selected; otherwise the label ofokButtonText(String)
will be displayed.Sets the initial selection to the given elements.Sets the title for this dialog.
-
Method Details
-
contentProvider
Sets the content provider.When this method is not called or when set to
null
,ArrayContentProvider
will be used.- Parameters:
contentProvider
- the content provider for navigating the model- Returns:
- this
-
labelProvider
Sets the label provider.When this method is not called or when set to
null
,LabelProvider
will be used.- Parameters:
labelProvider
- the label provider for displaying model elements- Returns:
- this
-
preselect
Sets the initial selection to the given elements.When this method is not called, no element will be preselected.
- Parameters:
initialSelections
- the array of elements to preselect- Returns:
- this
- See Also:
-
title
Sets the title for this dialog.When this method is not called or when set to
null
,WorkbenchMessages.ListSelection_title
will be used as dialog title.- Parameters:
title
- the title- Returns:
- this
- See Also:
-
message
Sets the message.When this method is not called or when set to
null
, a default message will shown.- Parameters:
message
- the message to be displayed at the top of this dialog, ornull
to display a default message- Returns:
- this
-
okButtonText
Sets the OK button label.- Parameters:
text
- the label of the OK button; can contain the placeholder{0}
for the number of currently selected elements and the placeholder{1}
for the total number of elements- Returns:
- this
- See Also:
-
okButtonTextWhenNoSelection
Sets the OK button label that will be displayed when no item is selected; otherwise the label ofokButtonText(String)
will be displayed.- Parameters:
text
- the label of the OK button when no item is selected which can contain the placeholder{0}
for the number of currently selected elements and the placeholder{1}
for the total number of elements- Returns:
- this
- See Also:
-
canCancel
Sets whether the dialog can be canceled.- Parameters:
canCancel
- whether selecting can be canceled or not (via the Cancel button or by closing the dialog)- Returns:
- this
-
asSheet
Sets whether to show the dialog as sheet. -
checkboxText
Sets the label of the optional check box.When this method is not called or when set to
null
, the optional check box will be hidden.- Parameters:
checkboxText
- the check box label- Returns:
- this
- See Also:
-
checkboxValue
Sets the selection state of the optional check box.- Parameters:
checkboxValue
- the initial selection state- Returns:
- this
- See Also:
-
create
Creates and assembles the dialog.- Parameters:
parentShell
- the parent shell- Returns:
- the new assembled
ListSelectionDialog
-