java - Access tree object in netbeans outline -


I'm using outline with netbeans to display some structured data.

How can I map the selected row to an object in a tree?

You will see in the example. It looks like the author, so it should be helpful. Netbusiness 6.8:

Netbins / Platform 11 / module / org-netbeans-swing-outline I have class org.netbeans.swing.outline.Outline address

This can be useful. Depending on the example given above, there is a listener that shows a clear change in the row number because the nodes are expanded and collapsed and the selection remains stable:

  Settings.Get SelectionModel (). AddListSelectionListener) {@Override Public Zero Value changed (ListSelectionEvent e) {int row = outline.getSelectedRow (); File f = (file) outline .getValueAt (line, 0); If (! E.getValueIsAdjusting ()) {System.out Println (line + ":" + f);}}});  

However, you can see the outline model and DefaultOutlineModel . The former applies both tree modal and tablesmodel and provides TreePathSupport ; The latter mentions "impedance mismatch between TableModelAvent and Tree Model Avent".

Like JTable , the selected row in the view can not match this line in the index model, perhaps sorting etc. The getValueAt () method seems to be a convenient way to call convertRowIndexToModel () . This is common in swing model model architecture, which "falls and controls parts of every user's component (user interface) object." See.


Comments