How to get Ecore ResourceSet from a custom View? [message #1489992] |
Thu, 27 November 2014 21:35 |
Pavel Bogachev Messages: 3 Registered: November 2014 |
Junior Member |
|
|
Hi,
I'm taking a part in a development of an XText-based Eclipse plugin for a DSL designed by our team. I need to create a View, that reflects some components of Ecore model, generated by Xtext grammar. It is going to be somewhat similar to Outline, but with many differences, e.g. it is going to be a CheckboxTreeView, have some nodes not present in grammar, restructure some parts of the tree, etc.
I'm having problems trying to access generated Resource from a my own separate View rather than from Outline View. Just like Outline, my View needs to be kept up-to-date with changes in DSL code, but I can't find a source that supplies Outline with constantly updated Resource contents.
So far, I only managed to manually pass Resource from _createChildren() method of Outline to my View. But that's obviously not the way to go, since my View shouldn't depend on OutlineView.
My attempt looks like this:
public class MyDSLOutlineTreeProvider extends DefaultOutlineTreeProvider {
def _createChildren(IOutlineNode parentNode, MyXTextGrammarRoot root) {
// ...
MyView.updateInput(
root.eResource.getResourceSet().getResources().get(0)
)
}
//...
}
I need to get same object independently from outline. How do I do that?
|
|
|
|
Powered by
FUDForum. Page generated in 0.03085 seconds