[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: IWorkbenchWindow#getPages

Hi Simon,
thanks again for answering.

A workbench window has only one workbench page.
Then the method
IWorkbenchPage[] IWorkbenchWindow#getPages();
does not make any sense at all, does it?!?!?
It will always return a 1-element array!?!?

> A workbench page has 1 or more perspective inside it.
Only one instance of a view per type exist in a
page.

I've noticed that the findView method will only search the active
perspective. Yet the javadoc does not indicate this. And there seems to be
no other API to accomplish what you are trying to do.
This is somewhat strange: I thought "page == perspective", and the API confirmed me in that before 2.0.

Yet I cannot believe that it is impossible to get all perspectives of a page.

At the moment I use a workaround, I do
PlatformUI.getWorkbench().showPerspective(NAME_OF_PERSP, WINDOW);
that at least returns the page I am looking for, but shows the perspective unnecessarily.


Chris


Open a problem report against Platform - UI

Simon :-)

"Chris" <wibni@xxxxxx> wrote in message news:3D59F083.6050909@xxxxxxxxx

Hello Simon,

Simon Arsenault wrote:

Use IWorkbenchPage.findView();

sorry, you did not get me right: I dont't have the IWorkbenchPage, that is my problem. Again, if I use aWorkbenchWindow.getPages(); I get only _one_ (the at last started perspective) page.

Situation:
- the workbench has 3 perspectives opened
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().getPages() always
returns only _one_ page although there are 3 perspectives started in
that window.

That seems to be a problem since 2.0.

So my problem is I cannot get the right page so I cannot call findView().

Thanks,

Chris


Simon :-)

"Chris" <wibni@xxxxxx> wrote in message news:3D595CEA.80704@xxxxxxxxx


Hello,

when I used
aWorkbenchWindow.getPages()
before 2.0 I got got all the pages (perspectives) from a (active)
workbench window.

Since 2.0 getPages() gets me only _one_ page (the at last started
perspective) though there are many other perspectives open in that

window.

I discovered a note at javadoc for IWorkbenchWindow#openPage: "Note:
Since release 2.0, a window is limited to contain at most one page...".
I don't understand how am I supposed to get _all_ perspectives from a
workbench window now. How can a window limited to contain at most one
page=perspective???

My Szenario: a workbench window has several perspectives opened, I want
to get the java perspective, there the package viewer and look whats
selected there. How to do that since 2.0?

Thank you,

Chris