Class ElementSelectionDlgFactory
java.lang.Object
com.nomagic.magicdraw.ui.dialogs.selection.ElementSelectionDlgFactory
Element Selection dialog factory class. This factory should be used to create instances of ElementSelectionDlg
and also configure dialog initial settings.
Selecting elements via element Selection dialog
// Use ElementSelectionDlgFactory.create(...) methods to create element selection dialog. Frame dialogParent = MDDialogParentProvider.getProvider().getDialogParent(); ElementSelectionDlg dlg = ElementSelectionDlgFactory.create(dialogParent); // Use ElementSelectionDlgFactory.initSingle(...) methods to initialize the dialog with single element selection mode. ElementSelectionDlgFactory.initSingle(....); // Use ElementSelectionDlgFactory.initMultiple(...) methods to initialize the dialog with multiple element selection mode. ElementSelectionDlgFactory.initMultiple(....); // Display dialog for the user to select elements. dlg.show(); // Check if the user has clicked "Ok". if (dlg.isOkClicked()) { // Get selected element in single selection mode.a BaseElement selected = dlg.getSelectedElement(); // Get selected elements in multiple selection mode. BaseElement selected = dlg.getSelectedElements(); }
-
Method Summary
Modifier and TypeMethodDescriptionstatic Collection
collectDisplayable
(Collection displayable, Collection selectable) Collect displayable types for a given selectable types if given displayable is nullstatic ElementSelectionDlg
create()
Create an instance of the dialogstatic ElementSelectionDlg
Create an instance of dialogstatic ElementSelectionDlg
Create an instance of dialogstatic ElementSelectionDlg
Create an instance of dialogstatic ElementSelectionDlg
Create an instance of dialogstatic ElementSelectionDlg
Create an instance of dialogstatic ElementSelectionDlg
Create an instance of dialogstatic TypeFilter
createDisplayableForSelectable
(TypeFilter selectable) Create displayable types filter for a given selectable types filter.static TypeFilter
createDisplayableForSelectable
(Collection selectable) Create displayable types filter for a given selectable types.static TypeFilter
createDisplayableForSelectable
(Collection displayable, TypeFilter selectable) Create displayable types filter for a given selectable types filter if given displayable is nullstatic void
initMultiple
(ElementSelectionDlg dlg, SelectElementInfo info, TypeFilter visibleElementsFilter, TypeFilter selectableElementsFilter, boolean usedAsType, Collection<?> creatableTypes, Object[] selection) Initializes given dialog with a "multiple elements" selection mode.static void
initMultiple
(ElementSelectionDlg dlg, SelectElementInfo info, TypeFilter visibleElementsFilter, TypeFilter selectableElementsFilter, boolean usedAsType, Collection<?> creatableTypes, List<?> selection) Initializes given dialog with a "multiple elements" selection mode.static void
initMultiple
(ElementSelectionDlg dlg, SelectElementInfo info, TypeFilter visibleElementsFilter, TypeFilter selectableElementsFilter, Collection<?> creatableTypes, Object[] selection) Initializes given dialog with a "multiple elements" selection mode.static void
initMultiple
(ElementSelectionDlg dlg, SelectElementInfo info, TypeFilter visibleElementsFilter, TypeFilter selectableElementsFilter, Collection<?> creatableTypes, List<?> selection) Initializes given dialog with a "multiple elements" selection mode.static void
initMultiple
(ElementSelectionDlg dlg, SelectElementTypes types, SelectElementInfo info, Object[] selection) Initializes given dialog with a "multiple elements" selection mode.static void
initMultiple
(ElementSelectionDlg dlg, SelectElementTypes types, SelectElementInfo info, List selection) Initializes given dialog with a "multiple elements" selection mode.static void
initMultipleAsMultipleInitial
(ElementSelectionDlg dlg, SelectElementInfo info, TypeFilter visibleElementsFilter, TypeFilter selectableElementsFilter, Collection<?> creatableTypes, List<?> selection) Initializes given dialog with a "multiple elements" selection mode.static void
initSingle
(ElementSelectionDlg dlg, SelectElementInfo info, TypeFilter visibleElementsFilter, TypeFilter selectableElementsFilter, boolean usedAsType, Collection<?> creatableTypes, Object selection) Initializes given dialog with a "single element" selection mode.static void
initSingle
(ElementSelectionDlg dlg, SelectElementInfo info, TypeFilter visibleElementsFilter, TypeFilter selectableElementsFilter, Collection<?> creatableTypes, Object selection) Initializes given dialog with a "single element" selection mode.static void
initSingle
(ElementSelectionDlg dlg, SelectElementTypes types, SelectElementInfo info, Object selection) Initializes given dialog with a "single element" selection mode.
-
Method Details
-
create
Create an instance of the dialog- Returns:
- dialog instance
-
create
Create an instance of dialog- Parameters:
parent
- dialog parent- Returns:
- dialog instance
-
create
@OpenApi public static ElementSelectionDlg create(@CheckForNull Frame parent, @CheckForNull String title, @CheckForNull String helpPath) Create an instance of dialog- Parameters:
parent
- dialog parenttitle
- dialog titlehelpPath
- help id- Returns:
- dialog instance
-
create
Create an instance of dialog- Parameters:
parent
- dialog parent- Returns:
- dialog instance
-
create
@OpenApi public static ElementSelectionDlg create(@CheckForNull Window parent, @CheckForNull String title, @CheckForNull String helpPath) Create an instance of dialog- Parameters:
parent
- dialog parenttitle
- dialog titlehelpPath
- help id- Returns:
- dialog instance
-
create
Create an instance of dialog- Parameters:
parent
- dialog parent- Returns:
- dialog instance
-
create
@OpenApi public static ElementSelectionDlg create(@CheckForNull Dialog parent, @CheckForNull String title, @CheckForNull String helpPath) Create an instance of dialog- Parameters:
parent
- dialog parenttitle
- dialog titlehelpPath
- help id- Returns:
- dialog instance
-
collectDisplayable
@OpenApi public static Collection collectDisplayable(@CheckForNull Collection displayable, Collection selectable) Collect displayable types for a given selectable types if given displayable is null- Parameters:
displayable
- displayable typesselectable
- selectable types- Returns:
- displayable types
-
createDisplayableForSelectable
@OpenApi public static TypeFilter createDisplayableForSelectable(@CheckForNull Collection displayable, TypeFilter selectable) Create displayable types filter for a given selectable types filter if given displayable is null- Parameters:
displayable
- displayable typesselectable
- selectable types- Returns:
- displayable types
-
createDisplayableForSelectable
Create displayable types filter for a given selectable types filter.- Parameters:
selectable
- selectable types- Returns:
- displayable types
-
createDisplayableForSelectable
Create displayable types filter for a given selectable types.- Parameters:
selectable
- selectable types- Returns:
- displayable types
-
initSingle
@OpenApi public static void initSingle(ElementSelectionDlg dlg, SelectElementTypes types, SelectElementInfo info, @CheckForNull Object selection) Initializes given dialog with a "single element" selection mode. It means dialog will allow to select just a single element.- Parameters:
dlg
- dialogtypes
- element selection informationinfo
- dialog settingsselection
- initially selected element
-
initMultiple
@OpenApi public static void initMultiple(ElementSelectionDlg dlg, SelectElementTypes types, SelectElementInfo info, @CheckForNull Object[] selection) Initializes given dialog with a "multiple elements" selection mode. It means dialog will allow to select several elements.- Parameters:
dlg
- dialogtypes
- element selection informationinfo
- dialog settingsselection
- initially selected elements
-
initMultiple
@OpenApi public static void initMultiple(ElementSelectionDlg dlg, SelectElementTypes types, SelectElementInfo info, @CheckForNull List selection) Initializes given dialog with a "multiple elements" selection mode. It means dialog will allow to select several elements.- Parameters:
dlg
- dialogtypes
- element selection informationinfo
- dialog settingsselection
- initially selected elements
-
initSingle
@OpenApi public static void initSingle(ElementSelectionDlg dlg, SelectElementInfo info, TypeFilter visibleElementsFilter, TypeFilter selectableElementsFilter, @CheckForNull Collection<?> creatableTypes, @CheckForNull Object selection) Initializes given dialog with a "single element" selection mode. It means dialog will allow to select just a single element.- Parameters:
dlg
- dialoginfo
- dialog settingsvisibleElementsFilter
- filter providing visible elements in the dialogselectableElementsFilter
- filter providing selectable elements in the dialogcreatableTypes
- collection of creatable types (choice on Create button)selection
- initially selected element
-
initSingle
@OpenApi public static void initSingle(ElementSelectionDlg dlg, SelectElementInfo info, TypeFilter visibleElementsFilter, TypeFilter selectableElementsFilter, boolean usedAsType, @CheckForNull Collection<?> creatableTypes, @CheckForNull Object selection) Initializes given dialog with a "single element" selection mode. It means dialog will allow to select just a single element.- Parameters:
dlg
- dialoginfo
- dialog settingsvisibleElementsFilter
- filter providing visible elements in the dialogselectableElementsFilter
- filter providing selectable elements in the dialogusedAsType
- is this dialog instance is used to select some UML Type. If true, some special filters from DSL will be used for elements filteringcreatableTypes
- collection of creatable types (choice on Create button)selection
- initially selected element
-
initMultiple
@OpenApi public static void initMultiple(ElementSelectionDlg dlg, SelectElementInfo info, TypeFilter visibleElementsFilter, TypeFilter selectableElementsFilter, boolean usedAsType, @CheckForNull Collection<?> creatableTypes, @CheckForNull Object[] selection) Initializes given dialog with a "multiple elements" selection mode. It means dialog will allow to select several elements.- Parameters:
dlg
- dialoginfo
- dialog settingsvisibleElementsFilter
- filter providing visible elements in the dialogselectableElementsFilter
- filter providing selectable elements in the dialogusedAsType
- is this dialog instance is used to select some UML Type. If true, some special filters from DSL will be used for elements filteringcreatableTypes
- collection of creatable types (choice on Create button)selection
- initially selected element
-
initMultiple
@OpenApi public static void initMultiple(ElementSelectionDlg dlg, SelectElementInfo info, TypeFilter visibleElementsFilter, TypeFilter selectableElementsFilter, @CheckForNull Collection<?> creatableTypes, @CheckForNull Object[] selection) Initializes given dialog with a "multiple elements" selection mode. It means dialog will allow to select several elements.- Parameters:
dlg
- dialoginfo
- dialog settingsvisibleElementsFilter
- filter providing visible elements in the dialogselectableElementsFilter
- filter providing selectable elements in the dialogcreatableTypes
- collection of creatable types (choice on Create button)selection
- initially selected element
-
initMultiple
@OpenApi public static void initMultiple(ElementSelectionDlg dlg, SelectElementInfo info, TypeFilter visibleElementsFilter, TypeFilter selectableElementsFilter, @CheckForNull Collection<?> creatableTypes, @CheckForNull List<?> selection) Initializes given dialog with a "multiple elements" selection mode. It means dialog will allow to select several elements.- Parameters:
dlg
- dialoginfo
- dialog settingsvisibleElementsFilter
- filter providing visible elements in the dialogselectableElementsFilter
- filter providing selectable elements in the dialogcreatableTypes
- collection of creatable types (choice on Create button)selection
- initially selected element
-
initMultiple
@OpenApi public static void initMultiple(ElementSelectionDlg dlg, SelectElementInfo info, TypeFilter visibleElementsFilter, TypeFilter selectableElementsFilter, boolean usedAsType, @CheckForNull Collection<?> creatableTypes, @CheckForNull List<?> selection) Initializes given dialog with a "multiple elements" selection mode. It means dialog will allow to select several elements.- Parameters:
dlg
- dialoginfo
- dialog settingsvisibleElementsFilter
- filter providing visible elements in the dialogselectableElementsFilter
- filter providing selectable elements in the dialogusedAsType
- is this dialog instance is used to select some UML Type. If true, some special filters from DSL will be used for elements filteringcreatableTypes
- collection of creatable types (choice on Create button)selection
- initially selected element
-
initMultipleAsMultipleInitial
@OpenApi public static void initMultipleAsMultipleInitial(ElementSelectionDlg dlg, SelectElementInfo info, TypeFilter visibleElementsFilter, TypeFilter selectableElementsFilter, @CheckForNull Collection<?> creatableTypes, @CheckForNull List<?> selection) Initializes given dialog with a "multiple elements" selection mode. It means dialog will allow to select several elements. Allows to set Multiple as mode initial multiple, (All initMultiple only use SINGLE_INITIAL)- Parameters:
dlg
- dialoginfo
- dialog settingsvisibleElementsFilter
- filter providing visible elements in the dialogselectableElementsFilter
- filter providing selectable elements in the dialogcreatableTypes
- collection of creatable types (choice on Create button)selection
- initially selected element
-