@OpenApiAll
public class SelectionProvider
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
class |
SelectionProvider.SelectionChangedEvent
Event to collect information after selection changed
|
static interface |
SelectionProvider.SelectionChangedListener
Selection changed listener
|
Modifier and Type | Field and Description |
---|---|
protected BaseElement |
mainElement
Selected or active element which has higher priority than other selected elements or when there are no selected elements
|
protected java.util.Collection<? extends BaseElement> |
selectedElements
Selected elements
|
Constructor and Description |
---|
SelectionProvider() |
Modifier and Type | Method and Description |
---|---|
void |
addSelectionChangedListener(SelectionProvider.SelectionChangedListener listener)
Adds selection changed listener
|
static SelectionProvider |
getInstance(Project project)
Returns selection provider
|
BaseElement |
getMainElement()
Returns main element
|
java.util.Collection<? extends BaseElement> |
getSelectedElements()
Returns selected elements
|
protected java.util.List<SelectionProvider.SelectionChangedListener> |
getSelectionChangedListeners() |
void |
removeSelectionChangedListener(SelectionProvider.SelectionChangedListener listener)
Removes selection changed listener
|
protected java.util.Collection<? extends BaseElement> selectedElements
@CheckForNull protected BaseElement mainElement
public static SelectionProvider getInstance(Project project)
project
- where are selected elementspublic final java.util.Collection<? extends BaseElement> getSelectedElements()
@CheckForNull public BaseElement getMainElement()
public void addSelectionChangedListener(SelectionProvider.SelectionChangedListener listener)
listener
- to addpublic void removeSelectionChangedListener(SelectionProvider.SelectionChangedListener listener)
listener
- to removeprotected java.util.List<SelectionProvider.SelectionChangedListener> getSelectionChangedListeners()