Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » Customize EssentialOCL editor
Customize EssentialOCL editor [message #872050] Tue, 15 May 2012 07:32 Go to next message
Matthias Erche is currently offline Matthias Erche
Messages: 19
Registered: July 2009
Junior Member
Hi,

I've successfully integrated the EssentialOCL xtext editor using org.eclipse.xtext.ui.editor.embedded.EmbeddedEditor in an example application. I use org.eclipse.ocl.examples.xtext.essentialocl.ui.model.BaseDocument.setContext(...) to define the classifier context of the OCL expression.

Everything is working fine except that I only can use classes, attributes and operations coming from the same EPackage the classifier context is contained in. The content assist doesn't show elements from other registered EPackages and when I try to use such elements in the OCL expression I get "Unresolved namespace" and "Unresolved property" errors.

Is there a way to register the contents of other EPackages?

I'm using MDT OCL 3.1.2a and XText 2.2.1

Regards,

Matthias Erche

[Updated on: Tue, 15 May 2012 07:34]

Report message to a moderator

Re: Customize EssentialOCL editor [message #873181 is a reply to message #872050] Thu, 17 May 2012 12:29 Go to previous message
Ed Willink is currently offline Ed Willink
Messages: 3842
Registered: July 2009
Senior Member
Hi

Yes.

Just like Java, you must qualify such names.

Just like Java, you can import or locally qualify.

If using OCLinEcore or Complete OCL you can use an import statement.

If using Java, you need to instruct the metaModelManager to
loadResource(); searcg the source code for examples.

If using EssentialOCL you can use URI qualification: _'myURI'::... ;
this has a bug fix in M7.

Regards

Ed Willink

On 15/05/2012 12:32, Matthias Erche wrote:
> Hi,
>
> I've successfully integrated the EssentialOCL xtext editor using
> org.eclipse.xtext.ui.editor.embedded.EmbeddedEditor in an example
> application. I use
> org.eclipse.ocl.examples.xtext.essentialocl.ui.model.BaseDocument.setContext(...)
> to define the classifier context of the OCL expression.
>
> Everything is working fine except that I only can use classes,
> attributes and operations coming from the same EPackage the classifier
> context is contained in. The content assist doesn't show elements from
> other registered EPackages and when I try to use such elements in the
> OCL expression I get "Unresolved namespace" and "Unresolved property"
> errors.
>
> Is there a way to register the contents of other EPackages?
>
> Regards,
>
> Matthias Erche
Previous Topic:[Doubt]OCL integration EMF
Next Topic:[Announce] Eclipse OCL 4.0.0 (Juno) RC1 is now available
Goto Forum:
  


Current Time: Thu Apr 17 21:03:18 EDT 2014

Powered by FUDForum. Page generated in 0.02339 seconds