T
- the type of object that can be selected in the dialogV
- the type of the viewerpublic abstract class AbstractViewerSelectionDialog<T,V extends org.eclipse.jface.viewers.StructuredViewer>
extends org.eclipse.jface.dialogs.Dialog
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 |
---|
AbstractViewerSelectionDialog(org.eclipse.swt.widgets.Shell parentShell,
String title,
T initialSelection)
Constructor.
|
AbstractViewerSelectionDialog(org.eclipse.swt.widgets.Shell parentShell,
String title,
T initialSelection,
boolean allowNone,
int widthHint,
int heightHint)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
acceptObject(org.eclipse.jface.viewers.Viewer viewer,
org.eclipse.jface.viewers.ViewerFilter[] filters,
Object candidate)
Determines if the given object matches the given filters.
|
protected void |
addToolBarActions(org.eclipse.jface.action.ToolBarManager manager)
Add tool bar actions to the entity dialog tool bar.
|
protected void |
buttonPressed(int buttonId) |
protected void |
cancelPressed() |
protected void |
configureShell(org.eclipse.swt.widgets.Shell newShell) |
protected void |
createButtonsForButtonBar(org.eclipse.swt.widgets.Composite parent) |
protected org.eclipse.swt.widgets.Control |
createContents(org.eclipse.swt.widgets.Composite parent) |
protected org.eclipse.swt.widgets.Control |
createDialogArea(org.eclipse.swt.widgets.Composite parent) |
protected abstract V |
createViewer(org.eclipse.swt.widgets.Composite parent)
Create the tree viewer.
|
org.eclipse.jface.viewers.ViewerFilter[] |
getFilters() |
T |
getObject()
Get the selected object.
|
protected abstract T |
getObjectFromSelection(org.eclipse.jface.viewers.ISelection selection)
Retrieve the selected entity from the given selection
|
protected V |
getViewer() |
protected void |
okPressed() |
void |
setFilters(org.eclipse.jface.viewers.ViewerFilter[] filters)
Set the viewer filters
|
protected abstract void |
setupViewer(V viewer,
T initialSelection)
Setup the tree viewer with label provider, content provider and input.
|
applyDialogFont, close, convertHeightInCharsToPixels, convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, convertWidthInCharsToPixels, create, createButton, createButtonBar, dialogFontIsDefault, getBlockedHandler, getButton, getButtonBar, getCancelButton, getDialogArea, getDialogBoundsSettings, getDialogBoundsStrategy, getImage, getInitialLocation, getInitialSize, getOKButton, initializeBounds, initializeDialogUnits, isResizable, setBlockedHandler, setButtonLayoutData, setButtonLayoutFormData, shortenText
canHandleShellCloseEvent, constrainShellSize, createShell, getConstrainedShellBounds, getContents, getDefaultImage, getDefaultImages, getDefaultOrientation, getLayout, getParentShell, getReturnCode, getShell, getShellListener, getShellStyle, getWindowManager, handleFontChange, handleShellCloseEvent, open, setBlockOnOpen, setDefaultImage, setDefaultImages, setDefaultModalParent, setDefaultOrientation, setExceptionHandler, setParentShell, setReturnCode, setShellStyle, setWindowManager
public AbstractViewerSelectionDialog(org.eclipse.swt.widgets.Shell parentShell, String title, T initialSelection)
parentShell
- the parent shelltitle
- the dialog titleinitialSelection
- the entity definition to select initially (if
possible), may be null
public AbstractViewerSelectionDialog(org.eclipse.swt.widgets.Shell parentShell, String title, T initialSelection, boolean allowNone, int widthHint, int heightHint)
parentShell
- the parent shelltitle
- the dialog titleinitialSelection
- the entity definition to select initially (if
possible), may be null
allowNone
- if selecting the None button is allowedwidthHint
- the width hint for the dialogheightHint
- the height hint for the dialogprotected org.eclipse.swt.widgets.Control createContents(org.eclipse.swt.widgets.Composite parent)
createContents
in class org.eclipse.jface.dialogs.Dialog
Dialog.createContents(Composite)
protected void configureShell(org.eclipse.swt.widgets.Shell newShell)
configureShell
in class org.eclipse.jface.window.Window
Window.configureShell(Shell)
protected org.eclipse.swt.widgets.Control createDialogArea(org.eclipse.swt.widgets.Composite parent)
createDialogArea
in class org.eclipse.jface.dialogs.Dialog
Dialog.createDialogArea(Composite)
protected abstract V createViewer(org.eclipse.swt.widgets.Composite parent)
parent
- the parent compositeprotected void addToolBarActions(org.eclipse.jface.action.ToolBarManager manager)
manager
- the tool bar managerprotected void createButtonsForButtonBar(org.eclipse.swt.widgets.Composite parent)
createButtonsForButtonBar
in class org.eclipse.jface.dialogs.Dialog
Dialog.createButtonsForButtonBar(Composite)
protected void buttonPressed(int buttonId)
buttonPressed
in class org.eclipse.jface.dialogs.Dialog
Dialog.buttonPressed(int)
public static boolean acceptObject(org.eclipse.jface.viewers.Viewer viewer, org.eclipse.jface.viewers.ViewerFilter[] filters, Object candidate)
viewer
- the viewerfilters
- the viewer filterscandidate
- the object to testprotected abstract void setupViewer(V viewer, T initialSelection)
setFilters(ViewerFilter[])
.viewer
- the tree viewerinitialSelection
- the object to select (if possible), may be
null
protected void okPressed()
okPressed
in class org.eclipse.jface.dialogs.Dialog
Dialog.okPressed()
protected abstract T getObjectFromSelection(org.eclipse.jface.viewers.ISelection selection)
selection
- the selectionnull
protected void cancelPressed()
cancelPressed
in class org.eclipse.jface.dialogs.Dialog
Dialog.cancelPressed()
public T getObject()
null
public void setFilters(org.eclipse.jface.viewers.ViewerFilter[] filters)
filters
- the filterspublic org.eclipse.jface.viewers.ViewerFilter[] getFilters()
protected V getViewer()
Build 2013-10-07_11-27-38
Revision 99b27713a799a59a21b0b166eaaea8aaefbf125a