Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » How to bring to top without activating?
How to bring to top without activating? [message #325725] Tue, 26 February 2008 05:51 Go to next message
Kristen Kurimoto is currently offline Kristen KurimotoFriend
Messages: 2
Registered: July 2009
Junior Member
I am trying to programatically open editors and bring each in turn to the
top without activating them. The key is that my application has the
concept of a main window, and these editors are opening in a second
window. I want to leave focus in the main window so that users can
continue working as these editors are opening. I'm seeing two problems:

1. WorkbenchPage.openEditor is activating the editor even when I specify
activate=false. This happens because of problem 2.

2. WorkbenchPage.bringToTop is always making the editor active because
newPartContainer == activeEditorContainer

This seems like an Eclipse bug that was introduced in 3.3. Does anyone
know what changed and if there is a workaround?

Thanks.
Re: How to bring to top without activating? [message #325766 is a reply to message #325725] Tue, 26 February 2008 15:25 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Kristen Kurimoto wrote:
> 1. WorkbenchPage.openEditor is activating the editor even when I
> specify activate=false. This happens because of problem 2.
>
> 2. WorkbenchPage.bringToTop is always making the editor active because
> newPartContainer == activeEditorContainer

It will make it the activeEditor ... which isn't the same as making it
active, the same way when you link with editor and click on an file in
the package explorer, the associated open editor comes to the top ...
but the package explorer is still active.

>
> This seems like an Eclipse bug that was introduced in 3.3. Does anyone
> know what changed and if there is a workaround?

The bug is bringing to secondary window to the front? and it didn't use
to do this in 3.2?

It always made the new editor the active editor (just not the active part).

Later,
PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/workbench.htm


Re: How to bring to top without activating? [message #325785 is a reply to message #325766] Wed, 27 February 2008 03:20 Go to previous messageGo to next message
Kristen Kurimoto is currently offline Kristen KurimotoFriend
Messages: 2
Registered: July 2009
Junior Member
Thanks, Paul. You're right; makeActiveEditor was not the cause of the
bug. We were setting focus somewhere else. If I remove all setFocus
calls and never interact with that window, then it behaves as expected.

However I still have a question about active parts in multi-window
situations.

I get the desired behavior if I bringToTop the editors in window 1 and
have some non-editor part active in window 1. I can interact all I want
in window 2 and bringing the editors to the top in window 1 never steals
focus because newPartContainer != activePartContainer.

On the other hand, I don't get the desired behavior if I do the following:
1. makeActive an editor in window 1
2. setActivePart in window 2 by interacting with it
3. Programatically bringToTop an editor in window 1. At this point,
newPartContainer == activePartContainer. This causes the editor in window
1 to be activated, and thus takes focus from window 2. Is this by design?

Thanks for your help.
Re: How to bring to top without activating? [message #325799 is a reply to message #325785] Wed, 27 February 2008 13:56 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

AFAIK that is design intent ... being an IDE and activating and editor
(where the active part was the active editor) will force it to the top.

To be honest we very rarely touch that kind of behaviour (presentation
order of events, etc) these days. I think it would be hard to
distinguish between "just the active editor" which activates and sets
focus and "bring to the top but don't set focus when the active editor
had focus" ... that's a tangled set of events :-)

Later,
PW


--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/workbench.htm


Previous Topic:Using Plug-in properties API?
Next Topic:activeFocusControlId with detached view
Goto Forum:
  


Current Time: Sat Dec 21 12:43:46 GMT 2024

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

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

Back to the top