Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Dirty editor
Dirty editor [message #284792] Mon, 02 May 2005 11:30 Go to next message
Eclipse UserFriend
Originally posted by: jsridhar.sdf.lonestar.org

I have the following situation. I have an editor where an object in a view
is opened for editing. The user makes some changes to the object, and then
decides to close the editor. At closing, he is asked whether to save the
object and if the user chooses No, I need to determine this. When the user
answers Yes, the workbench invokes doSave() at which point the object can
be saved. But when the user answers No, I need to find this out so I can
reload the object (since it is dirty and the user has indicated that he
does not want to keep the changes).

I looked around but could not find anything of relevance.

Thanks in advance
Re: Dirty editor [message #284811 is a reply to message #284792] Mon, 02 May 2005 18:20 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bob.objfac.com

Why do you need to do this? The editor is closing; if it is reopened
later, it will reload the object.

If the issue is that you have something other than the editor using the
same contents, the solution is: when all editors for the object close,
stop using the document contents and start using the resource contents
(from disk).

Bob Foster

exquisitus wrote:
> I have the following situation. I have an editor where an object in a
> view is opened for editing. The user makes some changes to the object,
> and then decides to close the editor. At closing, he is asked whether to
> save the object and if the user chooses No, I need to determine this.
> When the user answers Yes, the workbench invokes doSave() at which point
> the object can be saved. But when the user answers No, I need to find
> this out so I can reload the object (since it is dirty and the user has
> indicated that he does not want to keep the changes).
>
> I looked around but could not find anything of relevance.
>
> Thanks in advance
>
>
Re: Dirty editor [message #284836 is a reply to message #284811] Tue, 03 May 2005 10:11 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jsridhar.sdf.lonestar.org

Bob Foster wrote:

> Why do you need to do this? The editor is closing; if it is reopened
> later, it will reload the object.

> If the issue is that you have something other than the editor using the
> same contents, the solution is: when all editors for the object close,
> stop using the document contents and start using the resource contents
> (from disk).

This is exactly my issue. I have something other than the editor using the
same content, and if the user refused the save offer, I need to know that
to reload the resource from disk.

Sridhar


> Bob Foster

> exquisitus wrote:
>> I have the following situation. I have an editor where an object in a
>> view is opened for editing. The user makes some changes to the object,
>> and then decides to close the editor. At closing, he is asked whether to
>> save the object and if the user chooses No, I need to determine this.
>> When the user answers Yes, the workbench invokes doSave() at which point
>> the object can be saved. But when the user answers No, I need to find
>> this out so I can reload the object (since it is dirty and the user has
>> indicated that he does not want to keep the changes).
>>
>> I looked around but could not find anything of relevance.
>>
>> Thanks in advance
>>
>>
Re: Dirty editor [message #284837 is a reply to message #284836] Tue, 03 May 2005 13:11 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bob.objfac.com

If you can find the editor, you can find the page it's in.
IWorkbenchPage.addPartListener(). Your listener will tell you when the
editor closes.

Bob

exquisitus wrote:
> Bob Foster wrote:
>
>> Why do you need to do this? The editor is closing; if it is reopened
>> later, it will reload the object.
>
>
>> If the issue is that you have something other than the editor using
>> the same contents, the solution is: when all editors for the object
>> close, stop using the document contents and start using the resource
>> contents (from disk).
>
>
> This is exactly my issue. I have something other than the editor using
> the same content, and if the user refused the save offer, I need to know
> that to reload the resource from disk.
>
> Sridhar
>
>
>> Bob Foster
>
>
>> exquisitus wrote:
>>
>>> I have the following situation. I have an editor where an object in a
>>> view is opened for editing. The user makes some changes to the
>>> object, and then decides to close the editor. At closing, he is asked
>>> whether to save the object and if the user chooses No, I need to
>>> determine this. When the user answers Yes, the workbench invokes
>>> doSave() at which point the object can be saved. But when the user
>>> answers No, I need to find this out so I can reload the object (since
>>> it is dirty and the user has indicated that he does not want to keep
>>> the changes).
>>>
>>> I looked around but could not find anything of relevance.
>>>
>>> Thanks in advance
>>>
>>>
>
Re: Dirty editor [message #284884 is a reply to message #284837] Wed, 04 May 2005 06:14 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jsridhar.sdf.lonestar.org

Bob Foster wrote:

> If you can find the editor, you can find the page it's in.
> IWorkbenchPage.addPartListener(). Your listener will tell you when the
> editor closes.

> Bob

Yes I did find that after digging through the newsgroup. However, I am now
looking for way to request user confirmation for the closing of an editor,
and abort the closure if the user refuses. Would you know how I can do
this?

Regards
Sridhar


> exquisitus wrote:
>> Bob Foster wrote:
>>
>>> Why do you need to do this? The editor is closing; if it is reopened
>>> later, it will reload the object.
>>
>>
>>> If the issue is that you have something other than the editor using
>>> the same contents, the solution is: when all editors for the object
>>> close, stop using the document contents and start using the resource
>>> contents (from disk).
>>
>>
>> This is exactly my issue. I have something other than the editor using
>> the same content, and if the user refused the save offer, I need to know
>> that to reload the resource from disk.
>>
>> Sridhar
>>
>>
>>> Bob Foster
>>
>>
>>> exquisitus wrote:
>>>
>>>> I have the following situation. I have an editor where an object in a
>>>> view is opened for editing. The user makes some changes to the
>>>> object, and then decides to close the editor. At closing, he is asked
>>>> whether to save the object and if the user chooses No, I need to
>>>> determine this. When the user answers Yes, the workbench invokes
>>>> doSave() at which point the object can be saved. But when the user
>>>> answers No, I need to find this out so I can reload the object (since
>>>> it is dirty and the user has indicated that he does not want to keep
>>>> the changes).
>>>>
>>>> I looked around but could not find anything of relevance.
>>>>
>>>> Thanks in advance
>>>>
>>>>
>>
Re: Dirty editor [message #284885 is a reply to message #284884] Wed, 04 May 2005 06:25 Go to previous message
Eclipse UserFriend
Originally posted by: bob.objfac.com

As far as I know you can't do that. (And it would be pretty strange if
you did.)

Bob

exquisitus wrote:
> Bob Foster wrote:
>
>> If you can find the editor, you can find the page it's in.
>> IWorkbenchPage.addPartListener(). Your listener will tell you when the
>> editor closes.
>
>
>> Bob
>
>
> Yes I did find that after digging through the newsgroup. However, I am
> now looking for way to request user confirmation for the closing of an
> editor, and abort the closure if the user refuses. Would you know how I
> can do this?
>
> Regards
> Sridhar
>
>
>> exquisitus wrote:
>>
>>> Bob Foster wrote:
>>>
>>>> Why do you need to do this? The editor is closing; if it is reopened
>>>> later, it will reload the object.
>>>
>>>
>>>
>>>> If the issue is that you have something other than the editor using
>>>> the same contents, the solution is: when all editors for the object
>>>> close, stop using the document contents and start using the resource
>>>> contents (from disk).
>>>
>>>
>>>
>>> This is exactly my issue. I have something other than the editor
>>> using the same content, and if the user refused the save offer, I
>>> need to know that to reload the resource from disk.
>>>
>>> Sridhar
>>>
>>>
>>>> Bob Foster
>>>
>>>
>>>
>>>> exquisitus wrote:
>>>>
>>>>> I have the following situation. I have an editor where an object in
>>>>> a view is opened for editing. The user makes some changes to the
>>>>> object, and then decides to close the editor. At closing, he is
>>>>> asked whether to save the object and if the user chooses No, I need
>>>>> to determine this. When the user answers Yes, the workbench invokes
>>>>> doSave() at which point the object can be saved. But when the user
>>>>> answers No, I need to find this out so I can reload the object
>>>>> (since it is dirty and the user has indicated that he does not want
>>>>> to keep the changes).
>>>>>
>>>>> I looked around but could not find anything of relevance.
>>>>>
>>>>> Thanks in advance
>>>>>
>>>>>
>>>
>
Previous Topic:A Question for Editor or JavaEditor plugin Expert....
Next Topic:splitting editor area programmatically
Goto Forum:
  


Current Time: Sun Jul 07 07:41:14 GMT 2024

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

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

Back to the top