|Re: Tracking save events of a particular wst editor kind [message #222573 is a reply to message #222551]
||Mon, 06 October 2008 10:24
| Nitin Dahyabhai
Registered: July 2009
Ralf Ebert wrote:|
> I'm trying to get an event whenever a wst editor of a particular type
> (xml with own model handler) is saved. Currently I'm doing it like this:
> http://github.com/ralfebert/swtxml/tree/master/plugins/com.s wtxml.ide/src/com/swtxml/ide/PreviewViewPart.java
> following the dirty propertychange event of the part via a workbench
> partlistener, try to adapt the part to IStructuredModel (restricted
> API), and if so, I check if it's my model handler.
> I wonder if there is a better way to accomplish this task - this was the
> only thing I could come up with after browsing the APIs for some time...
> Thanks for your help!
You may want to look at how the Outline view works. As a
PageBookView, it's up to the active editor (or part) to return the
control to show when that part is active. This makes it fairly easy
for your editor to control what's shown, as well as determine when
an update of your "preview" should occur.
Eclipse WTP Source Editing
Eclipse WTP, IBM
Powered by FUDForum
. Page generated in 0.02407 seconds