Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » unable to make a Link widget clickable
unable to make a Link widget clickable [message #117315] Thu, 01 January 2009 05:26 Go to next message
David Donohue is currently offline David Donohue
Messages: 104
Registered: July 2009
Senior Member
Happy New Year!
I would like hyperlinked text to show up, with my app able to respond to
click events. When I create a Link widget, I have 3 problems:
(1) the text in the link does not look like a link
(2) the mouse pointer does not change to a hand on mouseover, as
traditional links do, and most importantly:
(3) the link does not seem to broadcase click events.

Here is a code snippet.
Link link = new Link(composite, SWT.NONE);
link.setToolTipText("Click to sort");
link.addSelectionListener(listener);
link.setText(displayName);
link.setData(columnName);

Clicking the link does not call my SelectionListener's widgetSelected()
nor widgetDefaultSelected() methods.

Thanks for any help!
David Donohue
Re: unable to make a Link widget clickable [message #117332 is a reply to message #117315] Thu, 01 January 2009 08:31 Go to previous messageGo to next message
Eclipse User
Originally posted by: ifurnadjiev.innoopract.com

Hi David,
Happy New Year! To solve all of your problems you simply have to put the
<a>...</a> around the text if it not exist in your "displayName"
variable. For example:
Link link = new Link(composite, SWT.NONE);
link.setToolTipText("Click to sort");
link.addSelectionListener(listener);
link.setText("<a>"+displayName+"</a>");
link.setData(columnName);

Best,
Ivan

David Donohue wrote:
> Happy New Year!
> I would like hyperlinked text to show up, with my app able to respond
> to click events. When I create a Link widget, I have 3 problems: (1)
> the text in the link does not look like a link
> (2) the mouse pointer does not change to a hand on mouseover, as
> traditional links do, and most importantly:
> (3) the link does not seem to broadcase click events.
>
> Here is a code snippet.
> Link link = new Link(composite, SWT.NONE);
> link.setToolTipText("Click to sort");
> link.addSelectionListener(listener);
> link.setText(displayName);
> link.setData(columnName);
>
> Clicking the link does not call my SelectionListener's
> widgetSelected() nor widgetDefaultSelected() methods.
>
> Thanks for any help!
> David Donohue
>
Re: unable to make a Link widget clickable [message #117358 is a reply to message #117332] Sat, 03 January 2009 03:33 Go to previous message
David Donohue is currently offline David Donohue
Messages: 104
Registered: July 2009
Senior Member
Thanks, Ivan! That did the trick.
Best,
David Donohue
Previous Topic:Typo in ActivityMessages class
Next Topic:"entry point does not exist" after adding plugins?
Goto Forum:
  


Current Time: Mon Oct 20 13:23:24 GMT 2014

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

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