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

    Fields
    Modifier and Type
    Field
    Description
    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.
    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

    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

    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
    Returns configured of minimal size of ItemSelectionDialog (400 x 370)
    Returns an array of objects that user chose in the dialog.
     
    protected void
    Saves user selection and closes the dialog
    void
    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

      protected ILabelProvider labelProvider
      ILabelProvider to be used at the dialog to provide elements presentation.
    • contentProvider

      protected IContentProvider contentProvider
      IContentProvider to be used at the dialog to provide elements to show.
    • dialogValidator

      protected org.eclipse.core.databinding.validation.IValidator<IStructuredSelection> dialogValidator
      IValidator to show validation messages at the dialog if needed.
    • context

      protected Object context
      Dialog elements container.
    • multiselect

      protected final boolean multiselect
      Flag showing if multiselection is available for this dialog instance.
    • selection

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

    • getResult

      public Object[] getResult()
      Description copied from interface: ISwtSelectionDialog
      Returns an array of objects that user chose in the dialog.
      Specified by:
      getResult in interface ISwtSelectionDialog
      Returns:
      the result of the dialog.
    • getSelection

      public IStructuredSelection 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 - the IValidator 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 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