Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (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 10:51 Go to next message
Ralf Ebert is currently offline Ralf EbertFriend
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 10:24 Go to previous message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4435
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 Web Tools Platform
Previous Topic:How to add "New Project" wizard to the Java EE Perspective?
Next Topic:JSP script parsing
Goto Forum:
  


Current Time: Tue Apr 23 07:18:57 GMT 2024

Powered by FUDForum. Page generated in 0.02817 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top