@OpenApiAll
public final class AnnotationManager
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
boolean |
add(Annotation annotation)
Add single annotation.
|
boolean |
add(Annotation annotation,
AnnotationCategory category)
Add single annotation.
|
void |
addAnnotationParentTargetProvider(AnnotationTargetParentProvider provider) |
void |
addListener(AnnotationManagerListener listener) |
java.util.Collection<BaseElement> |
getAnnotatedElements()
Returns a collection of annotated elements
|
java.util.Collection<BaseElement> |
getAnnotatedElements(AnnotationSubset subset)
Returns a collection of annotated elements
|
java.util.Collection<BaseElement> |
getAnnotatedElements(Project project)
Returns a collection of annotated elements in the given project
|
java.util.Collection<BaseElement> |
getAnnotatedElements(Project project,
AnnotationSubset subset)
Returns a collection of annotated elements in the given project
|
java.util.Set<java.lang.Object> |
getAnnotatedTargets(AnnotationSubset subset)
Returns targets of the registered annotations.
|
java.util.List<Annotation> |
getAnnotations(BaseElement element)
Get all annotations for particular element.
|
java.util.List<Annotation> |
getAnnotations(BaseElement element,
AnnotationSubset subset) |
java.util.List<Annotation> |
getAnnotations(java.lang.Object target) |
java.util.List<Annotation> |
getAnnotations(java.lang.Object target,
AnnotationSubset subset) |
java.util.List<Annotation> |
getAnnotationsOfChildren(BaseElement element) |
java.util.List<Annotation> |
getAnnotationsOfChildren(BaseElement element,
AnnotationSubset subset)
Get all annotations of children of given element.
|
java.util.List<Annotation> |
getAnnotationsOfHiddenChildren(PresentationElement view)
Get all annotations of closest hidden children(recursively) of given symbol.
|
java.util.List<Annotation> |
getAnnotationsOfHiddenChildren(PresentationElement view,
AnnotationSubset subset)
Get all annotations of closest hidden children(recursively) of given symbol.
|
static AnnotationManager |
getInstance()
Get instance of AnnotationManager object.
|
java.util.Iterator<BaseElement> |
getIteratorOfAnnotatedElements(BaseElement owner)
Returns a collection of annotated elements
|
java.util.Iterator<Annotation> |
getIteratorOfAnnotationsOfChildren(BaseElement element) |
java.util.Iterator<Annotation> |
getIteratorOfAnnotationsOfChildren(BaseElement element,
AnnotationSubset subset) |
boolean |
hasAnnotatedChildren(BaseElement element)
Test if given element has children (recursively) with some annotations.
|
boolean |
hasAnnotatedChildren(BaseElement element,
AnnotationSubset subset)
Test if given element has children (recursively) with some annotations.
|
boolean |
hasAnnotations() |
boolean |
hasAnnotations(BaseElement element,
AnnotationSubset subset) |
boolean |
hasAnnotations(java.lang.Object target,
AnnotationSubset subset) |
(package private) boolean |
isAncestor(BaseElement ancestor,
BaseElement child) |
void |
registerSubset(AnnotationSubset subset)
Register subset (part) of annotations.
|
boolean |
remove(Annotation annotation)
Remove single annotation.
|
void |
removeAnnotationParentTargetProvider(AnnotationTargetParentProvider provider) |
void |
removeListener(AnnotationManagerListener listener) |
void |
unregisterSubset(AnnotationSubset subset) |
void |
update()
Repaint only opened diagrams of an active project
|
void |
update(java.util.Collection<? extends Annotation> removed,
java.util.Collection<Annotation> added)
Updates annotation manager using specified data.
|
void |
update(java.util.Collection<? extends Annotation> removed,
java.util.Collection<Annotation> added,
AnnotationCategory category)
Updates annotation manager using specified data.
|
public void addAnnotationParentTargetProvider(AnnotationTargetParentProvider provider)
public void removeAnnotationParentTargetProvider(AnnotationTargetParentProvider provider)
public static AnnotationManager getInstance()
public boolean add(Annotation annotation)
update()
method has been called.annotation
- annotation to addpublic boolean add(Annotation annotation, AnnotationCategory category)
update()
method has been called.annotation
- annotation to addcategory
- category to which this annotation belongs. Each category can be part of various AnnotationSubsetspublic boolean remove(Annotation annotation)
update()
method has been called.annotation
- annotation to removepublic boolean hasAnnotatedChildren(@CheckForNull BaseElement element)
element
- given elementpublic boolean hasAnnotatedChildren(@CheckForNull BaseElement element, AnnotationSubset subset)
element
- given elementsubset
- subset (part) of all currently registered annotations to check.public java.util.List<Annotation> getAnnotationsOfChildren(BaseElement element)
public java.util.List<Annotation> getAnnotationsOfChildren(BaseElement element, AnnotationSubset subset)
element
- given elementsubset
- subset (part) of all currently registered children annotations to retrievepublic java.util.List<Annotation> getAnnotationsOfHiddenChildren(PresentationElement view)
view
- symbol of starting PE. dedicated to find closest hidden elements for diagrams.public java.util.List<Annotation> getAnnotationsOfHiddenChildren(PresentationElement view, AnnotationSubset subset)
view
- symbol of starting PE. dedicated to find closest hidden elements for diagrams.subset
- subset (part) of all currently registered hidden children annotations to check.public java.util.List<Annotation> getAnnotations(BaseElement element)
element
- element to get annotations forpublic java.util.List<Annotation> getAnnotations(BaseElement element, AnnotationSubset subset)
element
- element to get annotations forsubset
- subset (part) of all currently registered annotations to retrieve.public java.util.List<Annotation> getAnnotations(java.lang.Object target)
public java.util.List<Annotation> getAnnotations(java.lang.Object target, AnnotationSubset subset)
public boolean hasAnnotations(BaseElement element, AnnotationSubset subset)
public boolean hasAnnotations(java.lang.Object target, AnnotationSubset subset)
public void update()
public java.util.Collection<BaseElement> getAnnotatedElements()
public java.util.Collection<BaseElement> getAnnotatedElements(Project project)
project
- projectpublic java.util.Collection<BaseElement> getAnnotatedElements(AnnotationSubset subset)
subset
- subset (part) of all currently registered annotations to take into account.public java.util.Collection<BaseElement> getAnnotatedElements(Project project, AnnotationSubset subset)
project
- projectsubset
- subset (part) of all currently registered annotations to take into account.public java.util.Set<java.lang.Object> getAnnotatedTargets(AnnotationSubset subset)
subset
- subset (part) of all currently registered annotations to take into account.public java.util.Iterator<BaseElement> getIteratorOfAnnotatedElements(@CheckForNull BaseElement owner)
public void update(java.util.Collection<? extends Annotation> removed, java.util.Collection<Annotation> added)
removed
- collection of removed annotations.added
- collection of added annotations.public void update(java.util.Collection<? extends Annotation> removed, java.util.Collection<Annotation> added, AnnotationCategory category)
removed
- collection of removed annotations.added
- collection of added annotations.category
- category to which annotations belongspublic void addListener(AnnotationManagerListener listener)
public void removeListener(AnnotationManagerListener listener)
public boolean hasAnnotations()
public java.util.Iterator<Annotation> getIteratorOfAnnotationsOfChildren(BaseElement element)
public java.util.Iterator<Annotation> getIteratorOfAnnotationsOfChildren(BaseElement element, AnnotationSubset subset)
public void registerSubset(AnnotationSubset subset)
public void unregisterSubset(AnnotationSubset subset)
boolean isAncestor(BaseElement ancestor, BaseElement child)