Skip to main content


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 08:23 Go to next message
David Casas is currently offline David CasasFriend
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 08:41 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2359
Registered: July 2009
Location: Sofia, Bulgaria
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 08:44 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2359
Registered: July 2009
Location: Sofia, Bulgaria
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 06:57 Go to previous messageGo to next message
David Casas is currently offline David CasasFriend
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 08:46 Go to previous messageGo to next message
David Casas is currently offline David CasasFriend
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 10:17 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2359
Registered: July 2009
Location: Sofia, Bulgaria
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 11:09 Go to previous messageGo to next message
Eclipse UserFriend
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 19:54 Go to previous message
Rüdiger Herrmann is currently offline Rüdiger HerrmannFriend
Messages: 581
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:problem when deploying sample RAP application in JBOSS 7.1.0
Next Topic:Decorate TreeItem
Goto Forum:
  


Current Time: Tue Oct 26 06:47:07 GMT 2021

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

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

Back to the top