Adding a view to a perspective [message #329697] |
Tue, 01 July 2008 12:48 |
Eclipse User |
|
|
|
Originally posted by: subs._nospam_consertum.com
Hi,
I have created an update to my RCP app that has added a view to a
perspective. If the app has not been run before (i.e. a clean install),
the view appears as I expect. However, if the app has been run before
(i.e it has been updated), then the new view does not appear (as the
stored perspectives 'state' does not contain the view). I can get the
view to appear by reseting the perspective.
I want to detect this situation (the update case) and issue a message to
the user that a new view is available and ask them if they want to
display it.
Does anybody have some ideas that will point me in the right direction
for implementing this?
Thanks,
--
Derek
|
|
|
|
Re: Adding a view to a perspective [message #329732 is a reply to message #329731] |
Wed, 02 July 2008 08:26 |
Eclipse User |
|
|
|
Originally posted by: subs._nospam_consertum.com
Rahul Kamdar wrote:
> To add a view to an already existing perspective you can use the
> org.eclipse.ui.perspectiveExtensions extension point in your plugin.xml
> where you can specify the perspective and the view you wish to add. But
> doing this will add the view if not present (there won't be any prompts or
> messages to the user). I am not sure how to do that (regarding giving the
> user a message and then accordingly bringing the view up).
>
> I don't really get your notion of the app getting updated when run once so
> not sure what will really help you!
>
> Hope the perspectiveExtensions helps,
> Rahul
>
>
> "Derek" <subs@_nospam_consertum.com> wrote in message
> news:g4d939$bf0$1@build.eclipse.org...
>> Hi,
>>
>> I have created an update to my RCP app that has added a view to a
>> perspective. If the app has not been run before (i.e. a clean install),
>> the view appears as I expect. However, if the app has been run before (i.e
>> it has been updated), then the new view does not appear (as the stored
>> perspectives 'state' does not contain the view). I can get the view to
>> appear by reseting the perspective.
>>
>> I want to detect this situation (the update case) and issue a message to
>> the user that a new view is available and ask them if they want to display
>> it.
>>
>> Does anybody have some ideas that will point me in the right direction for
>> implementing this?
>>
>> Thanks,
>>
>> --
>> Derek
>
>
Rahul,
Thanks, but I already have a perspective extension that works.
My issue is this:
I already have a product that customers have installed. I am providing
an update to that product (via the Eclipse update mechanism). In this
update, I have added a new view to an existing perspective. This new
view does not appear until the customer does a "reset perspective". I
would like to automate this process, so that the users doesn't have to
do anything.
--
Derek
|
|
|
|
Re: Adding a view to a perspective [message #329791 is a reply to message #329732] |
Fri, 04 July 2008 09:41 |
Rahul Kamdar Messages: 63 Registered: July 2009 |
Member |
|
|
Hi Derek,
I think the workaround suggested by Paul is a pretty neat way of doing what
you wish to achieve. If you have any other issue with the same, maybe you
could post that.
Rahul
"Derek" <subs@_nospam_consertum.com> wrote in message
news:486B3B9F.8020004@_nospam_consertum.com...
> Rahul Kamdar wrote:
>> To add a view to an already existing perspective you can use the
>> org.eclipse.ui.perspectiveExtensions extension point in your plugin.xml
>> where you can specify the perspective and the view you wish to add. But
>> doing this will add the view if not present (there won't be any prompts
>> or messages to the user). I am not sure how to do that (regarding giving
>> the user a message and then accordingly bringing the view up).
>>
>> I don't really get your notion of the app getting updated when run once
>> so not sure what will really help you!
>>
>> Hope the perspectiveExtensions helps,
>> Rahul
>>
>>
>> "Derek" <subs@_nospam_consertum.com> wrote in message
>> news:g4d939$bf0$1@build.eclipse.org...
>>> Hi,
>>>
>>> I have created an update to my RCP app that has added a view to a
>>> perspective. If the app has not been run before (i.e. a clean install),
>>> the view appears as I expect. However, if the app has been run before
>>> (i.e it has been updated), then the new view does not appear (as the
>>> stored perspectives 'state' does not contain the view). I can get the
>>> view to appear by reseting the perspective.
>>>
>>> I want to detect this situation (the update case) and issue a message to
>>> the user that a new view is available and ask them if they want to
>>> display it.
>>>
>>> Does anybody have some ideas that will point me in the right direction
>>> for implementing this?
>>>
>>> Thanks,
>>>
>>> --
>>> Derek
>>
>>
> Rahul,
>
> Thanks, but I already have a perspective extension that works.
>
> My issue is this:
> I already have a product that customers have installed. I am providing an
> update to that product (via the Eclipse update mechanism). In this update,
> I have added a new view to an existing perspective. This new view does not
> appear until the customer does a "reset perspective". I would like to
> automate this process, so that the users doesn't have to do anything.
>
> --
> Derek
|
|
|
Re: Adding a view to a perspective [message #329792 is a reply to message #329747] |
Fri, 04 July 2008 10:46 |
Eclipse User |
|
|
|
Originally posted by: subs._nospam_consertum.com
OK. Here is what I have done.
I have registered a perspectiveListener and registered it during my
earlyStartup:
public void perspectiveActivated(IWorkbenchPage page,
IPerspectiveDescriptor desc) {
if (isMyPerspective(desc)) {
// 'my' view should be in this perspective
Perspective persp = ((WorkbenchPage) page).getActivePerspective();
IViewReference[] refs = persp.getViewReferences();
if (!containsMyView(refs)) {
// 'my' view is not currently shown
if (queryShowView()) {
// user has agreed to show 'my' view
page.showView(MY_VIEW_ID);
}
}
}
}
This works, but I get a 'access restriction' on Perspective. Is there an
API way to do this?
Thanks,
Paul Webster wrote:
> I can think of round-about ways to do it ... for example, when your
> plugin starts up read all of the relevant perspectiveExtensions from the
> IExtensionRegistry ... you can save the information you need in your
> plugin state location.
>
> Then if you startup and find the view not in your plugin state location
> file, you know it has been added or removed.
>
> PW
>
>
--
Derek
|
|
|
|
Powered by
FUDForum. Page generated in 0.04254 seconds