public class FilteredResourcesSelectionDialog extends FilteredItemsSelectionDialog
Modifier and Type | Class and Description |
---|---|
protected class |
FilteredResourcesSelectionDialog.ResourceFilter
Filters resources using pattern and showDerived flag.
|
FilteredItemsSelectionDialog.AbstractContentProvider, FilteredItemsSelectionDialog.ItemsFilter, FilteredItemsSelectionDialog.SelectionHistory
Window.IExceptionHandler
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
CANCEL, OK, resizeHasOccurred
Constructor and Description |
---|
FilteredResourcesSelectionDialog(Shell shell,
boolean multi,
IContainer container,
int typesMask)
Creates a new instance of the class
|
Modifier and Type | Method and Description |
---|---|
protected void |
applyFilter()
Applies the filter created by
createFilter() method to the
items list. |
protected void |
configureShell(Shell shell)
Configures the given shell in preparation for opening this window in it.
|
protected Control |
createExtendedContentArea(Composite parent)
Creates an extra content area, which will be located above the details.
|
protected FilteredItemsSelectionDialog.ItemsFilter |
createFilter()
Creates an instance of a filter.
|
protected void |
fillContentProvider(FilteredItemsSelectionDialog.AbstractContentProvider contentProvider,
FilteredItemsSelectionDialog.ItemsFilter itemsFilter,
IProgressMonitor progressMonitor)
Fills the content provider with matching items.
|
protected void |
fillViewMenu(IMenuManager menuManager)
Fills the menu of the dialog.
|
protected IDialogSettings |
getDialogSettings()
Returns the dialog settings.
|
String |
getElementName(Object item)
Returns name for then given object.
|
protected Comparator |
getItemsComparator()
Returns comparator to sort items inside content provider.
|
Object[] |
getResult()
Returns the list of selections made by the user, or
null
if the selection was canceled. |
int |
open()
Opens this window, creating it first if it has not yet been created.
|
protected void |
restoreDialog(IDialogSettings settings)
Restores dialog using persisted settings.
|
void |
setTitle(String title)
Sets the title for this dialog.
|
protected void |
storeDialog(IDialogSettings settings)
Stores dialog settings.
|
protected IStatus |
validateItem(Object item)
Validates the item.
|
accessedHistoryItem, addListFilter, close, computeResult, create, createDialogArea, fillContextMenu, getDialogBoundsSettings, getInitialPattern, getPatternControl, getSelectedItems, getSelectionHistory, handleDoubleClick, handleSelected, isDuplicateElement, isHistoryElement, okPressed, refresh, reloadCache, removeHistoryItem, scheduleProgressMessageRefresh, scheduleRefresh, setDetailsLabelProvider, setInitialPattern, setInitialPattern, setListLabelProvider, setListSelectionLabelDecorator, setSelectionHistory, setSeparatorLabel, updateProgressLabel, updateStatus
createButtonBar, getFirstResult, setImage, setResult, setStatusLineAboveButtons, updateButtonsEnableState
createButtonsForButtonBar, createMessageArea, getDialogBoundsStrategy, getInitialElementSelections, getInitialSelections, getMessage, getOkButton, isResizable, setDialogBoundsSettings, setInitialElementSelections, setInitialSelections, setMessage, setResult, setSelectionResult
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, setBlockOnOpen, setDefaultImage, setDefaultImages, setDefaultModalParent, setDefaultOrientation, setExceptionHandler, setParentShell, setReturnCode, setShellStyle, setWindowManager
public FilteredResourcesSelectionDialog(Shell shell, boolean multi, IContainer container, int typesMask)
shell
- the parent shellmulti
- the multi selection flagcontainer
- the container to select resources from, e.g. the workspace roottypesMask
- a mask specifying which resource types should be shown in the dialog.
The mask should contain one or more of the resource type bit masks
defined in IResource.getType()
protected void configureShell(Shell shell)
Window
The default implementation of this framework method sets the shell's image and gives it a grid layout. Subclasses may extend or reimplement.
configureShell
in class SelectionStatusDialog
shell
- the shellpublic void setTitle(String title)
SelectionDialog
setTitle
in class SelectionDialog
title
- the titleprotected IDialogSettings getDialogSettings()
FilteredItemsSelectionDialog
getDialogSettings
in class FilteredItemsSelectionDialog
protected void storeDialog(IDialogSettings settings)
FilteredItemsSelectionDialog
storeDialog
in class FilteredItemsSelectionDialog
settings
- settings used to store dialogprotected void restoreDialog(IDialogSettings settings)
FilteredItemsSelectionDialog
restoreDialog
in class FilteredItemsSelectionDialog
settings
- settings used to restore dialogprotected void fillViewMenu(IMenuManager menuManager)
FilteredItemsSelectionDialog
fillViewMenu
in class FilteredItemsSelectionDialog
menuManager
- the menu managerprotected Control createExtendedContentArea(Composite parent)
FilteredItemsSelectionDialog
createExtendedContentArea
in class FilteredItemsSelectionDialog
parent
- parent to create the dialog widgets inpublic Object[] getResult()
SelectionDialog
null
if the selection was canceled.getResult
in class SelectionDialog
null
if Cancel
was pressedpublic 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 String getElementName(Object item)
FilteredItemsSelectionDialog
getElementName
in class FilteredItemsSelectionDialog
item
- an object from the content provider. Subclasses should pay
attention to the passed argument. They should either only pass
objects of a known type (one used in content provider) or make
sure that passed parameter is the expected one (by type
checking like instanceof
inside the method).protected IStatus validateItem(Object item)
FilteredItemsSelectionDialog
validateItem
in class FilteredItemsSelectionDialog
item
- an item to be checkedprotected FilteredItemsSelectionDialog.ItemsFilter createFilter()
FilteredItemsSelectionDialog
createFilter
in class FilteredItemsSelectionDialog
null
,
no filtering will be applied then, causing no item to be shown in
the list.protected void applyFilter()
FilteredItemsSelectionDialog
createFilter()
method to the
items list. When new filter is different than previous one it will cause
refiltering.applyFilter
in class FilteredItemsSelectionDialog
protected Comparator getItemsComparator()
FilteredItemsSelectionDialog
compare(java.lang.Object, java.lang.Object)
are going to
be the same type as the one used in the content provider.getItemsComparator
in class FilteredItemsSelectionDialog
protected void fillContentProvider(FilteredItemsSelectionDialog.AbstractContentProvider contentProvider, FilteredItemsSelectionDialog.ItemsFilter itemsFilter, IProgressMonitor progressMonitor) throws CoreException
FilteredItemsSelectionDialog
fillContentProvider
in class FilteredItemsSelectionDialog
contentProvider
- collector to add items to.
FilteredItemsSelectionDialog.AbstractContentProvider.add(Object, FilteredItemsSelectionDialog.ItemsFilter)
only adds items that pass the given itemsFilter
.itemsFilter
- the items filterprogressMonitor
- must be used to report search progress. The state of this
progress monitor reflects the state of the filtering process.CoreException
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.