public abstract class AbstractFilteredObjectsSelectionDialog<T>
extends org.eclipse.ui.dialogs.FilteredItemsSelectionDialog
A collection of item objects is passed as the resource to be filtered. This abstract class shows a list of items with a text entry field for a string pattern used to filter the list of items.
The clients must provide their implementations. The methods, toObject(String)
and toString(Object)
,
to convert the item values, should be implemented by the subclasses.
Modifier and Type | Class and Description |
---|---|
class |
AbstractFilteredObjectsSelectionDialog.BrowseItemListLabelProvider
A main list label provider to provide the text for the label of given element.
|
org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.AbstractContentProvider, org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.ItemsFilter, org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.SelectionHistory
Modifier and Type | Field and Description |
---|---|
protected java.util.List<T> |
items |
CARET_BEGINNING, FULL_SELECTION, NONE
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
Constructor and Description |
---|
AbstractFilteredObjectsSelectionDialog(org.eclipse.swt.widgets.Shell shell,
boolean multi,
java.util.Collection<T> items)
Creates a new instance of the abstract browse dialog class.
|
AbstractFilteredObjectsSelectionDialog(org.eclipse.swt.widgets.Shell shell,
java.util.Collection<T> items)
Creates a new instance of the abstract browse dialog class.
|
Modifier and Type | Method and Description |
---|---|
protected org.eclipse.swt.widgets.Control |
createExtendedContentArea(org.eclipse.swt.widgets.Composite parent) |
protected org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.ItemsFilter |
createFilter() |
protected void |
fillContentProvider(org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.AbstractContentProvider contentProvider,
org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.ItemsFilter itemsFilter,
org.eclipse.core.runtime.IProgressMonitor progressMonitor) |
protected org.eclipse.jface.dialogs.IDialogSettings |
getDialogSettings() |
java.lang.String |
getElementName(java.lang.Object item) |
protected java.util.Comparator<?> |
getItemsComparator() |
protected int |
safeStringCompareTo(java.lang.String str1,
java.lang.String str2)
Compares two String objects, and indicates whether String str1 precedes, follows, or appears in the same position
in the sort order as the specified str2.
|
protected abstract T |
toObject(java.lang.String itemAsString)
Converts the itemAsString, that is a possible string value for the dialog, into an object value.
|
protected abstract java.lang.String |
toString(T itemAsObject)
Converts the itemAsObject, that is a possible object value for the dialog, into a string value.
|
protected org.eclipse.core.runtime.IStatus |
validateItem(java.lang.Object item) |
accessedHistoryItem, addListFilter, applyFilter, close, computeResult, create, createDialogArea, fillContextMenu, fillViewMenu, getDialogBoundsSettings, getInitialPattern, getPatternControl, getSelectedItems, getSelectionHistory, handleDoubleClick, handleSelected, isDuplicateElement, isHistoryElement, okPressed, refresh, reloadCache, removeHistoryItem, restoreDialog, scheduleProgressMessageRefresh, scheduleRefresh, setDetailsLabelProvider, setInitialPattern, setInitialPattern, setListLabelProvider, setListSelectionLabelDecorator, setSelectionHistory, setSeparatorLabel, storeDialog, updateProgressLabel, updateStatus
configureShell, createButtonBar, getFirstResult, setImage, setResult, setStatusLineAboveButtons, updateButtonsEnableState
createButtonsForButtonBar, createMessageArea, 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, cancelPressed, 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, shortenText
canHandleShellCloseEvent, 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
protected java.util.List<T> items
public AbstractFilteredObjectsSelectionDialog(org.eclipse.swt.widgets.Shell shell, java.util.Collection<T> items)
shell
- the shell to parent the dialog onitems
- a collection of items to be filtered in this browse dialogpublic AbstractFilteredObjectsSelectionDialog(org.eclipse.swt.widgets.Shell shell, boolean multi, java.util.Collection<T> items)
shell
- the shell to parent the dialog onmulti
- the boolean multi indicates whether the browse dialog allows to select more than one items in its item
listitems
- a collection of items to be filtered in this browse dialogprotected void fillContentProvider(org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.AbstractContentProvider contentProvider, org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.ItemsFilter itemsFilter, org.eclipse.core.runtime.IProgressMonitor progressMonitor) throws org.eclipse.core.runtime.CoreException
fillContentProvider
in class org.eclipse.ui.dialogs.FilteredItemsSelectionDialog
org.eclipse.core.runtime.CoreException
public java.lang.String getElementName(java.lang.Object item)
getElementName
in class org.eclipse.ui.dialogs.FilteredItemsSelectionDialog
protected org.eclipse.ui.dialogs.FilteredItemsSelectionDialog.ItemsFilter createFilter()
createFilter
in class org.eclipse.ui.dialogs.FilteredItemsSelectionDialog
protected org.eclipse.swt.widgets.Control createExtendedContentArea(org.eclipse.swt.widgets.Composite parent)
createExtendedContentArea
in class org.eclipse.ui.dialogs.FilteredItemsSelectionDialog
protected java.util.Comparator<?> getItemsComparator()
getItemsComparator
in class org.eclipse.ui.dialogs.FilteredItemsSelectionDialog
protected int safeStringCompareTo(java.lang.String str1, java.lang.String str2)
Returns 0 if both strings are null, otherwise returns -1 if str1 is null, returns 1 if str2 is null, otherwise returns the java.lang.String.compareTo()
str1
- str2
- protected org.eclipse.core.runtime.IStatus validateItem(java.lang.Object item)
validateItem
in class org.eclipse.ui.dialogs.FilteredItemsSelectionDialog
protected org.eclipse.jface.dialogs.IDialogSettings getDialogSettings()
getDialogSettings
in class org.eclipse.ui.dialogs.FilteredItemsSelectionDialog
protected abstract T toObject(java.lang.String itemAsString)
itemAsString
- the String itemAsString to be converted to Objectprotected abstract java.lang.String toString(T itemAsObject)
itemAsObject
- the Object itemAsObject to be converted to String