Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Open View, and bring it to front?
Open View, and bring it to front? [message #301183] Fri, 24 March 2006 15:12 Go to next message
Paul E. Keyser is currently offline Paul E. KeyserFriend
Messages: 878
Registered: July 2009
Senior Member
R3.1.1, WinXP

To open a view I know how to do:

PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActi vePage().showView() ...

But if the user has previously "tabbed" (or whatever is the correct term) the view in question
behind another View, this does *not* bring the view to the front. I've tried showView(ID_VIEW),
showView(ID_VIEW, null, IWorkbenchPage.VIEW_ACTIVATE), and showView(ID_VIEW, null,
IWorkbenchPage.VIEW_VISIBLE). (My view does not allow multiple instances.)

There does not seem to be a method in IViewPart that would be relevant.

Have I missed something, or is this an oversight by Eclipse, or just a bug?

thanks,
Paul
Re: Open View, and bring it to front? [message #301190 is a reply to message #301183] Fri, 24 March 2006 16:13 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Paul Keyser wrote:
> R3.1.1, WinXP
>
> To open a view I know how to do:
>
> PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActi vePage().showView()
> ...

I'm surprised that showView(id) doesn't activate the view.

showView(id) calls showView(id, null, VIEW_ACTIVATE) which looks up the
viewpart and then calls IWorkbenchPage#activate(part).

If you can put together a usecase where this isn't working, please open
a bug at https://bugs.eclipse.org/bugs/

Later,
PW


Re: Open View, and bring it to front? [message #301205 is a reply to message #301190] Fri, 24 March 2006 18:35 Go to previous messageGo to next message
Paul E. Keyser is currently offline Paul E. KeyserFriend
Messages: 878
Registered: July 2009
Senior Member
Doh on me: I was first calling findView(ID), and *only* calling showView(ID) if the findView()
returned null -- i.e., I had misunderstood the intent of the two methods, thinking that a null
return from findView() meant that the View needed to be opened or made visible, whereas a null
return seems to mean only that the ID is bad (or something like that). If I simply always call
showView(ID), the view is indeed brought to the front.

thanks, sorry for extra trouble,
Paul
Re: Open View, and bring it to front? [message #301216 is a reply to message #301205] Fri, 24 March 2006 19:24 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Paul Keyser wrote:
> Doh on me: I was first calling findView(ID), and *only* calling
> showView(ID) if the findView() returned null -- i.e., I had
> misunderstood the intent of the two methods, thinking that a null return
> from findView() meant that the View needed to be opened or made visible,

Actually, findView(*) will return the IViewPart if the view is currently
open (visible or not).

showView(*) for all intents and purposes does a findView(*), and if the
view is in the page does an activate(part) ... if the findView(*)
returned null, then it actually tries to create the view.

Later,
PW


Previous Topic:Does Eclipse 3.1.X supports plugins with embedded jars?
Next Topic:Printing With ECLIPSE
Goto Forum:
  


Current Time: Wed Jul 17 20:21:19 GMT 2024

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

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

Back to the top