This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 29551 - Selecting a node near recently deleted node does not work well in TreeTableView
Summary: Selecting a node near recently deleted node does not work well in TreeTableView
Status: VERIFIED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Explorer (show other bugs)
Version: 3.x
Hardware: PC Linux
: P4 blocker (vote)
Assignee: Jiri Rechtacek
URL:
Keywords:
Depends on:
Blocks: 13348
  Show dependency tree
 
Reported: 2002-12-13 18:00 UTC by Jesse Glick
Modified: 2008-12-23 11:45 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Mini-module (JAR) which displays Options in Runtime tab (1.88 KB, application/octet-stream)
2002-12-13 18:01 UTC, Jesse Glick
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2002-12-13 18:00:59 UTC
This is in reference to Issue #13348.

I still don't think this is implemented completely
correctly. The 1.113 rev of TreeView.java is
supposed to solve problems with "fake deletions",
where a node goes missing but there was already a
different selection.

In dev sources, open Options dialog. Expand
Modules node and under Data Files, select Resource
Bundles. Change Enabled to False. When done,
Resource Bundles is still selected, as expected.

Turn the module back on. Now expand Templates ->
Other, so that Properties File is visible. Select
Resource Bundles module again, and again turn it
off. This time, the HTML File template gets selected.

Now try the same with my special module that
displays Options in the Runtime tab (which I will
attach). This time it works. So I suspect the
problem is in TreeTableView's interpretation of
the deletion event - BeanTreeView seems to be OK.
Comment 1 Jesse Glick 2002-12-13 18:01:36 UTC
Created attachment 8329 [details]
Mini-module (JAR) which displays Options in Runtime tab
Comment 2 _ jrichard 2002-12-28 23:50:23 UTC
This seems to fix this problem (at least it seems to for me!). 
However, I didn't dig into the TreeTable code well enough to
understand it completely...


Index: openide/src/org/openide/explorer/view/TreeTable.java
===================================================================
RCS file: /cvs/openide/src/org/openide/explorer/view/TreeTable.java,v
retrieving revision 1.20
diff -u -r1.20 TreeTable.java
--- openide/src/org/openide/explorer/view/TreeTable.java        3 Dec
2002 14:11:40 -0000       1.20
+++ openide/src/org/openide/explorer/view/TreeTable.java        28 Dec
2002 23:47:18 -0000
@@ -423,7 +423,10 @@
         protected TreeModelListener createTreeModelListener() {
             return new JTree.TreeModelHandler() {
                 public void treeNodesRemoved(TreeModelEvent e) {
-                    tree.setSelectionPath
(TreeView.findSiblingTreePath (e.getTreePath (), e.getChildIndices ()));
+                    if (tree.getSelectionCount () == 0) {
+                        tree.setSelectionPath
(TreeView.findSiblingTreePath (e.getTreePath (), e.getChildIndices ()));
+                        tree.requestFocus();
+                    }
                 }
             };
         }
Comment 3 Jaromir Uhrik 2003-01-06 14:07:49 UTC
Version changed: 4.0 dev -> S1S 4.2
Comment 4 Jiri Rechtacek 2003-01-09 17:27:55 UTC
thanks John for patch. the same way was used in TreeView. I guess too
that this patch fixed this problem.
Comment 5 Lukas Hasik 2003-09-03 10:35:30 UTC
verified [0309030100]