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.
When a treetable has no contents, a meaningful message shoudl be shown instead so the user knows that this is deliberately blank. See: http://ui.netbeans.org/docs/hi/debugger3.4/tables/index.html
its general behaviour suggested for all TTvievs, so it should be implemented by openide team see: http://ui.netbeans.org/docs/hi/debugger3.4/tables/index.html
reassigne to Ales (Tree Table owner)
I think you did mean "no rows" by "no contents", yes? I'm not sure if it should be general behaviour. Debugger has whole information about root node before displaying TTV, right? What message do you suggest to display? When it should be displayed - before opening TTV?
Yes, by "no content" I meant "no rows". I don't think there can be a completely "geneal" message. For instance, when this is used to show the threads of a program, the program might contain no threads, so the message would be something like "No threads for this program", while if the current debugger can never support showing threads, the debuggercore might report "Current Debugger doesn't support threads". In the debugger, this will generally be used when the current debugger can't show anything in the view (for another example, if the user is debugging a java program, and looking at the Classes view, and then switches to a session that is debugging a C program, then the classes view would change to indicate that there are no classes to be shown in that view. Does this answer the question?
So it looks like debugger specific behaviour, reassign.
I am not able to implement it without some support from view. I can provide message, but I do not know how to display it. So if this feature is not supportted by swing.JTable and will not be supported be out TreeTable View, we should close this RFE and update UsersView.
Because I have no idea how to solve this issue, I suggest to close it.
Maybe I'm not explaining what I think is needed very clearly. I don't think this is especially hard to do, though perhaps it isn't very elegant. In this example, I start off with a JTable in a JScrollPane, and then replace it with a text field: JTextField myMessageField = new JTextField("This is a hack"); Font tempFont; myMessageField.setHorizontalAlignment(JTextField.CENTER ); tempFont = myMessageField.getFont(); myMessageField.setFont(tempFont.deriveFont(Font.ITALIC)); myMessageField.setEditable(false); /* Would be nice to make it not selectable here, but I can't see how to do that. */ /* Also, the text probably should be JLF Secondary 2 (dark grey) */ this.jScrollPane1.setViewportView(myMessageField); /* force the column header to be shown, even though the table is not */ this.jScrollPane1.setColumnHeaderView(this.jTable1.getTableHeader() ); The tricky part here is probably that if the focus is in the table when it is "swapped out", it should probably be transferred into this new view. A full hack example is here: /* * FishFace.java * * Created on May 7, 2002, 11:02 AM */ package examples; import java.awt.event.ActionListener; import javax.swing.JLabel; import javax.swing.JTextField; import java.awt.Font; /** * * @author davidjon */ public class FishFace extends javax.swing.JFrame { /** Creates new form FishFace */ public FishFace() { initComponents(); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ private void initComponents() { jScrollPane1 = new javax.swing.JScrollPane(); jTable1 = new javax.swing.JTable(); jButton1 = new javax.swing.JButton(); addWindowListener(new java.awt.event.WindowAdapter() { public void windowClosing(java.awt.event.WindowEvent evt) { exitForm(evt); } }); jTable1.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { {null, null, null, null}, {null, null, null, null}, {null, null, null, null}, {null, null, null, null} }, new String [] { "Title 1", "Title 2", "Title 3", "Title 4" } )); jScrollPane1.setViewportView(jTable1); getContentPane().add(jScrollPane1, java.awt.BorderLayout.CENTER); jButton1.setText("Press Me!"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); getContentPane().add(jButton1, java.awt.BorderLayout.NORTH); pack(); } private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { JTextField myMessageField = new JTextField("This is a hack"); Font tempFont; myMessageField.setHorizontalAlignment(JTextField.CENTER ); tempFont = myMessageField.getFont(); myMessageField.setFont(tempFont.deriveFont(Font.ITALIC)); myMessageField.setEditable(false); this.jScrollPane1.setViewportView(myMessageField); this.jScrollPane1.setColumnHeaderView(this.jTable1.getTableHeader() ); } /** Exit the Application */ private void exitForm(java.awt.event.WindowEvent evt) { System.exit(0); } /** * @param args the command line arguments */ public static void main(String args[]) { new FishFace().show(); } // Variables declaration - do not modify private javax.swing.JTable jTable1; private javax.swing.JButton jButton1; private javax.swing.JScrollPane jScrollPane1; // End of variables declaration }
I understand. But I suggest to change it to enhancement or close it, because it need API change (to send proper message to treetableview), it isn't standard and is not easy to implement. Very small feature and big work. Reassign to Jano to get his opinion.
Well, I'd be content if this had a target of 4.0. We definitely need this eventually, but it isn't critical that it be in 3.4.
If everybody agree I am changing this to enhancement and reassigning back to Ales. Also rising priority to get it to next release.