Home » Eclipse Projects » Eclipse Platform » Dirty editor
Dirty editor [message #284792] |
Mon, 02 May 2005 11:30 ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
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 message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
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 message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
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 message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
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 message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
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 Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
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: Thu Sep 05 09:01:42 GMT 2024
Powered by FUDForum. Page generated in 0.04081 seconds
|