Hi Christof, Single click on a tree node can be caught using ITreeSelectionListener.valueChanged(TreeSelectionEvent event) method. But, the event won't have the location.
For hints on mouse location specific actions please refer to: http://lists.canoo.com/mailman/private/ulc-developer/2007/005217.html Basically you will have to create an extension of ULCTree which listens to mouse events on the client and sends and event or calls a method on the server side object. The ActionLabel as rendererer does not work because the tree is not yielding focus to the renderer. BTW with ULC 6.1 you need not worry about event dispatching like in your implementation of ActionLabel: UIActionLabel: client side proxy protected void postInitializeState() { getBasicLabel().addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { String command = e.getPoint().x + "," + e.getPoint().y; fireActionPerformedULC(command, e.getModifiers()); } }); } ULCActionLabel: server side proxy Just implement the following method to add listeners: public void addActionListener(IActionListener l) { addListener(UlcEventCategories.ACTION_EVENT_CATEGORY, l); } Please refer to ULCExtensionGuide (in <install dir>/doc) for details about creating extensions. Thanks and regards, Janak >-----Original Message----- >From: [EMAIL PROTECTED] >[mailto:[EMAIL PROTECTED] Behalf Of >[EMAIL PROTECTED] >Sent: Friday, June 22, 2007 4:20 PM >To: [EMAIL PROTECTED] >Subject: [ULC-developer] Catching a "single" mouse click on a ULCTree > > >Hi out there, >We are looking for a way to catch a "single" mouse click on a >ULCTree. The position of the cursor (x/y coordinates) or the >information whether the icon (see treenode_icon_click.jpg) or the >text (see treenode_text_click.jpg) have been clicked is also >needed. We only work with ULCLabel-Renderer components that have >their own icons. A specific listener should then perform the >needed actions. The reason is that we have to activate treenodes >via mouseactions. Formerly we wanted to use a double click on a >node ("actionperformed"), but this has the disadvantage that the >treenode will expand/collapse and the following action is ignored. >Checkboxes also don't solve the problem, because every click on a >treenode with a checkbox-renderer-component nodes are >activated/deactivated even if you don't want to do so. >We have already tried with an ULCActionLabel (see Daniel Grob's >Mail "Capture a mouse double-click for a ULCLabel" / >ActionLabelSnippet.java) . In a view this class works just fine. >But used as an "IRendererComponent" (see attached code) it fails. >The listener doesn't seem to be notified. I hope there is a >possibility to archive the desired behavior. >Thank you very much for your help. > >Best regards, > >Roger > <<treenode_icon_click.JPG>> <<treenode_text_click.JPG>> ><<TestTreeViewRenderer.java>> <<ActionLabelSnippet.java>> ><<false.gif>> <<true.gif>> > _______________________________________________ ULC-developer mailing list [email protected] http://lists.canoo.com/mailman/listinfo/ulc-developer
