|
Re: How can I prevent a view from closing [message #465625 is a reply to message #465622] |
Tue, 03 April 2007 13:36 |
Eclipse User |
|
|
|
Originally posted by: valere.fedronic.ext.streamezzo.com
KarSc wrote:
> Hi all,
>
> I have a view (part of a plug-in I made) that runs into eclipse.
>
>
>
> I would like to be able to stop this view from closing...
>
>
>
> What is the best way to do it?
>
> Note: this is not part of an RCP, the plug-in runs in eclipse.
>
>
>
> Regards
>
> Kar
>
>
>
>
If you declare your own perspective, you can set your view as
non-closeable :
/*IPerspectiveFactory#createInitialLayout(org.eclipse.ui.IPa geLayout)*/
layout.getViewLayout(YourViewPart.ID).setCloseable(false);
valere.
|
|
|
|
Re: How can I prevent a view from closing [message #465633 is a reply to message #465627] |
Tue, 03 April 2007 16:42 |
Eclipse User |
|
|
|
Originally posted by: valere.fedronic.ext.streamezzo.com
You can try to register a partlistener (IPartListener) and hook some
code in the IPartListner#partClosed(IWorkbenchPart part) method.
/*snippet (in your viewpart code)*/
IPartService partService =
(IPartService)getSite().getService(IPartService.class);
partService.addPartListener(listener);
This notifies you that your part is already closed but perhaps you can
try to re-open it if needed.
valere.
KarSc wrote:
> Hello Valere,
> the problem is that i want to gain control on the closing ... i mean ...
> once the view is going down i would like to display a dialog asking for
> confirmation ...
> if i will go for the YES i will close all the linked editor otherwise
> nothing change.
>
> Kar
>
>
>
> "valere fedronic" <valere.fedronic.ext@streamezzo.com> wrote in message
> news:eutla5$nmu$2@build.eclipse.org...
>> KarSc wrote:
>>> Hi all,
>>>
>>> I have a view (part of a plug-in I made) that runs into eclipse.
>>>
>>>
>>>
>>> I would like to be able to stop this view from closing...
>>>
>>>
>>>
>>> What is the best way to do it?
>>>
>>> Note: this is not part of an RCP, the plug-in runs in eclipse.
>>>
>>>
>>>
>>> Regards
>>>
>>> Kar
>>>
>>>
>>>
>>>
>> If you declare your own perspective, you can set your view as
>> non-closeable :
>>
>> /*IPerspectiveFactory#createInitialLayout(org.eclipse.ui.IPa geLayout)*/
>> layout.getViewLayout(YourViewPart.ID).setCloseable(false);
>>
>>
>> valere.
>
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.03521 seconds