|UML validation from org.eclipse.emf.validation.examples.general [message #490962]
||Mon, 12 October 2009 11:30
Registered: October 2009
i'm trying to develop a UML validator plugin to create and validate contraints for a certain UML profile.
As a total beginner with eclipse plugin technology and emf in general and thus I'm very confused. So I've decided to start from the org.eclipse.emf.validation.examples.general example to see what I can get.
What I need is a button (or a method to override the "Validate" button in the UML editor) which allows me to do some constraint checks for my particular UML profile. For simplicity, at the moment it's enough that I succeed in validate a plain UML model without a profile.
Unfortunately I'm not succeeded in the modification of such example, as I get a button "Validation_1" in the menu of UML editor which doesn't call the constraint I've defined.
The steps of my modification are described as follows:
1- in the plugin.xml I've added (I know that it's not what I want since in this way I get a menu and a button but it's not a big problem now)
class=" org.eclipse.emf.validation.examples.general.actions.BatchVal idationDelegate "
2- in the plugin.xml I've modified the line
<package namespaceUri=" http:///org/eclipse/emf/metamodel/example/pde/library.ecore/ 1.0.0"/>
3- in the file "BatchValidationDelegate.java" I've modified the type of the type of the editor reference from "EXTLibraryEditor" to "UMLEditor" (and the relative cast in the "setActiveEditor" method)
4- in the definition of the example of constraint in "NonEmptyNamesConstraint.java" I've just added a debug message to see if whenever I press the "Validation_1" button I get the message in the console (with the line "ConsoleUtil.printError("DEBUG", "Constraint Processing");")
When I start the example as an eclipse plugin and I press the Validation_1 button the message "Constraint Processing" doesn't not appear even if the action of the button (BatchValidationDelegate) is called correctly. It seems I've missed something in the ragistration of the constraint for the UML model but I can't see other places to modify in order to get the example working.
Can somebody tells me the correct way to proceed?
Powered by FUDForum
. Page generated in 0.01407 seconds