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 dialog size to 400x370px, and provides methods for returning selected item(s) Concrete dialog implementations are held in subclasses
-
-
Field Summary
Fields Modifier and Type Field Description protected IContentProvidercontentProviderprotected Objectcontextprotected org.eclipse.core.databinding.validation.IValidatordialogValidatorprotected ILabelProviderlabelProviderprotected booleanmultiselectprotected IStructuredSelectionselection-
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
-
-
Constructor Summary
Constructors Constructor Description 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
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidconfigureShell(org.eclipse.swt.widgets.Shell newShell)protected org.eclipse.swt.widgets.ControlcreateButtonBar(org.eclipse.swt.widgets.Composite parent)protected org.eclipse.swt.widgets.ControlcreateDialogArea(org.eclipse.swt.widgets.Composite parent)protected abstract org.eclipse.swt.widgets.ControlcreateDialogControls(org.eclipse.swt.widgets.Composite parent)Creates dialog controls and handlersprotected org.eclipse.swt.graphics.PointgetInitialSize()Returns configured of minimal size of ItemSelectionDialog (400 x 370)Object[]getResult()Returns an array of objects that user chose in the dialog.IStructuredSelectiongetSelection()protected voidokPressed()Saves user selection and closes the dialogvoidsetDialogValidator(org.eclipse.core.databinding.validation.IValidator dialogValidator)Sets the dialog result validator.protected abstract voidupdateSelection()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 Detail
-
labelProvider
protected ILabelProvider labelProvider
-
contentProvider
protected IContentProvider contentProvider
-
dialogValidator
protected org.eclipse.core.databinding.validation.IValidator dialogValidator
-
context
protected Object context
-
multiselect
protected final boolean multiselect
-
selection
protected IStructuredSelection selection
-
-
Constructor Detail
-
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 shellcontext- - eObject feature containerselection- - container for selected element(s)labelProvider- - label provider for viewercontentProvider- - content provider for viewerwindowTitle- - dialog window title textmultiselect- - flag, indicating that dialog supports or not multiselectionisEditable- - flag indicating that dialog is in read-only editable
-
-
Method Detail
-
getResult
public Object[] getResult()
Description copied from interface:ISwtSelectionDialogReturns an array of objects that user chose in the dialog.- Specified by:
getResultin interfaceISwtSelectionDialog- Returns:
- the result of the dialog.
-
getSelection
public IStructuredSelection getSelection()
- Returns:
- IStructuredSelection that contains selected item(s)
-
setDialogValidator
public void setDialogValidator(org.eclipse.core.databinding.validation.IValidator dialogValidator)
Sets the dialog result validator.- Parameters:
dialogValidator- theIValidatorobject.
-
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:
createDialogAreain classorg.eclipse.jface.dialogs.TitleAreaDialog
-
getInitialSize
protected org.eclipse.swt.graphics.Point getInitialSize()
Returns configured of minimal size of ItemSelectionDialog (400 x 370)- Overrides:
getInitialSizein classorg.eclipse.jface.dialogs.TitleAreaDialog
-
okPressed
protected void okPressed()
Saves user selection and closes the dialog- Overrides:
okPressedin classorg.eclipse.jface.dialogs.Dialog
-
configureShell
protected void configureShell(org.eclipse.swt.widgets.Shell newShell)
- Overrides:
configureShellin classorg.eclipse.jface.window.Window
-
createButtonBar
protected org.eclipse.swt.widgets.Control createButtonBar(org.eclipse.swt.widgets.Composite parent)
- Overrides:
createButtonBarin classorg.eclipse.jface.dialogs.TrayDialog
-
-