Class ElementTreeSelectionDialog
- All Implemented Interfaces:
- IShellProvider
- Since:
- 2.0
- 
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 SummaryConstructorsConstructorDescriptionElementTreeSelectionDialog(Shell parent, IBaseLabelProvider labelProvider, ITreeContentProvider contentProvider) Constructs an instance ofElementTreeSelectionDialog.ElementTreeSelectionDialog(Shell parent, ILabelProvider labelProvider, ITreeContentProvider contentProvider) Constructs an instance ofElementTreeSelectionDialog.
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidaccess$setResult(List result) Set the result using the super class implementation of setResult.protected voidaccess$superButtonPressed(int id) Set the result using the super class implementation of buttonPressed.voidaddFilter(ViewerFilter filter) Adds a filter to the tree viewer.protected voidHandles cancel button pressed event.protected voidCompute the result and return it.voidcreate()Creates this window's widgetry in a new top-level shell.protected ControlcreateDialogArea(Composite parent) Creates and returns the contents of the upper part of this dialog (above the button bar).protected TreeViewercreateTreeViewer(Composite parent) Creates and initializes the tree viewer.protected TreeViewerdoCreateTreeViewer(Composite parent, int style) Creates the tree viewer.protected TreeViewerReturns the tree viewer.protected voidNotifies that the window's close button was pressed, the close menu was selected, or the ESCAPE key pressed.intopen()Opens this window, creating it first if it has not yet been created.voidsetAllowMultiple(boolean allowMultiple) Specifies if multiple selection is allowed.voidsetComparator(ViewerComparator comparator) Sets the comparator used by the tree viewer.voidsetDoubleClickSelects(boolean doubleClickSelects) Specifies if default selected events (double click) are created.voidsetEmptyListMessage(String message) Sets the message to be displayed if the list is empty.voidsetInitialSelection(Object selection) Sets the initial selection.voidSets the tree input.voidsetSize(int width, int height) Sets the size of the tree in unit of characters.voidsetSorter(ViewerSorter sorter) Deprecated.voidsetValidator(ISelectionStatusValidator validator) Sets an optional validator to check if the selection is valid.protected voidValidate the receiver and update the ok status.Methods inherited from class org.eclipse.ui.dialogs.SelectionStatusDialogconfigureShell, createButtonBar, getFirstResult, okPressed, setImage, setResult, setStatusLineAboveButtons, updateButtonsEnableState, updateStatusMethods inherited from class org.eclipse.ui.dialogs.SelectionDialogcreateButtonsForButtonBar, createMessageArea, getDialogBoundsSettings, getDialogBoundsStrategy, getInitialElementSelections, getInitialSelections, getMessage, getOkButton, getResult, isResizable, setDialogBoundsSettings, setInitialElementSelections, setInitialSelections, setMessage, setResult, setSelectionResult, setTitleMethods inherited from class org.eclipse.jface.dialogs.TrayDialogcloseTray, createHelpControl, getLayout, getTray, isDialogHelpAvailable, isHelpAvailable, openTray, setDialogHelpAvailable, setHelpAvailableMethods inherited from class org.eclipse.jface.dialogs.DialogapplyDialogFont, buttonPressed, close, convertHeightInCharsToPixels, convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, convertWidthInCharsToPixels, createButton, createContents, dialogFontIsDefault, getBlockedHandler, getButton, getButtonBar, getCancelButton, getDialogArea, getImage, getInitialLocation, getInitialSize, getOKButton, initializeBounds, initializeDialogUnits, 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, setBlockOnOpen, setDefaultImage, setDefaultImages, setDefaultModalParent, setDefaultOrientation, setExceptionHandler, setParentShell, setReturnCode, setShellStyle, setWindowManager
- 
Constructor Details- 
ElementTreeSelectionDialogpublic ElementTreeSelectionDialog(Shell parent, ILabelProvider labelProvider, ITreeContentProvider contentProvider) Constructs an instance ofElementTreeSelectionDialog.- Parameters:
- parent- The parent shell for the dialog
- labelProvider- the label provider to render the entries
- contentProvider- the content provider to evaluate the tree structure
 
- 
ElementTreeSelectionDialogpublic ElementTreeSelectionDialog(Shell parent, IBaseLabelProvider labelProvider, ITreeContentProvider contentProvider) Constructs an instance ofElementTreeSelectionDialog.- Parameters:
- parent- The parent shell for the dialog
- labelProvider- the label provider to render the entries. It must be compatible with the Viewerreturned from- doCreateTreeViewer(Composite, int)
- contentProvider- the content provider to evaluate the tree structure
- Since:
- 3.106
 
 
- 
- 
Method Details- 
setInitialSelectionSets the initial selection. Convenience method.- Parameters:
- selection- the initial selection.
 
