Skip to main content

RE: JTreeTable not responding to tree events

No replies
Anonymous

Ill buy that.

-----Original Message-----
From: jdnc-interest@javadesktop.org [mailto:jdnc-interest@javadesktop.org]
Sent: Friday, August 13, 2004 2:13 PM
To: jdnc@jdnc.dev.java.net
Subject: Re: JTreeTable not responding to tree events

> Hi, thanks for the response. That really helped. I
> had in my code for the isCellEditable, something
> like
>
> if(column == 0) return false;
>
> Why is the editable functionality overloaded with
> tree events? I mean, my requirement is to have a tree
> whose nodes can't be edited. However, I should be
> able to perform actions on them like expand, collapse
> and select. For example, I can't edit the label of a
> button, but I can click it. Right? So, why should the
> cell be editable for it to expand or collapse? If
> that's a limitation I can't overcome, then is there a
> way to disable the editing of the node name?

Please see the related thread http://www.javadesktop.org/forums/thread.jspa?messageID=22345#22345 for some background on this. This is also filed as JDNC issue #49
(https://jdnc.dev.java.net/issues/show_bug.cgi?id=49).

Basically, JXTreeTable uses a tree internally to manage and render the nodes in the hierarchical column. While the tree itself is not editable, the treetable must allow editing in the hierarchical
column in order for mouse clicks to be properly processed.

Now, there are two types of editing that we are talking about:
(1) modifying the expanded/collapsed state of a node, and
(2) modifying the node content/label

In issue 49, I suggested adding a method to explicitly distinguish between the two types of editing. But on closer examination, it seems like there is no need to change the api, just the semantics --
So, nodes should be expanded/collapsed regardless of the return value of isCellEditable(), and the node content/label should be editable iff isCellEditable() returns true.

Thoughts?

Ramesh
---
[Message sent by forum member 'rameshgupta' (Ramesh Gupta)]

http://www.javadesktop.org/forums/thread.jspa?messageID=22717&#22717

---------------------------------------------------------------------
To unsubscribe, e-mail: jdnc-unsubscribe@jdnc.dev.java.net
For additional commands, e-mail: jdnc-help@jdnc.dev.java.net

==============================================================================

If you are not an intended recipient of this e-mail, please notify
the sender, delete it and do not read, act upon, print, disclose,
copy, retain or redistribute it.

Click here for important additional terms relating to this e-mail.

==============================================================================

---------------------------------------------------------------------
To unsubscribe, e-mail: jdnc-unsubscribe@jdnc.dev.java.net
For additional commands, e-mail: jdnc-help@jdnc.dev.java.net