Package com._1c.g5.v8.dt.ui.dialog
Class ItemSelectionDialog
java.lang.Object
org.eclipse.jface.window.Window
org.eclipse.jface.dialogs.Dialog
org.eclipse.jface.dialogs.TrayDialog
org.eclipse.jface.dialogs.TitleAreaDialog
com._1c.g5.v8.dt.ui.dialog.ItemSelectionDialog
- All Implemented Interfaces:
ISwtSelectionDialog
,org.eclipse.jface.window.IShellProvider
- Direct Known Subclasses:
BipartiteElementsSelectionDialog
,ListItemSelectionDialog
public abstract class ItemSelectionDialog
extends org.eclipse.jface.dialogs.TitleAreaDialog
implements ISwtSelectionDialog
Item selection abstract implementation. Contains methods for creating base structure of dialog,
sets default dialog size to 400x370px, and provides methods for returning selected item(s).
Specific dialog implementations are held in subclasses.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.jface.window.Window
org.eclipse.jface.window.Window.IExceptionHandler
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected IContentProvider
IContentProvider
to be used at the dialog to provide elements to show.protected Object
Dialog elements container.protected org.eclipse.core.databinding.validation.IValidator<IStructuredSelection>
IValidator
to show validation messages at the dialog if needed.protected ILabelProvider
ILabelProvider
to be used at the dialog to provide elements presentation.protected final boolean
Flag showing if multiselection is available for this dialog instance.protected IStructuredSelection
Dialog selection to be returned as its result.Fields inherited from class org.eclipse.jface.dialogs.TitleAreaDialog
DLG_IMG_TITLE_BANNER, DLG_IMG_TITLE_ERROR, INFO_MESSAGE, WARNING_MESSAGE
Fields inherited from class 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
Fields inherited from class org.eclipse.jface.window.Window
CANCEL, OK, resizeHasOccurred
-
Constructor Summary
ConstructorsConstructorDescriptionItemSelectionDialog
(org.eclipse.swt.widgets.Shell parentShell, Object context, IStructuredSelection selection, ILabelProvider labelProvider, IContentProvider contentProvider, String windowTitle, boolean multiselect, boolean isEditable) Default constructor for all implementations Context object is passed to content provider to generate viewer content -
Method Summary
Modifier and TypeMethodDescriptionprotected void
configureShell
(org.eclipse.swt.widgets.Shell newShell) protected org.eclipse.swt.widgets.Control
createButtonBar
(org.eclipse.swt.widgets.Composite parent) protected org.eclipse.swt.widgets.Control
createDialogArea
(org.eclipse.swt.widgets.Composite parent) protected abstract org.eclipse.swt.widgets.Control
createDialogControls
(org.eclipse.swt.widgets.Composite parent) Creates dialog controls and handlersprotected org.eclipse.swt.graphics.Point
Returns configured of minimal size of ItemSelectionDialog (400 x 370)Object[]
Returns an array of objects that user chose in the dialog.protected void
Saves user selection and closes the dialogvoid
setDialogValidator
(org.eclipse.core.databinding.validation.IValidator<IStructuredSelection> dialogValidator) Sets the dialog result validator.protected abstract void
Updates selection that will be returned by getSelection()Methods inherited from class org.eclipse.jface.dialogs.TitleAreaDialog
createContents, getErrorMessage, getMessage, getTitleArea, getTitleImageLabel, setErrorMessage, setMessage, setMessage, setTitle, setTitleAreaColor, setTitleImage
Methods inherited from class org.eclipse.jface.dialogs.TrayDialog
closeTray, createHelpControl, getLayout, getTray, handleShellCloseEvent, isDialogHelpAvailable, isHelpAvailable, openTray, setDialogHelpAvailable, setHelpAvailable
Methods inherited from class org.eclipse.jface.dialogs.Dialog
applyDialogFont, buttonPressed, cancelPressed, close, convertHeightInCharsToPixels, convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, convertWidthInCharsToPixels, create, createButton, createButtonsForButtonBar, dialogFontIsDefault, getBlockedHandler, getButton, getButtonBar, getCancelButton, getDialogArea, getDialogBoundsSettings, getDialogBoundsStrategy, getImage, getInitialLocation, getOKButton, initializeBounds, initializeDialogUnits, isResizable, setBlockedHandler, setButtonLayoutData, setButtonLayoutFormData, shortenText
Methods inherited from class org.eclipse.jface.window.Window
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
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com._1c.g5.v8.dt.ui.dialog.ISwtSelectionDialog
open
-
Field Details
-
labelProvider
ILabelProvider
to be used at the dialog to provide elements presentation. -
contentProvider
IContentProvider
to be used at the dialog to provide elements to show. -
dialogValidator
IValidator
to show validation messages at the dialog if needed. -
context
Dialog elements container. -
multiselect
protected final boolean multiselectFlag showing if multiselection is available for this dialog instance. -
selection
Dialog selection to be returned as its result.
-
-
Constructor Details
-
ItemSelectionDialog
public ItemSelectionDialog(org.eclipse.swt.widgets.Shell parentShell, Object context, IStructuredSelection selection, ILabelProvider labelProvider, IContentProvider contentProvider, String windowTitle, boolean multiselect, boolean isEditable) Default constructor for all implementations Context object is passed to content provider to generate viewer content- Parameters:
parentShell
- - parent shell, cannot benull
context
- - eObject feature container, cannot benull
selection
- - container for selected element(s), cannot benull
labelProvider
- - label provider for viewer, cannot benull
contentProvider
- - content provider for viewer, cannot benull
windowTitle
- - dialog window title text, can benull
multiselect
- - flag, indicating that dialog supports or not multiselectionisEditable
- - flag indicating that dialog is in read-only editable
-
-
Method Details
-
getResult
Description copied from interface:ISwtSelectionDialog
Returns an array of objects that user chose in the dialog.- Specified by:
getResult
in interfaceISwtSelectionDialog
- Returns:
- the result of the dialog.
-
getSelection
- Returns:
- IStructuredSelection that contains selected item(s) or is just empty
-
setDialogValidator
public void setDialogValidator(org.eclipse.core.databinding.validation.IValidator<IStructuredSelection> dialogValidator) Sets the dialog result validator.- Parameters:
dialogValidator
- theIValidator
object, can be {@link null}
-
updateSelection
protected abstract void updateSelection()Updates selection that will be returned by getSelection() -
createDialogControls
protected abstract org.eclipse.swt.widgets.Control createDialogControls(org.eclipse.swt.widgets.Composite parent) Creates dialog controls and handlers- Parameters:
parent
- - parent composite- Returns:
- dialog area control
-
createDialogArea
protected org.eclipse.swt.widgets.Control createDialogArea(org.eclipse.swt.widgets.Composite parent) - Overrides:
createDialogArea
in classorg.eclipse.jface.dialogs.TitleAreaDialog
-
getInitialSize
protected org.eclipse.swt.graphics.Point getInitialSize()Returns configured of minimal size of ItemSelectionDialog (400 x 370)- Overrides:
getInitialSize
in classorg.eclipse.jface.dialogs.TitleAreaDialog
-
okPressed
protected void okPressed()Saves user selection and closes the dialog- Overrides:
okPressed
in classorg.eclipse.jface.dialogs.Dialog
-
configureShell
protected void configureShell(org.eclipse.swt.widgets.Shell newShell) - Overrides:
configureShell
in classorg.eclipse.jface.window.Window
-
createButtonBar
protected org.eclipse.swt.widgets.Control createButtonBar(org.eclipse.swt.widgets.Composite parent) - Overrides:
createButtonBar
in classorg.eclipse.jface.dialogs.TrayDialog
-