|
|
Re: catching the "close editor" event. [message #6227 is a reply to message #6170] |
Wed, 23 April 2003 10:53  |
Eclipse User |
|
|
|
Originally posted by: mccull1.does.not.like.spam.us.ibm.com
Look at the IPartListener and IPartService. It will notify you anytime a
view/editor is opened, closed, activated or deactivated. An "instanceof
IEditorPart" check will tell you if it is an Editor in the partClosed()
callback.
The EditorService class in TabNavigator
(http://sourceforge.net/projects/zclipse) uses the part service to listen
for all editor openings.
-Andrew
"kyle farnand" <kfarnand@bowstreet.com> wrote in message
news:b863qv$37s$1@rogue.oti.com...
> Woops, let me clean that up.
>
> I am trying to catch the closing of an editor (that extends EditorPart).
> According to my interpretation of the javadoc, I should be able to
> handle it by overwriting the isSaveNeededOnClose() method (from
> EditorPart). I have set a break point in this overwritten method but it
> is never hit. Is there some event I can be listening for instead?
>
> kyle farnand wrote:
> > news://news.eclipse.org:119/3E967A4F.3060506@es.ibm.com
> > news://news.eclipse.org:119/aq62a1$mg5$1@rogue.oti.com
> > news://news.eclipse.org:119/aich2g$ogr$1@rogue.oti.com
> > ......
> >
> > The above messages reference this topic but don't have an answer.
> >
> > I am trying to catch the closing of an editor (that extends EditorPart).
> > According to my interpretation of the javadoc, I should be able to
> > handle it by overwriting the isSaveNeededOnClose() method (from
> > EditorPart). I have set a break point in this overwritten method but it
> > is never hit. news://news.eclipse.org:119/3E967A4F.3060506@es.ibm.com
> > news://news.eclipse.org:119/aq62a1$mg5$1@rogue.oti.com
> > news://news.eclipse.org:119/aich2g$ogr$1@rogue.oti.com
> > ......
> >
> > The above messages reference this topic but don't have a good answer.
> >
> > I am trying to catch the closing of an editor (that extends EditorPart).
> > According to my interpretation of the javadoc, I should be able to
> > handle it by overwriting the isSaveNeededOnClose() method (from
> > EditorPart). I have set a break point in this overwritten method but it
> > is never hit. Is there some event I can be listening for instead?
> >
> > Here is javadoc:
> >
> > public boolean isSaveOnCloseNeeded()
> > Description copied from interface: IEditorPart
> > Returns whether the contents of this editor should be saved when the
> > editor is closed.
> >
>
|
|
|
Powered by
FUDForum. Page generated in 0.41304 seconds