Add Double Click, Enter support for TestChooser

Just for convenience. :slight_smile:

[patch]

Index: src/test/jme3test/TestChooser.java

===================================================================

— src/test/jme3test/TestChooser.java (revision 7137)

+++ src/test/jme3test/TestChooser.java (working copy)

@@ -40,6 +40,10 @@

import java.awt.Toolkit;

import java.awt.event.ActionEvent;

import java.awt.event.ActionListener;

+import java.awt.event.KeyAdapter;

+import java.awt.event.KeyEvent;

+import java.awt.event.MouseAdapter;

+import java.awt.event.MouseEvent;

import java.io.File;

import java.io.FileFilter;

import java.io.IOException;

@@ -316,6 +320,23 @@

selectedClass = (Class) list.getSelectedValue();

}

});

  •    list.addMouseListener(new MouseAdapter() {<br />
    
  •        public void mouseClicked(MouseEvent e) {<br />
    
  •            if (e.getClickCount() == 2 &amp;&amp; selectedClass != null) {<br />
    
  •                startApp(selectedClass);<br />
    
  •                dispose();<br />
    
  •            }<br />
    
  •        }<br />
    
  •    });<br />
    
  •    list.addKeyListener(new KeyAdapter() {<br />
    
  •        @Override<br />
    
  •        public void keyTyped(KeyEvent e) {<br />
    
  •            if (e.getKeyCode() == KeyEvent.VK_ENTER) {<br />
    
  •                startApp(selectedClass);<br />
    
  •                dispose();<br />
    
  •            }<br />
    
  •        }<br />
    
  •    });<br />
    

final JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.CENTER));
mainPanel.add(buttonPanel, BorderLayout.PAGE_END);

[/patch]
2 Likes

You don’t imagine how many times i said to myself “rhaa damn it I should add double click support to this thing” but never did it :smiley:

Thanks for this Mulova :wink:

What about adding that you can start multiple tests with one run? :stuck_out_tongue:

Or maybe a button labeled “The Crippler” that runs ALL of the tests… At the same time!



muhahahahaha! lightning bolt, lightning bolt



Errr. Nothing. Nothing.



Cheers!

~FlaH

normen said:
What about adding that you can start multiple tests with one run? :P

You don’t imagine how many times i said to myself “rhaa damn it I should add multiple tests support to this thing” but never did it . (sorry for copy&paste your sentence nehon. :p )
Let me add this too. :)

Committed. rev.7141

Multiple selection is supported.

To execute tests one by one, I called Application.start() instead of main()

And added ‘showSetting’ checkbox whether or not to show setting dialog.