Bug 102268 - [ViewMgmt] Finding a view in an opened but inactive perspective
Summary: [ViewMgmt] Finding a view in an opened but inactive perspective
Status: ASSIGNED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P5 enhancement with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2005-06-30 02:09 EDT by Feng Li CLA
Modified: 2019-09-06 15:37 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Feng Li CLA 2005-06-30 02:09:27 EDT
Hi All:
i can find a view from an active perspective by using:
 PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView
(ViewID);
but when i use :
 WorkbenchPage[] pages=PlatformUI.getWorkbench().getActiveWorkbenchWindow
().getPages();
 for(int i=0;i<pages.length;i++){
    return pages[i].findView(ViewID);
 }
i can't find a view opened in an inactive perspective.
Is there anyway to do this?
Thanks
Comment 1 Nick Edgar CLA 2005-06-30 09:52:17 EDT
Since Eclipse 2.1, there is only (at most) one page per window, and the page may
contain multiple perspectives.  There is currently no way of querying the
contents of inactive perspectives.  Can you provide more details of your
scenario and why it requires this?
Comment 2 Feng Li CLA 2005-06-30 21:36:28 EDT
Sure, our product is designed to be seperated into two perspective, both share 
the same model (base on EMF), and there's an action in the global toolbar, 
called switch server, i need to reset all opened views when user's switch to 
another server, whether they are active or inactive.
Comment 3 Nick Edgar CLA 2005-07-04 09:36:33 EDT
One way around this is to hook a part listener on the window when it is opened
(e.g. from the advisor's preWindowOpen method), and track partOpened and
partClosed calls, remembering the opened views in a collection.
Comment 4 Feng Li CLA 2005-07-04 21:20:00 EDT
(In reply to comment #3)
> One way around this is to hook a part listener on the window when it is 
opened
> (e.g. from the advisor's preWindowOpen method), and track partOpened and
> partClosed calls, remembering the opened views in a collection.

Thank you for your reply.
I think this method do works.
but still wish we can through the following way in the future.
WorkbenchPage[] pages=PlatformUI.getWorkbench().getActiveWorkbenchWindow
().getPages();
 for(int i=0;i<pages.length;i++){
    return pages[i].findView(ViewID);
 }
Thanks
Comment 5 Nick Edgar CLA 2006-03-15 13:28:05 EST
Reassigning bugs in component areas that are changing ownership.
Comment 6 Haris Peco CLA 2006-07-31 13:57:21 EDT
I want close particular views (multiple) in all perspective after closing database connection.

It looks impossible in legacy eclipse.I can remember all views, but can't hide view in inactive perspective.
Comment 7 Boris Bokowski CLA 2007-06-21 16:19:46 EDT
(In reply to comment #6)
> I want close particular views (multiple) in all perspective after closing
> database connection.
> 
> It looks impossible in legacy eclipse.I can remember all views, but can't hide
> view in inactive perspective.
> 

See bug 57841.
Comment 8 Boris Bokowski CLA 2009-11-11 17:31:30 EST
Remy is now responsible for watching the [ViewMgmt] category.
Comment 9 Eclipse Webmaster CLA 2019-09-06 15:33:07 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.
Comment 10 Eclipse Webmaster CLA 2019-09-06 15:37:37 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.