Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » List all views - Bug?
List all views - Bug? [message #332206] Fri, 10 October 2008 13:35
Jan Kohnert is currently offline Jan KohnertFriend
Messages: 196
Registered: July 2009
Senior Member
Hello,

I'm currently trying to get a list of all views currently opened in
eclipse.
The views of interest are custom views that have the allowMultiple flag
set to true.

The follwoing problem occures.
When running eclipse in with a "OPEN_NEW_PERSPECTIVE" value of
"OPEN_PERSPECTIVE_WINDOW" every page holds just one perspective.
It is possible to resolver all views using this code:

for (IWorkbenchWindow window
:PlatformUI.getWorkbench().getWorkbenchWindows()){
for (IWorkbenchPage page : window.getPages()){
IViewReference[] references = page.getViewReferences();
for (IViewReference reference : references){
// Restoring the view and resolving it
IViewPart view = reference.getView(true);
if (view instanceof TaskView){
list.add(view);
}
}
}
}

Unfortunately when having "OPEN_NEW_PERSPECTIVE" set to
"OPEN_PERSPECTIVE_REPLACE" (default setting) tho code above does not work
:(
The problem is the "page.getViewReferences()" part of the code. This
commands just returns the views that are or where visible in the current
eclipse session. Since eclipse saves its views and perspectives states on
shutdown this is less than a user might expect.
For instance when having two perspectives both holding TaskView views and
assuming eclipse just having finished to launch the codes just finds the
views of the perspective that is currently shown to the user. The views
that are in the second perspective are getting ignored.

Is there really no way to get a list of all views currently opened within
the workbench no matter if there are allready loaded (hav been showed
once) or not?

Is this a bug or wanted?

Jan Kohnert
Previous Topic:Equinox and RCP trainings
Next Topic:where can I get Ganymede 3.4 release of the modeling package ... not the latest 3.4.1
Goto Forum:
  


Current Time: Wed Oct 09 12:24:13 GMT 2024

Powered by FUDForum. Page generated in 0.03277 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top