Class 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
    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.eclipse.jface.window.Window

        org.eclipse.jface.window.Window.IExceptionHandler
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected IContentProvider contentProvider  
      protected Object context  
      protected org.eclipse.core.databinding.validation.IValidator dialogValidator  
      protected ILabelProvider labelProvider  
      protected boolean multiselect  
      protected IStructuredSelection selection  
      • 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

      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 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 handlers
      protected org.eclipse.swt.graphics.Point getInitialSize()
      Returns configured of minimal size of ItemSelectionDialog (400 x 370)
      Object[] getResult()
      Returns an array of objects that user chose in the dialog.
      IStructuredSelection getSelection()  
      protected void okPressed()
      Saves user selection and closes the dialog
      void setDialogValidator​(org.eclipse.core.databinding.validation.IValidator dialogValidator)
      Sets the dialog result validator.
      protected abstract void updateSelection()
      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
    • Field Detail

      • dialogValidator

        protected org.eclipse.core.databinding.validation.IValidator dialogValidator
      • context

        protected Object context
      • multiselect

        protected final boolean multiselect
    • 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 shell
        context - - eObject feature container
        selection - - container for selected element(s)
        labelProvider - - label provider for viewer
        contentProvider - - content provider for viewer
        windowTitle - - dialog window title text
        multiselect - - flag, indicating that dialog supports or not multiselection
        isEditable - - flag indicating that dialog is in read-only editable
    • Method Detail

      • 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 - the IValidator object.
      • 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 class org.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 class org.eclipse.jface.dialogs.TitleAreaDialog
      • okPressed

        protected void okPressed()
        Saves user selection and closes the dialog
        Overrides:
        okPressed in class org.eclipse.jface.dialogs.Dialog
      • configureShell

        protected void configureShell​(org.eclipse.swt.widgets.Shell newShell)
        Overrides:
        configureShell in class org.eclipse.jface.window.Window
      • createButtonBar

        protected org.eclipse.swt.widgets.Control createButtonBar​(org.eclipse.swt.widgets.Composite parent)
        Overrides:
        createButtonBar in class org.eclipse.jface.dialogs.TrayDialog