Home » Eclipse Projects » Eclipse Platform » Dirty editor
| |
Re: Dirty editor [message #284836 is a reply to message #284811] |
Tue, 03 May 2005 06:11   |
Eclipse User |
|
|
|
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 09:11   |
Eclipse User |
|
|
|
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 02:14   |
Eclipse User |
|
|
|
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 02:25  |
Eclipse User |
|
|
|
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
>>>>>
>>>>>
>>>
>
|
|
|
Goto Forum:
Current Time: Tue May 06 14:55:32 EDT 2025
Powered by FUDForum. Page generated in 0.04894 seconds
|