Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsDisplay.setFocusControl in RAP
https://www.eclipse.org/forums/index.php/mv/msg/306458/816875/#msg_816875
I have a requirement where I dispose the control when it is not in focus. However, due to the implementation in of Display.setFocusControl this is leading to a WIDGET DISPOSED error.
In 'event.processEvent' my FOcusLost event disposes the control and 'currentFocusControl.getShell()' throws a WIDGET DISPOSED error.
Is there a way to fix this? Or avoid this?]]>Amandeep Chahal2012-03-09T11:23:48-00:00Re: Display.setFocusControl in RAP
https://www.eclipse.org/forums/index.php/mv/msg/306458/816891/#msg_816891
I think that your use case (dispose a control in a focus lost event) is
a valid one and works fine in SWT. Please file a bugzilla and we will
have a look on it a s soon as possible.
Best,
Ivan
On 3/9/2012 1:23 PM, Amandeep Chahal wrote:
> Hi,
> I have a requirement where I dispose the control when it is not in
> focus. However, due to the implementation in of
> Display.setFocusControl this is leading to a WIDGET DISPOSED error.
>
> FocusEvent event = new FocusEvent( currentFocusControl,
> FocusEvent.FOCUS_LOST );
> event.processEvent();
> currentFocusControl.getShell().updateDefaultButton(
> currentFocusControl, false);
>
>
> In 'event.processEvent' my FOcusLost event disposes the control and
> 'currentFocusControl.getShell()' throws a WIDGET DISPOSED error.
>
> Is there a way to fix this? Or avoid this?
Professional services for RAP and RCP? http://eclipsesource.com/services/rap/]]>Ivan Furnadjiev2012-03-09T11:41:53-00:00Re: Display.setFocusControl in RAP
https://www.eclipse.org/forums/index.php/mv/msg/306458/816912/#msg_816912
Thanks for your reply.
Submitted bug : https://bugs.eclipse.org/bugs/show_bug.cgi?id=373770]]>Amandeep Chahal2012-03-09T12:17:57-00:00Re: Display.setFocusControl in RAP
https://www.eclipse.org/forums/index.php/mv/msg/306458/816916/#msg_816916
Thanks for your reply.
Submitted bug : https://bugs.eclipse.org/bugs/show_bug.cgi?id=373770]]>Amandeep Chahal2012-03-09T12:17:58-00:00Re: Display.setFocusControl in RAP
https://www.eclipse.org/forums/index.php/mv/msg/306458/817012/#msg_817012
Control control;
...
public void focusLost(FocusEvent event) {
control.getDisplay().asyncExec(new Runnable(){
// make sure something else didn't dispose it
if (control != null && !control.isDisposed()){
control.dispose();
}
});
}
]]>Cole Markham2012-03-09T14:31:43-00:00Re: Display.setFocusControl in RAP
https://www.eclipse.org/forums/index.php/mv/msg/306458/817017/#msg_817017
Control control;
...
public void focusLost(FocusEvent event) {
control.getDisplay().asyncExec(new Runnable(){
// make sure something else didn't dispose it
if (control != null && !control.isDisposed()){
control.dispose();
}
});
}]]>Cole Markham2012-03-09T14:31:43-00:00Re: Display.setFocusControl in RAP
https://www.eclipse.org/forums/index.php/mv/msg/306458/817059/#msg_817059
1.5M6.
Best,
Ivan
Professional services for RAP and RCP? http://eclipsesource.com/services/rap/]]>Ivan Furnadjiev2012-03-09T15:26:34-00:00Re: Display.setFocusControl in RAP
https://www.eclipse.org/forums/index.php/mv/msg/306458/818815/#msg_818815
Regards,
Aman.]]>Amandeep Chahal2012-03-12T06:26:56-00:00Re: Display.setFocusControl in RAP
https://www.eclipse.org/forums/index.php/mv/msg/306458/818819/#msg_818819
Regards,
Aman.]]>Amandeep Chahal2012-03-12T06:26:56-00:00