- 
setEmptyListMessageSets the message to be displayed if the list is empty.- Parameters:
- message- the message to be displayed.
 
- 
setAllowMultiplepublic void setAllowMultiple(boolean allowMultiple) Specifies if multiple selection is allowed.- Parameters:
- allowMultiple- true if allowed.
 
- 
setDoubleClickSelectspublic void setDoubleClickSelects(boolean doubleClickSelects) Specifies if default selected events (double click) are created.- Parameters:
- doubleClickSelects- true or false.
 
- 
setSorterDeprecated.as of 3.3, usesetComparator(ViewerComparator)insteadSets the sorter used by the tree viewer.- Parameters:
- sorter- the- ViewerSorter
 
- 
setComparatorSets the comparator used by the tree viewer.- Parameters:
- comparator- the- ViewerComparator
- Since:
- 3.3
 
- 
addFilterAdds a filter to the tree viewer.- Parameters:
- filter- a filter.
 
- 
setValidatorSets an optional validator to check if the selection is valid. The validator is invoked whenever the selection changes.- Parameters:
- validator- the validator to validate the selection.
 
- 
setInputSets the tree input.- Parameters:
- input- the tree input.
 
- 
setSizepublic void setSize(int width, int height) Sets the size of the tree in unit of characters.- Parameters:
- width- the width of the tree.
- height- the height of the tree.
 
- 
updateOKStatusprotected void updateOKStatus()Validate the receiver and update the ok status.
- 
openpublic int open()Description copied from class:WindowOpens this window, creating it first if it has not yet been created.If this window has been configured to block on open ( setBlockOnOpen), this method waits until the window is closed by the end user, and then it returns the window's return code; otherwise, this method returns immediately. A window's return codes are window-specific, although two standard return codes are predefined:OKandCANCEL.
- 
cancelPressedprotected void cancelPressed()Handles cancel button pressed event.- Overrides:
- cancelPressedin class- Dialog
 
- 
computeResultprotected void computeResult()Description copied from class:SelectionStatusDialogCompute the result and return it.- Specified by:
- computeResultin class- SelectionStatusDialog
 
- 
createpublic void create()Description copied from class:WindowCreates this window's widgetry in a new top-level shell.The default implementation of this framework method creates this window's shell (by calling createShell), and its controls (by callingcreateContents), then initializes this window's shell bounds (by callinginitializeBounds).- Overrides:
- createin class- SelectionStatusDialog
 
- 
createDialogAreaDescription copied from class:DialogCreates and returns the contents of the upper part of this dialog (above the button bar).The Dialogimplementation of this framework method creates and returns a newCompositewith standard margins and spacing.The returned control's layout data must be an instance of GridData. This method must not modify the parent's layout.Subclasses must override this method but may call superas in the following example:Composite composite = (Composite) super.createDialogArea(parent); //add controls to composite as necessary return composite; - Overrides:
- createDialogAreain class- Dialog
- Parameters:
- parent- the parent composite to contain the dialog area
- Returns:
- the dialog area control
 
- 
createTreeViewerCreates and initializes the tree viewer.- Parameters:
- parent- the parent composite
- Returns:
- the tree viewer
- See Also:
 
- 
doCreateTreeViewerCreates the tree viewer.- Parameters:
- parent- the parent composite
- style- the- SWTstyle bits
- Returns:
- the tree viewer
- Since:
- 3.4
 
- 
getTreeViewerReturns the tree viewer.- Returns:
- the tree viewer
 
- 
access$superButtonPressedprotected void access$superButtonPressed(int id) Set the result using the super class implementation of buttonPressed.- Parameters:
- id- the id of the button that was pressed (see IDialogConstants.*_ID constants)
- See Also:
 
- 
access$setResultSet the result using the super class implementation of setResult.- Parameters:
- result- list of selected elements, or- nullif Cancel was pressed
- See Also:
 
- 
handleShellCloseEventprotected void handleShellCloseEvent()Description copied from class:WindowNotifies that the window's close button was pressed, the close menu was selected, or the ESCAPE key pressed.The default implementation of this framework method sets the window's return code to CANCELand closes the window usingclose. Subclasses may extend or reimplement.- Overrides:
- handleShellCloseEventin class- TrayDialog
 
 
- 
setComparator(ViewerComparator)instead