Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Focus on a Text in a Dialog
Focus on a Text in a Dialog [message #897753] Wed, 25 July 2012 04:23 Go to next message
David Casas is currently offline David Casas
Messages: 58
Registered: November 2011
Location: Barcelona
Member

Hi guys,

I am trying to set the focus of my custom Dialog and I am not able to do it. I have try it in different ways, but I've never found the way to do it.

The last thing I tried is add a ControlListener to my shell in order to perform a setFocus when the Dialog is resized as this:

shell.addControlListener(new ControlAdapter() {

			public void controlResized(ControlEvent e) {
				initializeBounds();
				shell.getDisplay().timerExec(2000, new Runnable() {
					
					@Override
					public void run() {
						top.setFocus();
						txtAlias.setFocus();
					}
				});

			}
		});


But without results...

Do you know how can I do it?
Thanks in advance.
Re: Focus on a Text in a Dialog [message #897772 is a reply to message #897753] Wed, 25 July 2012 04:41 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan Furnadjiev
Messages: 1425
Registered: July 2009
Senior Member
Hi David,
could you open a bugzilla about this issue with a self-running
project/snippet to reproduce it?
Thanks,
Ivan

On 7/25/2012 11:23 AM, David Casas wrote:
> Hi guys,
>
> I am trying to set the focus of my custom Dialog and I am not able to
> do it. I have try it in different ways, but I've never found the way
> to do it.
> The last thing I tried is add a ControlListener to my shell in order
> to perform a setFocus when the Dialog is resized as this:
>
> shell.addControlListener(new ControlAdapter() {
>
> public void controlResized(ControlEvent e) {
> initializeBounds();
> shell.getDisplay().timerExec(2000, new Runnable() {
>
> @Override
> public void run() {
> top.setFocus();
> txtAlias.setFocus();
> }
> });
>
> }
> });
>
>
> But without results...
>
> Do you know how can I do it?
> Thanks in advance.

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Focus on a Text in a Dialog [message #897773 is a reply to message #897753] Wed, 25 July 2012 04:44 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan Furnadjiev
Messages: 1425
Registered: July 2009
Senior Member
BTW... Just checked the Controls Demo -> Dialogs tab (custom
LoginDialog) and setting the focus on the text filed works fine.

On 7/25/2012 11:23 AM, David Casas wrote:
> Hi guys,
>
> I am trying to set the focus of my custom Dialog and I am not able to
> do it. I have try it in different ways, but I've never found the way
> to do it.
> The last thing I tried is add a ControlListener to my shell in order
> to perform a setFocus when the Dialog is resized as this:
>
> shell.addControlListener(new ControlAdapter() {
>
> public void controlResized(ControlEvent e) {
> initializeBounds();
> shell.getDisplay().timerExec(2000, new Runnable() {
>
> @Override
> public void run() {
> top.setFocus();
> txtAlias.setFocus();
> }
> });
>
> }
> });
>
>
> But without results...
>
> Do you know how can I do it?
> Thanks in advance.

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Focus on a Text in a Dialog [message #898292 is a reply to message #897773] Thu, 26 July 2012 02:57 Go to previous messageGo to next message
David Casas is currently offline David Casas
Messages: 58
Registered: November 2011
Location: Barcelona
Member

Ill see the Controls Demo first and then If it does not work I'll open a bug in bugzilla. Thanks a lot
Re: Focus on a Text in a Dialog [message #898334 is a reply to message #898292] Thu, 26 July 2012 04:46 Go to previous messageGo to next message
David Casas is currently offline David Casas
Messages: 58
Registered: November 2011
Location: Barcelona
Member

Hi Ivan,

I have checking eclipse controls demo and I am not seeing setFocus is working. On the http://rap.eclipsesource.com/rapdemo/examples#dialog, if you click on Login dialog you won't see focus at all. However, if we see the code, we will see:

 private void initilizeDialogArea() {
    if( message != null ) {
      mesgLabel.setText( message );
    }
    if( username != null ) {
      userText.setText( username );
    }
    userText.setFocus();
  }


Do I have to open a bug?
Re: Focus on a Text in a Dialog [message #898393 is a reply to message #898334] Thu, 26 July 2012 06:17 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan Furnadjiev
Messages: 1425
Registered: July 2009
Senior Member
Hi David,
just checked it more precisely. Focusing is working with Chrome... but
not in other browsers (widget is highlighted, but can't type in it).
Please open a bugzilla about this issue.
Thanks,
Ivan

On 7/26/2012 11:46 AM, David Casas wrote:
> Hi Ivan,
>
> I have checking eclipse controls demo and I am not seeing setFocus is
> working. On the http://rap.eclipsesource.com/rapdemo/examples#dialog,
> if you click on Login dialog you won't see focus at all. However, if
> we see the code, we will see:
>
> private void initilizeDialogArea() {
> if( message != null ) {
> mesgLabel.setText( message );
> }
> if( username != null ) {
> userText.setText( username );
> }
> userText.setFocus();
> }
>
> Do I have to open a bug?

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Focus on a Text in a Dialog [message #912893 is a reply to message #898393] Fri, 14 September 2012 07:09 Go to previous messageGo to next message
Eclipse User
Is there a request for this yet, I could not find it?

Am 26.07.2012 12:17, schrieb Ivan Furnadjiev:
> Hi David,
> just checked it more precisely. Focusing is working with Chrome... but
> not in other browsers (widget is highlighted, but can't type in it).
> Please open a bugzilla about this issue.
> Thanks,
> Ivan
>
> On 7/26/2012 11:46 AM, David Casas wrote:
>> Hi Ivan,
>>
>> I have checking eclipse controls demo and I am not seeing setFocus is
>> working. On the http://rap.eclipsesource.com/rapdemo/examples#dialog,
>> if you click on Login dialog you won't see focus at all. However, if
>> we see the code, we will see:
>>
>> private void initilizeDialogArea() {
>> if( message != null ) {
>> mesgLabel.setText( message );
>> }
>> if( username != null ) {
>> userText.setText( username );
>> }
>> userText.setFocus();
>> }
>>
>> Do I have to open a bug?
>
Re: Focus on a Text in a Dialog [message #913111 is a reply to message #912893] Fri, 14 September 2012 15:54 Go to previous message
Rüdiger Herrmann is currently offline Rüdiger Herrmann
Messages: 551
Registered: July 2009
Senior Member
Bug 386053 - [Text] setFocus does not work under some constellation
https://bugs.eclipse.org/bugs/show_bug.cgi?id=386053

On 14.09.2012 13:09, Markus Krüger wrote:
> Is there a request for this yet, I could not find it?
>
> Am 26.07.2012 12:17, schrieb Ivan Furnadjiev:
>> Hi David,
>> just checked it more precisely. Focusing is working with Chrome... but
>> not in other browsers (widget is highlighted, but can't type in it).
>> Please open a bugzilla about this issue.
>> Thanks,
>> Ivan
>>
>> On 7/26/2012 11:46 AM, David Casas wrote:
>>> Hi Ivan,
>>>
>>> I have checking eclipse controls demo and I am not seeing setFocus is
>>> working. On the http://rap.eclipsesource.com/rapdemo/examples#dialog,
>>> if you click on Login dialog you won't see focus at all. However, if
>>> we see the code, we will see:
>>>
>>> private void initilizeDialogArea() {
>>> if( message != null ) {
>>> mesgLabel.setText( message );
>>> }
>>> if( username != null ) {
>>> userText.setText( username );
>>> }
>>> userText.setFocus();
>>> }
>>>
>>> Do I have to open a bug?
>>

--
Rüdiger Herrmann
http://codeaffine.com
Previous Topic:Widget ID's for composites
Next Topic:CSS + Markup support for TreeItem
Goto Forum:
  


Current Time: Sat May 25 19:05:25 EDT 2013

Powered by FUDForum. Page generated in 0.07441 seconds