Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Tracking save events of a particular wst editor kind
Tracking save events of a particular wst editor kind [message #222551] Thu, 02 October 2008 06:51 Go to next message
Ralf Ebert is currently offline Ralf Ebert
Messages: 72
Registered: July 2009
Member
Hi,

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

I'm

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!

--
Ralf Ebert
http://www.ralfebert.de/ : Java developer, consultant and trainer
http://code.google.com/p/swtxml/ : Lightweight SWT markup language
Re: Tracking save events of a particular wst editor kind [message #222573 is a reply to message #222551] Mon, 06 October 2008 06:24 Go to previous message
Nitin Dahyabhai is currently offline Nitin Dahyabhai
Messages: 2251
Registered: July 2009
Senior Member
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
>
>
> I'm
> 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.

--
---
Nitin Dahyabhai
Eclipse WTP Source Editing
IBM Rational


---
Nitin Dahyabhai
Eclipse WTP, IBM
Previous Topic:How to add "New Project" wizard to the Java EE Perspective?
Next Topic:JSP script parsing
Goto Forum:
  


Current Time: Sat Aug 30 14:46:14 EDT 2014

Powered by FUDForum. Page generated in 0.01625 seconds