public abstract class AbstractElementListSelectionDialog extends SelectionStatusDialog
Window.IExceptionHandler
Modifier and Type | Field and Description |
---|---|
protected FilteredList |
fFilteredList |
blockedHandler, 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, ELLIPSIS
CANCEL, OK, resizeHasOccurred
Modifier | Constructor and Description |
---|---|
protected |
AbstractElementListSelectionDialog(Shell parent,
ILabelProvider renderer)
Constructs a list selection dialog.
|
Modifier and Type | Method and Description |
---|---|
protected void |
cancelPressed()
Notifies that the cancel button of this dialog has been pressed.
|
void |
create()
Creates this window's widgetry in a new top-level shell.
|
protected FilteredList |
createFilteredList(Composite parent)
Creates a filtered list.
|
protected Text |
createFilterText(Composite parent) |
protected Label |
createMessageArea(Composite composite)
Creates the message text widget and sets layout data.
|
String |
getFilter()
Returns the current filter pattern.
|
Object[] |
getFoldedElements(int index)
Returns all elements which are folded together to one entry in the list.
|
protected Object[] |
getSelectedElements()
Returns an array of the currently selected elements.
|
protected int |
getSelectionIndex()
Returns an index referring the first current selection.
|
protected int[] |
getSelectionIndices()
Returns the indices referring the current selection.
|
protected ISelectionStatusValidator |
getValidator()
Gets the optional validator used to check if the selection is valid.
|
protected void |
handleDefaultSelected()
Handles default selection (double click).
|
protected void |
handleElementsChanged()
This method is called when the elements of the backing list are changed
to refresh the standard dialog widgets.
|
protected void |
handleEmptyList()
Handles empty list by disabling widgets.
|
protected void |
handleSelectionChanged()
Handles a selection changed event.
|
boolean |
isCaseIgnored()
Returns if sorting, filtering and folding is case sensitive.
|
int |
open()
Opens this window, creating it first if it has not yet been created.
|
void |
setAllowDuplicates(boolean allowDuplicates)
Specifies whether duplicate entries are displayed or not.
|
void |
setEmptyListMessage(String message)
Sets the message to be displayed if the list is empty.
|
void |
setEmptySelectionMessage(String message)
Sets the message to be displayed if the selection is empty.
|
void |
setFilter(String filter)
Sets the filter pattern.
|
void |
setIgnoreCase(boolean ignoreCase)
Specifies if sorting, filtering and folding is case sensitive.
|
protected void |
setListElements(Object[] elements)
Sets the elements of the list (widget).
|
void |
setMatchEmptyString(boolean matchEmptyString)
Specifies whether everything or nothing should be filtered on
empty filter string.
|
void |
setMultipleSelection(boolean multipleSelection)
Specifies if multiple selection is allowed.
|
protected void |
setSelection(Object[] selection)
Sets the selection referenced by an array of elements.
|
void |
setSize(int width,
int height)
Sets the list size in unit of characters.
|
void |
setValidator(ISelectionStatusValidator validator)
Sets an optional validator to check if the selection is valid.
|
protected void |
updateOkState()
Update the enablement of the OK button based on whether or not there
is a selection.
|
protected boolean |
validateCurrentSelection()
Validates the current selection and updates the status line
accordingly.
|
computeResult, configureShell, createButtonBar, getFirstResult, okPressed, setImage, setResult, setStatusLineAboveButtons, updateButtonsEnableState, updateStatus
createButtonsForButtonBar, getDialogBoundsSettings, getDialogBoundsStrategy, getInitialElementSelections, getInitialSelections, getMessage, getOkButton, getResult, isResizable, setDialogBoundsSettings, setInitialElementSelections, setInitialSelections, setMessage, setResult, setSelectionResult, setTitle
closeTray, createHelpControl, getLayout, getTray, handleShellCloseEvent, isDialogHelpAvailable, isHelpAvailable, openTray, setDialogHelpAvailable, setHelpAvailable
applyDialogFont, buttonPressed, close, convertHeightInCharsToPixels, convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, convertWidthInCharsToPixels, createButton, createContents, createDialogArea, dialogFontIsDefault, getBlockedHandler, getButton, getButtonBar, getCancelButton, getDialogArea, getImage, getInitialLocation, getInitialSize, getOKButton, initializeBounds, initializeDialogUnits, setBlockedHandler, setButtonLayoutData, setButtonLayoutFormData, shortenText
canHandleShellCloseEvent, constrainShellSize, createShell, getConstrainedShellBounds, getContents, getDefaultImage, getDefaultImages, getDefaultOrientation, getParentShell, getReturnCode, getShell, getShellListener, getShellStyle, getWindowManager, handleFontChange, setBlockOnOpen, setDefaultImage, setDefaultImages, setDefaultModalParent, setDefaultOrientation, setExceptionHandler, setParentShell, setReturnCode, setShellStyle, setWindowManager
protected FilteredList fFilteredList
protected AbstractElementListSelectionDialog(Shell parent, ILabelProvider renderer)
parent
- The parent for the list.renderer
- ILabelProvider for the listprotected void handleDefaultSelected()
public void setIgnoreCase(boolean ignoreCase)
ignoreCase
- public boolean isCaseIgnored()
public void setMatchEmptyString(boolean matchEmptyString)
matchEmptyString
- booleanpublic void setMultipleSelection(boolean multipleSelection)
multipleSelection
- public void setAllowDuplicates(boolean allowDuplicates)
allowDuplicates
- public void setSize(int width, int height)
width
- the width of the list.height
- the height of the list.public void setEmptyListMessage(String message)
message
- the message to be displayed.public void setEmptySelectionMessage(String message)
message
- the message to be displayed.public void setValidator(ISelectionStatusValidator validator)
validator
- the validator to validate the selection.protected void setListElements(Object[] elements)
elements
- the elements of the list.protected void handleElementsChanged()
public void setFilter(String filter)
filter
- the filter pattern.public String getFilter()
null if filter was not set.
protected int[] getSelectionIndices()
protected int getSelectionIndex()
protected void setSelection(Object[] selection)
selection
- the indices of the selection.protected Object[] getSelectedElements()
public Object[] getFoldedElements(int index)
index
- the index selecting the entry in the list.protected Label createMessageArea(Composite composite)
createMessageArea
in class SelectionDialog
composite
- the parent composite of the message area.protected void handleSelectionChanged()
protected boolean validateCurrentSelection()
true
if the current selection is
valid.protected void cancelPressed()
Dialog
The Dialog
implementation of this framework method sets
this dialog's return code to Window.CANCEL
and closes the
dialog. Subclasses may override if desired.
cancelPressed
in class Dialog
protected FilteredList createFilteredList(Composite parent)
parent
- the parent composite.public int open()
Window
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:
OK
and CANCEL
.
open
in class Window
Window.create()
public void create()
Window
The default implementation of this framework method creates this window's
shell (by calling createShell
), and its controls (by
calling createContents
), then initializes this window's
shell bounds (by calling initializeBounds
).
create
in class SelectionStatusDialog
protected void handleEmptyList()
protected void updateOkState()
protected ISelectionStatusValidator getValidator()
null
if no validator has been set.
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.