Class SelectionDialog
- All Implemented Interfaces:
- IShellProvider
- Direct Known Subclasses:
- ContainerSelectionDialog,- ListDialog,- ListSelectionDialog,- MarkerResolutionSelectionDialog,- PathVariableSelectionDialog,- ProjectLocationMoveDialog,- ResourceListSelectionDialog,- ResourceSelectionDialog,- SelectionStatusDialog,- TypeFilteringDialog
setInitialSelections), and returns the final
 selection (via getResult) after completion.
 Clients may subclass this dialog to inherit its selection facilities.
- 
Nested Class SummaryNested classes/interfaces inherited from class org.eclipse.jface.window.WindowWindow.IExceptionHandler
- 
Field SummaryFields inherited from class org.eclipse.jface.dialogs.DialogblockedHandler, buttonBar, DIALOG_DEFAULT_BOUNDS, DIALOG_PERSISTLOCATION, DIALOG_PERSISTSIZE, dialogArea, DLG_IMG_ERROR, DLG_IMG_HELP, DLG_IMG_INFO, DLG_IMG_MESSAGE_ERROR, DLG_IMG_MESSAGE_INFO, DLG_IMG_MESSAGE_WARNING, DLG_IMG_QUESTION, DLG_IMG_WARNING, ELLIPSISFields inherited from class org.eclipse.jface.window.WindowCANCEL, OK, resizeHasOccurred
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedSelectionDialog(Shell parentShell) Creates a dialog instance.
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidconfigureShell(Shell shell) Configures the given shell in preparation for opening this window in it.protected voidcreateButtonsForButtonBar(Composite parent) Adds buttons to this dialog's button bar.protected LabelcreateMessageArea(Composite composite) Creates the message area for this dialog.protected IDialogSettingsGets the dialog settings that should be used for remembering the bounds of the dialog, according to the dialog bounds strategy.protected intGet the integer constant that describes the strategy for persisting the dialog bounds.protected ListReturns the list of initial element selections.protected ListDeprecated.use getInitialElementSelections() insteadprotected StringReturns the message for this dialog.Returns the ok button.Object[]Returns the list of selections made by the user, ornullif the selection was canceled.protected booleanReturns a boolean indicating whether the dialog should be considered resizable when the shell style is initially set.voidsetDialogBoundsSettings(IDialogSettings settings, int strategy) Set the dialog settings that should be used to save the bounds of this dialog.voidsetInitialElementSelections(List selectedElements) Sets the initial selection in this selection dialog to the given elements.voidsetInitialSelections(Object... selectedElements) Sets the initial selection in this selection dialog to the given elements.voidsetMessage(String message) Sets the message for this dialog.protected voidSet the selections made by the user, ornullif the selection was canceled.protected voidsetSelectionResult(Object[] newResult) Set the selections made by the user, ornullif the selection was canceled.voidSets the title for this dialog.Methods inherited from class org.eclipse.jface.dialogs.TrayDialogcloseTray, createButtonBar, createHelpControl, getLayout, getTray, handleShellCloseEvent, isDialogHelpAvailable, isHelpAvailable, openTray, setDialogHelpAvailable, setHelpAvailableMethods inherited from class org.eclipse.jface.dialogs.DialogapplyDialogFont, buttonPressed, cancelPressed, close, convertHeightInCharsToPixels, convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, convertWidthInCharsToPixels, create, createButton, createContents, createDialogArea, dialogFontIsDefault, getBlockedHandler, getButton, getButtonBar, getCancelButton, getDialogArea, getImage, getInitialLocation, getInitialSize, getOKButton, initializeBounds, initializeDialogUnits, okPressed, setBlockedHandler, setButtonLayoutData, setButtonLayoutFormData, shortenTextMethods inherited from class org.eclipse.jface.window.WindowcanHandleShellCloseEvent, constrainShellSize, createShell, getConstrainedShellBounds, getContents, getDefaultImage, getDefaultImages, getDefaultOrientation, getParentShell, getReturnCode, getShell, getShellListener, getShellStyle, getWindowManager, handleFontChange, open, setBlockOnOpen, setDefaultImage, setDefaultImages, setDefaultModalParent, setDefaultOrientation, setExceptionHandler, setParentShell, setReturnCode, setShellStyle, setWindowManager
- 
Constructor Details- 
SelectionDialogCreates a dialog instance. Note that the dialog will have no visual representation (no widgets) until it is told to open.- Parameters:
- parentShell- the parent shell
 
 
- 
- 
Method Details- 
configureShellDescription copied from class:WindowConfigures the given shell in preparation for opening this window in it.The default implementation of this framework method sets the shell's image and gives it a grid layout. Subclasses may extend or reimplement. - Overrides:
- configureShellin class- Window
- Parameters:
- shell- the shell
 
