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 22998 - [TTV] A table with no contents should show a message
Summary: [TTV] A table with no contents should show a message
Status: NEW
Alias: None
Product: platform
Classification: Unclassified
Component: Outline&TreeTable (show other bugs)
Version: 3.x
Hardware: All All
: P4 blocker (vote)
Assignee: Martin Entlicher
URL:
Keywords: UI
Depends on:
Blocks: 33281
  Show dependency tree
 
Reported: 2002-04-30 20:52 UTC by David-john Burrowes
Modified: 2010-10-07 11:33 UTC (History)
2 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David-john Burrowes 2002-04-30 20:52:33 UTC
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
Comment 1 Jan Jancura 2002-05-02 15:19:18 UTC
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
Comment 2 Marian Mirilovic 2002-05-02 15:59:38 UTC
reassigne to Ales (Tree Table owner)
Comment 3 akemr 2002-05-03 08:22:51 UTC
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?

Comment 4 David-john Burrowes 2002-05-06 23:05:14 UTC
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?
Comment 5 akemr 2002-05-07 07:57:06 UTC
So it looks like debugger specific behaviour, reassign.
Comment 6 Jan Jancura 2002-05-07 11:40:49 UTC
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.

Comment 7 akemr 2002-05-07 13:49:17 UTC
Because I have no idea how to solve this issue, I suggest
to close it.
Comment 8 David-john Burrowes 2002-05-07 19:38:44 UTC
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
    
}
Comment 9 akemr 2002-06-18 08:00:43 UTC
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.
Comment 10 David-john Burrowes 2002-06-19 00:33:40 UTC
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.

Comment 11 jrojcek 2002-06-27 08:56:29 UTC
If everybody agree I am changing this to enhancement and reassigning
back to Ales. Also rising priority to get it to next release.