wieseljonas / java-libpst

Automatically exported from code.google.com/p/java-libpst
1 stars 1 forks source link

Remove unnecessary event handling in TestGui #16

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi, here is a little improvement:

In TestGui.java valueChanged(ListSelectionEvent e) method, you can add a test 
to check if the user is still playing with the list and only display change 
when user release mouse button in the list:

[...]
        public void valueChanged(ListSelectionEvent e) {
          // Only managed valueChanged event only in the final result of the user's action
          if (e.getValueIsAdjusting())
            return;
          JTable source = emailTable;
          PSTMessage selectedMessage = emailTableModel.getMessageAtRow(source.getSelectedRow());
          if (selectedMessage instanceof PSTContact) {
            PSTContact contact = (PSTContact) selectedMessage;
            emailText.setText(contact.toString());
[...]

Source
http://download-llnw.oracle.com/javase/tutorial/uiswing/components/list.html#sel
ection

PS.: nice to see a pure java lib to handle pst file format ;-)

Original issue reported on code.google.com by franck.a...@gmail.com on 10 Aug 2010 at 3:49

GoogleCodeExporter commented 9 years ago
I've added this to my copy of TestGUI.java and it works fine for me.  I've made 
too many other modifications to my copy of TestGUI.java too much to consider 
committing the change to svn at the moment.

Original comment by orin.e...@gmail.com on 13 Aug 2010 at 8:00