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 200846 - bad ListSelectionEvent after outline.expandPath
Summary: bad ListSelectionEvent after outline.expandPath
Status: RESOLVED INCOMPLETE
Alias: None
Product: platform
Classification: Unclassified
Component: Outline&TreeTable (show other bugs)
Version: 7.0.1
Hardware: PC Windows XP
: P3 normal (vote)
Assignee: Martin Entlicher
URL:
Keywords: REGRESSION
Depends on:
Blocks:
 
Reported: 2011-08-10 17:45 UTC by err
Modified: 2011-11-01 16:30 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description err 2011-08-10 17:45:05 UTC
Here's an example (generated by code at the end of this note. The selection number is bigger than the number of rows in the table.
    rows=34 min=42 max=42 anchor=42 lead=42, empty=false, adjusting=false

The expandPath is called by an action on a popup menu on the node.

In ETable.changeSelectionInModel, "rowsInView" is 42, which is impossible.

The bogus values are introduced during:

"AWT-EventQueue-0"
javax.swing.DefaultListSelectionModel.insertIndexInterval(DefaultListSelectionModel.java:584)
org.netbeans.swing.etable.ETableSelectionModel.insertIndexInterval(ETableSelectionModel.java:59)
javax.swing.JTable.tableRowsInserted(JTable.java:4459)
javax.swing.JTable.tableChanged(JTable.java:4395)
org.netbeans.swing.etable.ETable.tableChanged(ETable.java:1242)
org.netbeans.swing.outline.Outline.tableChanged(Outline.java:879)
org.netbeans.swing.outline.EventBroadcaster.fireTableChange(EventBroadcaster.java:221)
org.netbeans.swing.outline.EventBroadcaster.fireTableChange(EventBroadcaster.java:247)
org.netbeans.swing.outline.EventBroadcaster.treeExpanded(EventBroadcaster.java:522)
org.netbeans.swing.outline.TreePathSupport.fireTreeExpansion(TreePathSupport.java:157)
org.netbeans.swing.outline.TreePathSupport.expandPath(TreePathSupport.java:113)
org.netbeans.swing.outline.Outline.expandPath(Outline.java:611)
com.raelity.logman.ui.LogOutlinePanel$PopupListener.makeVisible(LogOutlinePanel.java:759)
com.raelity.logman.ui.LogPopupMouseListener.expandSubtree(LogPopupMouseListener.java:412)
com.raelity.logman.ui.LogPopupMouseListener.expandSubtree(LogPopupMouseListener.java:410)
com.raelity.logman.ui.LogPopupMouseListener$ExpandAction.actionPerformed(LogPopupMouseListener.java:402)



=== output generated by:
            System.err.format("updateSelectedPath: rows=%d min=%d max=%d"
                    + " anchor=%d lead=%d, empty=%b, adjusting=%b\n",
                    outline.getRowCount(),
                    lsm.getMinSelectionIndex(), lsm.getMaxSelectionIndex(),
                    lsm.getAnchorSelectionIndex(), lsm.getLeadSelectionIndex(),
                    lsm.isSelectionEmpty(), lsm.getValueIsAdjusting());
Comment 1 err 2011-08-10 17:59:12 UTC
Forgot to say...

Single selection mode.

Every call to expand path produces an out of bounds selection, no matter the expand/collapse state of all the various nodes in the tree.
Comment 2 Martin Entlicher 2011-11-01 16:30:04 UTC
It looks like this might be a problem of the layout, which translates paths to the row number.
We'd need some more detailed description or better a test case to be able to have a better insight into this problem.

The event passed to tableChanged() is TableModelEvent.INSERT, which is constructed at EventBroadcaster.java:689 in method
private TableModelEvent translateEvent (TreeExpansionEvent e, boolean expand)
firstRow is set to getLayout().getRowForPath(path) + 1, therefore if it's too big, it's a problem of the layout.
Where is the output code placed? This is not clear from the report.