@OpenApiAll public abstract class OpenedDiagramValidator extends DiagramValidator implements com.nomagic.magicdraw.core.diagram.OpenedDiagramsChangeListener
DiagramValidator
, but narrows the scope down only to currently opened diagrams.
When creating annotations, the diagrams in scope should be retrieved by using DiagramValidator.getDiagrams()
method.Constructor and Description |
---|
OpenedDiagramValidator() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
acceptDiagram(DiagramPresentationElement diagram) |
void |
dispose()
Unregisters all listeners that were registered and releases other resources.
|
void |
init(Project project,
Constraint constraint)
This is the first method that is invoked on the implementation of
the
ValidationRule interface. |
void |
openedDiagramsChanged(java.util.Collection<DiagramPresentationElement> opened,
java.util.Collection<DiagramPresentationElement> closed)
Called when opened diagrams changes.
|
getAnnotations, getDiagrams, getDiagramsStream, getPresentationElements, getProject, isElementInScope, needsRun, needsRun, run, setNeedsRun, setScopeProvider
protected boolean acceptDiagram(DiagramPresentationElement diagram)
acceptDiagram
in class DiagramValidator
DiagramValidator.getDiagrams()
methodpublic void init(Project project, Constraint constraint)
ValidationRule
ValidationRule
interface. Implementation can initialize
internal state if required.init
in interface ValidationRule
init
in class DiagramValidator
project
- a project of the constraint.constraint
- a constraint object.public void openedDiagramsChanged(java.util.Collection<DiagramPresentationElement> opened, java.util.Collection<DiagramPresentationElement> closed)
openedDiagramsChanged
in interface com.nomagic.magicdraw.core.diagram.OpenedDiagramsChangeListener
public void dispose()
DiagramValidator
dispose
in interface ValidationRule
dispose
in class DiagramValidator