- 
createButtonsForButtonBarDescription copied from class:DialogAdds buttons to this dialog's button bar.The Dialogimplementation of this framework method adds standard ok and cancel buttons using thecreateButtonframework method. These standard buttons will be accessible fromgetCancelButton, andgetOKButton. Subclasses may override.Note: The common button order is: {other buttons}, OK, Cancel. On some platforms, Dialog.initializeBounds()will move the default button to the right.- Overrides:
- createButtonsForButtonBarin class- Dialog
- Parameters:
- parent- the button bar composite
 
- 
createMessageAreaCreates the message area for this dialog.This method is provided to allow subclasses to decide where the message will appear on the screen. - Parameters:
- composite- the parent composite
- Returns:
- the message label
 
- 
getInitialSelectionsDeprecated.use getInitialElementSelections() insteadReturns the initial selection in this selection dialog.- Returns:
- the list of initial selected elements or null
 
- 
getInitialElementSelectionsReturns the list of initial element selections.- Returns:
- List
 
- 
getMessageReturns the message for this dialog.- Returns:
- the message for this dialog
 
- 
getOkButtonReturns the ok button.- Returns:
- the ok button or nullif the button is not created yet.
 
- 
getResultReturns the list of selections made by the user, ornullif the selection was canceled.- Returns:
- the array of selected elements, or nullif Cancel was pressed
 
- 
setInitialSelectionsSets the initial selection in this selection dialog to the given elements.- Parameters:
- selectedElements- the array of elements to select
 
- 
setInitialElementSelectionsSets the initial selection in this selection dialog to the given elements.- Parameters:
- selectedElements- the List of elements to select
 
- 
setMessageSets the message for this dialog.- Parameters:
- message- the message
 
- 
setResultSet the selections made by the user, ornullif the selection was canceled.- Parameters:
- newResult- list of selected elements, or- nullif Cancel was pressed
 
- 
setSelectionResultSet the selections made by the user, ornullif the selection was canceled.The selections may accessed using getResult.- Parameters:
- newResult- - the new values
- Since:
- 2.0
 
- 
setTitleSets the title for this dialog.- Parameters:
- title- the title
 
- 
setDialogBoundsSettingsSet the dialog settings that should be used to save the bounds of this dialog. This method is provided so that clients that directly use SelectionDialogs without subclassing them may specify how the bounds of the dialog are to be saved.- Parameters:
- settings- the- IDialogSettingsthat should be used to store the bounds of the dialog
- strategy- the integer constant specifying how the bounds are saved. Specified using- Dialog.DIALOG_PERSISTLOCATIONand- Dialog.DIALOG_PERSISTSIZE.
- Since:
- 3.2
- See Also:
 
- 
getDialogBoundsSettingsGets the dialog settings that should be used for remembering the bounds of the dialog, according to the dialog bounds strategy. Overridden to provide the dialog settings that were set usingsetDialogBoundsSettings(IDialogSettings, int).- Overrides:
- getDialogBoundsSettingsin class- Dialog
- Returns:
- the dialog settings used to store the dialog's location and/or size,
         or nullif the dialog's bounds should not be stored.
- Since:
- 3.2
- See Also:
 
- 
getDialogBoundsStrategyprotected int getDialogBoundsStrategy()Get the integer constant that describes the strategy for persisting the dialog bounds. Overridden to provide the dialog bounds strategy that was set usingsetDialogBoundsSettings(IDialogSettings, int).- Overrides:
- getDialogBoundsStrategyin class- Dialog
- Returns:
- the constant describing the strategy for persisting the dialog bounds.
- Since:
- 3.2
- See Also:
 
- 
isResizableprotected boolean isResizable()Description copied from class:DialogReturns a boolean indicating whether the dialog should be considered resizable when the shell style is initially set.This method is used to ensure that all style bits appropriate for resizable dialogs are added to the shell style. Individual dialogs may always set the shell style to ensure that a dialog is resizable, but using this method ensures that resizable dialogs will be created with the same set of style bits. Style bits will never be removed based on the return value of this method. For example, if a dialog returns false, but also sets a style bit for a SWT.RESIZE border, the style bit will be honored.- Overrides:
- isResizablein class- Dialog
- Returns:
- a boolean indicating whether the dialog is resizable and should have the default style bits for resizable dialogs
- Since:
- 3.4
 
 
-