Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Access EObject from an outline view filter
Access EObject from an outline view filter [message #898024] Wed, 25 July 2012 11:52 Go to next message
Jeff MAURY is currently offline Jeff MAURY
Messages: 39
Registered: July 2009
Member
Hello,

I am implementing an outline view filter.
I want to filter on nodes that have a specific feature set so I need to access the EObject from the IOutlineNode.
The way I did it was to inject a Provider<XtextResourceSet> in my filter and if the node if an EObjectNode, then resolve the EObject using the XtextResourceSet returned by the provider.
This works but this first time my filter apply method is called, the XtextResource is loaded and this seems curious to me as the resource has probably been loaded by the editor.

Thanks
Jeff
Re: Access EObject from an outline view filter [message #898039 is a reply to message #898024] Wed, 25 July 2012 12:27 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian Zarnekow
Messages: 2809
Registered: July 2009
Senior Member
Hi Jeff,

please use EObjectNode..readOnly(IUnitOfWork<T, EObject>) instead.

Best regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com

Am 25.07.12 17:52, schrieb Jeff MAURY:
> Hello,
>
> I am implementing an outline view filter.
> I want to filter on nodes that have a specific feature set so I need to
> access the EObject from the IOutlineNode.
> The way I did it was to inject a Provider<XtextResourceSet> in my filter
> and if the node if an EObjectNode, then resolve the EObject using the
> XtextResourceSet returned by the provider.
> This works but this first time my filter apply method is called, the
> XtextResource is loaded and this seems curious to me as the resource has
> probably been loaded by the editor.
>
> Thanks
> Jeff
>
Re: Access EObject from an outline view filter [message #898325 is a reply to message #898039] Thu, 26 July 2012 04:27 Go to previous message
Jeff MAURY is currently offline Jeff MAURY
Messages: 39
Registered: July 2009
Member
Thanks for the tip

Jeff
Previous Topic:Static Enumeration Literal Assignment
Next Topic:Supress generating preference and property pages for the compiler
Goto Forum:
  


Current Time: Fri Aug 29 20:34:32 EDT 2014

Powered by FUDForum. Page generated in 0.02569 seconds