Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Non-selectable nodes in tree
Non-selectable nodes in tree [message #123264] Thu, 26 February 2009 17:34 Go to next message
Howard is currently offline HowardFriend
Messages: 29
Registered: July 2009
Junior Member
My application uses a tree to represent a workflow on the right half, that
when users click on a node in the tree, the left half changes to reflect
the selected node.

However some of the nodes aren't implemented yet, so they are disabled and
greyed-out for now. To prevent the user from selecting these nodes, I
added a selection listener to the tree. In widgetSelected, I check to see
if the selection is to a valid node. If not, I call tree.setSelection()
back to the previously selected node. Since this happens quickly in SWT,
so the illusion is that the user can't click on the disabled nodes.

Unfortunately in RWT standalone, the drawing is a bit slower so you can
easily tell the disabled node was clicked on briefly before re-selecting
the previous node, but I can live with it. But what's worst, is that if I
now select a third node, both the first and third nodes will be
highlighted!

If I then click back to first node, then click on another node the tree is
restored to normal where only 1 node is highlighted, so this seems like a
redrawing/refreshing thing. The Tree is single select of course. I tried
redrawing to no avail.

Question is, is this a bug? Also, is this the correct/standard way to
achieve my desired behavior, or is there a better/alternative way?

Keep up the good work guys!

Howard
Re: Non-selectable nodes in tree [message #123369 is a reply to message #123264] Fri, 27 February 2009 15:17 Go to previous messageGo to next message
Rüdiger Herrmann is currently offline Rüdiger HerrmannFriend
Messages: 581
Registered: July 2009
Senior Member
Howard,

from reading your post, this appears to be a bug. Open a bugzilla if
you can provide self-contained code to reproduce the problem.

Cheers,
Rüdiger

Howard wrote:
> My application uses a tree to represent a workflow on the right half,
> that when users click on a node in the tree, the left half changes to
> reflect the selected node.
>
> However some of the nodes aren't implemented yet, so they are disabled
> and greyed-out for now. To prevent the user from selecting these nodes,
> I added a selection listener to the tree. In widgetSelected, I check to
> see if the selection is to a valid node. If not, I call
> tree.setSelection() back to the previously selected node. Since this
> happens quickly in SWT, so the illusion is that the user can't click on
> the disabled nodes.
>
> Unfortunately in RWT standalone, the drawing is a bit slower so you can
> easily tell the disabled node was clicked on briefly before re-selecting
> the previous node, but I can live with it. But what's worst, is that if
> I now select a third node, both the first and third nodes will be
> highlighted!
>
> If I then click back to first node, then click on another node the tree
> is restored to normal where only 1 node is highlighted, so this seems
> like a redrawing/refreshing thing. The Tree is single select of course.
> I tried redrawing to no avail.
>
> Question is, is this a bug? Also, is this the correct/standard way to
> achieve my desired behavior, or is there a better/alternative way?
>
> Keep up the good work guys!
>
> Howard
>
Re: Non-selectable nodes in tree [message #123483 is a reply to message #123369] Mon, 02 March 2009 14:15 Go to previous message
Benjamin Muskalla is currently offline Benjamin MuskallaFriend
Messages: 338
Registered: July 2009
Senior Member
Hi,

see also 231523: [Tree] Selection Problem
https://bugs.eclipse.org/bugs/show_bug.cgi?id=231523

Cheers
Benny

Rüdiger Herrmann wrote:
> Howard,
>
> from reading your post, this appears to be a bug. Open a bugzilla if you
> can provide self-contained code to reproduce the problem.
>
> Cheers,
> Rüdiger
>
> Howard wrote:
>> My application uses a tree to represent a workflow on the right half,
>> that when users click on a node in the tree, the left half changes to
>> reflect the selected node.
>>
>> However some of the nodes aren't implemented yet, so they are disabled
>> and greyed-out for now. To prevent the user from selecting these
>> nodes, I added a selection listener to the tree. In widgetSelected, I
>> check to see if the selection is to a valid node. If not, I call
>> tree.setSelection() back to the previously selected node. Since this
>> happens quickly in SWT, so the illusion is that the user can't click
>> on the disabled nodes.
>>
>> Unfortunately in RWT standalone, the drawing is a bit slower so you
>> can easily tell the disabled node was clicked on briefly before
>> re-selecting the previous node, but I can live with it. But what's
>> worst, is that if I now select a third node, both the first and third
>> nodes will be highlighted!
>>
>> If I then click back to first node, then click on another node the
>> tree is restored to normal where only 1 node is highlighted, so this
>> seems like a redrawing/refreshing thing. The Tree is single select of
>> course. I tried redrawing to no avail.
>>
>> Question is, is this a bug? Also, is this the correct/standard way to
>> achieve my desired behavior, or is there a better/alternative way?
>>
>> Keep up the good work guys!
>>
>> Howard
>>
>


--
Benjamin Muskalla | EclipseSource Karlsruhe
http://www.eclipsesource.com | http://twitter.com/eclipsesource
Previous Topic:Request to add a WebSite in RAP Demo List Page
Next Topic:conceptual question: "file download link"?
Goto Forum:
  


Current Time: Mon Nov 29 01:58:30 GMT 2021

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

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

Back to the top