Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 354270

Summary: TextView needs a hasFocus() method
Product: [ECD] Orion Reporter: Mihai Sucan <mihai.sucan>
Component: EditorAssignee: Felipe Heidrich <eclipse.felipe>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: eclipse.felipe, mihai.sucan, Silenio_Quarti
Version: unspecified   
Target Milestone: 0.4 M1   
Hardware: All   
OS: All   
Whiteboard:

Description Mihai Sucan CLA 2011-08-09 12:08:13 EDT
Build Identifier: 

We need a way to check if the editor has focus. Internally, the Orion TextView keeps track of focus with the _hasFocus property, but we need a public method/property we can check, like hasFocus().

Thank you!

Reproducible: Always
Comment 1 Felipe Heidrich CLA 2011-08-09 12:13:54 EDT
Looks like a good thing to have.
at this point, do you only need the method or do you also need events (focusin/focusout)?
Comment 2 Mihai Sucan CLA 2011-08-09 12:19:10 EDT
(In reply to comment #1)
> Looks like a good thing to have.
> at this point, do you only need the method or do you also need events
> (focusin/focusout)?

At this point I am not sure if I am going to update Orion in the integration code we have. We aim to land whatever I last pulled from the git repo (on 2011-07-07), which works fine for us. We would like to sync with stable releases once we land. (any comments on stability/regressions? would it be wise/acceptable to update our code? any important fixes?)


Wrt. this bug: we need only the hasFocus() method for now, but having events for focusin/focusout would be useful in the future.

Thanks for your quick reply!
Comment 3 Felipe Heidrich CLA 2011-08-09 14:56:44 EDT
(In reply to comment #2)
> (In reply to comment #1)
> > Looks like a good thing to have.
> > at this point, do you only need the method or do you also need events
> > (focusin/focusout)?
> At this point I am not sure if I am going to update Orion in the integration
> code we have. We aim to land whatever I last pulled from the git repo (on
> 2011-07-07), which works fine for us. We would like to sync with stable
> releases once we land. (any comments on stability/regressions? would it be
> wise/acceptable to update our code? any important fixes?)


In all honesty we were not able to do much work in Orion over the last month (most because of all the turmoil caused by eclipse.platform git migration).
That said, we are starting on orion again and we will start releasing changes and features soon.

> Wrt. this bug: we need only the hasFocus() method for now, but having events
> for focusin/focusout would be useful in the future.

Do you have the code already ? Did you ever get your commit rights ?
Comment 4 Mihai Sucan CLA 2011-08-09 16:06:49 EDT
(In reply to comment #3)
> In all honesty we were not able to do much work in Orion over the last month
> (most because of all the turmoil caused by eclipse.platform git migration).
> That said, we are starting on orion again and we will start releasing changes
> and features soon.

Hehe, no worries.

> > Wrt. this bug: we need only the hasFocus() method for now, but having events
> > for focusin/focusout would be useful in the future.
> 
> Do you have the code already ? Did you ever get your commit rights ?

No code. It's trivial, just have to add hasFocus: function () { return this._hasFocus; }. The problem is .. me updating the Orion upstream code. I want to refrain from doing that. I'm very close to landing.

Anyway, there's no hurry *at the moment* for this method. I just opened the bug report so we don't forget this.
Comment 5 Mihai Sucan CLA 2011-10-28 11:10:55 EDT
Proposed patch:

https://github.com/mihaisucan/orion.client/tree/bug-354270

Please let me know if this needs more changes before the patch can land. Thank you!
Comment 7 Felipe Heidrich CLA 2011-11-10 16:39:34 EST
and Thank you Mihai for the patch
Comment 8 Mihai Sucan CLA 2011-11-10 16:47:25 EST
(In reply to comment #7)
> and Thank you Mihai for the patch

Thank you for landing the patch! Much appreciated!