Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » UML validation from org.eclipse.emf.validation.examples.general (validate UML model using the code provided from the examples of EMF Validation)
UML validation from org.eclipse.emf.validation.examples.general [message #490962] Mon, 12 October 2009 15:30 Go to previous message
--alex--  is currently offline --alex-- Friend
Messages: 26
Registered: October 2009
Junior Member
Hi,
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)
<extension point="org.eclipse.ui.editorActions">

<editorContribution
targetID="org.eclipse.uml2.uml.editor.presentation.UMLEditorID "
id="org.eclipse.uml2.examples.uml.ui.UMLEditorContributionID ">
<menu
label="Validation_1"
path="org.eclipse.uml2.umlMenuID/additions-end"
id="Validation_1">
<separator name="additions"/>
</menu>
<action
label="Validation_1"
icon="$nl$/icons/elcl16/validate_co.gif"
class=" org.eclipse.emf.validation.examples.general.actions.BatchVal idationDelegate "
menubarPath="org.eclipse.uml2.umlMenuID/Validation_1/additions "
id="Validation_1Action"/>
</editorContribution>
</extension>

2- in the plugin.xml I've modified the line
<package namespaceUri=" http:///org/eclipse/emf/metamodel/example/pde/library.ecore/ 1.0.0"/>
in
<package namespaceUri="http://www.eclipse.org/uml2/2.1.0/UML"/>

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?
 
Read Message
Read Message
Previous Topic:Re: Problem load model
Next Topic:UML validation from org.eclipse.emf.validation.examples.general
Goto Forum:
  


Current Time: Wed Apr 24 18:10:15 GMT 2024

Powered by FUDForum. Page generated in 0.03484 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top