Package com.nomagic.magicdraw.ui
Class SelectionProvider
- java.lang.Object
-
- com.nomagic.magicdraw.ui.SelectionProvider
-
@OpenApiAll public class SelectionProvider extends java.lang.Object
Selection provider to manage selected elements in browser and diagrams
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
SelectionProvider.Selection
static class
SelectionProvider.SelectionChangedEvent
An event which indicates selection change.static interface
SelectionProvider.SelectionChangedListener
Selection changed listener
-
Field Summary
Fields Modifier and Type Field Description protected SelectionProvider.Selection
selection
-
Constructor Summary
Constructors Constructor Description SelectionProvider()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addSelectionChangedListener(SelectionProvider.SelectionChangedListener listener)
Adds selection changed listenerprotected void
fireSelectionChanged(SelectionProvider.SelectionChangedEvent event)
static SelectionProvider
getInstance(Project project)
Returns selection providerBaseElement
getMainElement()
Returns main elementjava.util.Collection<? extends BaseElement>
getSelectedElements()
Returns selected elementsSelectionProvider.Selection
getSelection()
void
removeSelectionChangedListener(SelectionProvider.SelectionChangedListener listener)
Removes selection changed listener
-
-
-
Field Detail
-
selection
protected SelectionProvider.Selection selection
-
-
Method Detail
-
getInstance
public static SelectionProvider getInstance(Project project)
Returns selection provider- Parameters:
project
- where are selected elements- Returns:
- selection provider
-
getSelection
public final SelectionProvider.Selection getSelection()
- Returns:
- active selection
-
getSelectedElements
public final java.util.Collection<? extends BaseElement> getSelectedElements()
Returns selected elements
-
getMainElement
@CheckForNull public final BaseElement getMainElement()
Returns main element
-
addSelectionChangedListener
public void addSelectionChangedListener(SelectionProvider.SelectionChangedListener listener)
Adds selection changed listener- Parameters:
listener
- to add
-
removeSelectionChangedListener
public void removeSelectionChangedListener(SelectionProvider.SelectionChangedListener listener)
Removes selection changed listener- Parameters:
listener
- to remove
-
fireSelectionChanged
protected void fireSelectionChanged(SelectionProvider.SelectionChangedEvent event)
-
-