Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » FormEditor Does Not Close When Project Deleted
FormEditor Does Not Close When Project Deleted [message #300481] Thu, 09 March 2006 11:47 Go to next message
Eclipse UserFriend
Originally posted by: barlock.usDOT.ibmDOT.com

Debugging a problem with a FormEditor: If the editor is open and the
associated project is deleted, the editor remains open. What mechanism do I
need to implement so that the editor closes when the project is deleted?

Chris
Re: FormEditor Does Not Close When Project Deleted [message #300510 is a reply to message #300481] Fri, 10 March 2006 06:58 Go to previous messageGo to next message
Eclipse UserFriend
Chris Barlock wrote:
> Debugging a problem with a FormEditor: If the editor is open and the
> associated project is deleted, the editor remains open. What mechanism do I
> need to implement so that the editor closes when the project is deleted?

Check in <workspace>/.metadata/.log for errors. When a project is
closed, any open editors that have a matching IEditorInput will be
requested to close. Do you have "save" code in your dispose() method?
Maybe your shutdown is throwing an exception?

Later,
PW
Re: FormEditor Does Not Close When Project Deleted [message #300609 is a reply to message #300510] Mon, 13 March 2006 15:30 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: barlock.usDOT.ibmDOT.com

> Chris Barlock wrote:
>> Debugging a problem with a FormEditor: If the editor is open and the
>> associated project is deleted, the editor remains open. What mechanism
>> do I need to implement so that the editor closes when the project is
>> deleted?
>
> Check in <workspace>/.metadata/.log for errors. When a project is closed,
> any open editors that have a matching IEditorInput will be requested to
> close. Do you have "save" code in your dispose() method? Maybe your
> shutdown is throwing an exception?

Looks like my editor's dispose method is not called, though the IEditorInput
(checked during init processing) points to the correct file that is being
edited. Which class checks for matching IEditorInputs? Maybe I can debug
into that & figure out why my editor is not being requested to close.

Chris
Re: FormEditor Does Not Close When Project Deleted [message #300630 is a reply to message #300609] Tue, 14 March 2006 07:41 Go to previous messageGo to next message
Eclipse UserFriend
Chris Barlock wrote:
>
> Looks like my editor's dispose method is not called, though the IEditorInput
> (checked during init processing) points to the correct file that is being
> edited. Which class checks for matching IEditorInputs? Maybe I can debug
> into that & figure out why my editor is not being requested to close.
>

And there were no Exceptions in the error log?

Check out findEditor(s) in WorkbenchPage and EditorManager ... I think
EditorManager does most of the work.

Later,
PW
Re: FormEditor Does Not Close When Project Deleted [message #300658 is a reply to message #300630] Tue, 14 March 2006 13:43 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: barlock.usDOT.ibmDOT.com

>> Looks like my editor's dispose method is not called, though the
>> IEditorInput (checked during init processing) points to the correct file
>> that is being edited. Which class checks for matching IEditorInputs?
>> Maybe I can debug into that & figure out why my editor is not being
>> requested to close.
>>
>
> And there were no Exceptions in the error log?
>
> Check out findEditor(s) in WorkbenchPage and EditorManager ... I think
> EditorManager does most of the work.

No Exceptions were thrown. When I delete the project with the editor open,
EditorManager.findEditor is not called at all.

Chris
Re: FormEditor Does Not Close When Project Deleted [message #300678 is a reply to message #300658] Wed, 15 March 2006 08:14 Go to previous messageGo to next message
Eclipse UserFriend
As it turns out, an editor like the AbstractTextEditor uses listeners on
it's IDocumentProvider to close itself.

Check out, AbstractTextEditor#updateDocumentProvider(IEditorInput)

That's where it hooks up the ElementStateListener. ElementStateListener
has a elementDeleted(Object) that calls close(false) on the EditorPart.
The AbstractDocumentProvider listens for resource delta's and fires
the elementDeleted event to all listeners.

You would have to do something similar.

Later,
PW
Re: FormEditor Does Not Close When Project Deleted [message #301219 is a reply to message #300678] Fri, 24 March 2006 16:15 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: barlock.usDOT.ibmDOT.com

> As it turns out, an editor like the AbstractTextEditor uses listeners on
> it's IDocumentProvider to close itself.
>
> Check out, AbstractTextEditor#updateDocumentProvider(IEditorInput)
>
> That's where it hooks up the ElementStateListener. ElementStateListener
> has a elementDeleted(Object) that calls close(false) on the EditorPart.
> The AbstractDocumentProvider listens for resource delta's and fires the
> elementDeleted event to all listeners.
>
> You would have to do something similar.

Sorry for the delay in responding -- got dragged onto other problems. Our
editor is a FormEditor. Seems to me that support for something like this
ought to be in that class or in its superclasses. No?

Chris
Re: FormEditor Does Not Close When Project Deleted [message #301278 is a reply to message #301219] Mon, 27 March 2006 07:35 Go to previous messageGo to next message
Eclipse UserFriend
Chris Barlock wrote:
>
>
> Sorry for the delay in responding -- got dragged onto other problems. Our
> editor is a FormEditor. Seems to me that support for something like this
> ought to be in that class or in its superclasses. No?
>


Maybe ... have a look up the class hierarchy and see if you can see an
IResourceChangeListeners. If you can find them, that'll tell you where
it would be listenening for those events.

On the other hand the form editor was designed to potentially handle
multiple files, or no files at all (maybe an http data source). So it
might not be listening for IResource changes.

Later,
PW
Re: FormEditor Does Not Close When Project Deleted [message #301297 is a reply to message #301278] Mon, 27 March 2006 11:14 Go to previous message
Eclipse UserFriend
Originally posted by: barlock.usDOT.ibmDOT.com

> Maybe ... have a look up the class hierarchy and see if you can see an
> IResourceChangeListeners. If you can find them, that'll tell you where it
> would be listenening for those events.
>
> On the other hand the form editor was designed to potentially handle
> multiple files, or no files at all (maybe an http data source). So it
> might not be listening for IResource changes.

Apparently, it isn't....Oh well, guess I have some coding to do! Thanks,
Paul!

Chris
Previous Topic:anything like org.eclipse.ui.actions.TextActionHandler for FormText?
Next Topic:How to resize the preference dialog?
Goto Forum:
  


Current Time: Wed Sep 24 11:08:03 EDT 2025

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

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

Back to the top