Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Focus Notification
Focus Notification [message #535448] Sun, 23 May 2010 17:00 Go to next message
Sebastian is currently offline SebastianFriend
Messages: 61
Registered: March 2010
Member
Hi,

please pardon me about this question, but how is a e4 view is to be notified about having focus?

I've seen the IFocusable interface in org.eclipse.e4.workbench.ui.behaviors, but how is the setFocus() method getting called ?
Do I need to implement my own IPartListener?

Sebastian
Re: Focus Notification [message #535532 is a reply to message #535448] Mon, 24 May 2010 09:34 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Hi,

I think the IFocusable interface (Could you file a bug that we remove it
from the sources please) is a left over from 0.9. I think that there are
2 possibilities:

a) By registering an IPartListener on the EPartService
b) By getting the IServiceConstants.ACTIVE_PART injected into your
component and checking if the MPart passed is you.

I would have expected that one could also get this information by
subscribing to the EventBus but when looking at the implementation it
looks like this not supported there yet.

Tom

Am 23.05.10 19:00, schrieb Sebastian:
> Hi,
>
> please pardon me about this question, but how is a e4 view is to be
> notified about having focus?
>
> I've seen the IFocusable interface in
> org.eclipse.e4.workbench.ui.behaviors, but how is the setFocus() method
> getting called ?
> Do I need to implement my own IPartListener?
>
> Sebastian
Re: Focus Notification [message #535610 is a reply to message #535532] Mon, 24 May 2010 20:56 Go to previous messageGo to next message
Sebastian is currently offline SebastianFriend
Messages: 61
Registered: March 2010
Member
Hey Tom,

thanks for your advice.

Currently I like the IFocusable behavior, even though I need to associate the MPart with the class implementing the view abusing the setObject(), currently (everything's composite Smile)

Thinking of hundres of views getting any part injected just to see, if the injected part were theirselves sounds kind of odd to me.

Sebastian

PS Bug 314164
Re: Focus Notification [message #576679 is a reply to message #535532] Mon, 24 May 2010 20:56 Go to previous message
Sebastian is currently offline SebastianFriend
Messages: 61
Registered: March 2010
Member
Hey Tom,

thanks for your advice.

Currently I like the IFocusable behavior, even though I need to associate the MPart with the class implementing the view abusing the setObject(), currently (everything's composite :))

Thinking of hundres of views getting any part injected just to see, if the injected part were theirselves sounds kind of odd to me.

Sebastian

PS https://bugs.eclipse.org/bugs/show_bug.cgi?id=314164
Previous Topic:Focus Notification
Next Topic:e4/4.0 M6 available
Goto Forum:
  


Current Time: Thu Apr 25 13:30:08 GMT 2024

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

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

Back to the top