Class DtSelectionFactory

    • Method Detail

      • createContextAwareIfPresented

        public static IStructuredSelection createContextAwareIfPresented​(IModelApi modelApi,
                                                                         Object... objects)
        Creates the structured selection with the specified objects.

        It creates the IModelApiAwareSelection if the provided {code modelApi} is not null.

        Parameters:
        modelApi - the IModelApi instance or null.
        objects - an objects to create selection, cannot be null.
        Returns:
        a created structured selection, never null.
      • createMultiContextAwareIfPresented

        public static IMultiSelection createMultiContextAwareIfPresented​(IModelApi modelApi,
                                                                         IStructuredSelection defaultSelection,
                                                                         String defaultSelectionLabel)
        Creates the multi selection with the specified default selection.

        It creates the IModelApiAwareSelection if the provided {code modelApi} is not null.

        Parameters:
        modelApi - the IModelApi instance or null.
        defaultSelection - the default structured selection, cannot be null.
        defaultSelectionLabel - the label for the default selection, cannot be null.
        Returns:
        a created multi selection, never null.
      • createMulti

        public static IMultiSelection createMulti​(IModelApi modelApi,
                                                  IStructuredSelection defaultSelection,
                                                  String defaultSelectionLabel)
        Creates the multi selection with the specified default selection. The created selection implements the IModelApiAwareSelection.
        Parameters:
        modelApi - the IModelApi instance, cannot be null.
        defaultSelection - the default structured selection, cannot be null.
        defaultSelectionLabel - the label for the default selection, cannot be null.
        Returns:
        a created multi selection, never null.
        Throws:
        IllegalArgumentException - if one of the specified arguments is null.
      • create

        public static IModelApiAwareSelection create​(IModelApi modelApi,
                                                     Object... objects)
        Creates the structured selection with the specified objects. The created selection implements the IModelApiAwareSelection.>
        Parameters:
        modelApi - the IModelApi instance, cannot be null.
        objects - an objects to create selection, cannot be null.
        Returns:
        a created structured selection, never null.
        Throws:
        IllegalArgumentException - if one of the specified arguments is null.