Customize EssentialOCL editor [message #872050] |
Tue, 15 May 2012 07:32  |
Eclipse User |
|
|
|
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] by Moderator
|
|
|
Re: Customize EssentialOCL editor [message #873181 is a reply to message #872050] |
Thu, 17 May 2012 12:29  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.03977 seconds