[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.tmf] Outline View: Creating context menu entry

Hi all,
i have implemented my first DSL using XText (0.72). It's really cool, thank you for the good work. I also played around with the generator project and created some templates using XPand. Now i'd like to add a context menu in the outline view as suggested in the XText user guide. The action launched by the menu should translate the model part represented by the selected note using a XPand template defined in the generator project.
I managed to add the menu but now i am stuck. I have to problems:
1. How can i retrieve the selected model object from the ContentOutlineNode?
From another thread in this newsgroup i learned i should use
contentOutlineNode.getEObjectHandle. But being new to XText (and EMF) i can't figure out how to go on from there.

2. How can i programmatically start an XPand transformation and provide the model and the template to be used?

Btw: In the user guide in the chapter for context menus it is mentioned to create a subclass of DefaultContentOutlineNodeAdapterFactory. I think at least since 0.72 this class is already created by the XText project wizard. Perhaps you might want to update the user guide.

Best regards,
   Rafael