[fixes #1088] Set 'Enter' as hotkey for select motor
This commit is contained in:
parent
ce8be05865
commit
d916fdc64a
@ -4,16 +4,20 @@ import java.awt.CardLayout;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.awt.event.MouseAdapter;
|
||||
import java.awt.event.MouseEvent;
|
||||
|
||||
import javax.swing.AbstractAction;
|
||||
import javax.swing.Box;
|
||||
import javax.swing.BoxLayout;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JScrollPane;
|
||||
import javax.swing.JTable;
|
||||
import javax.swing.KeyStroke;
|
||||
import javax.swing.ListSelectionModel;
|
||||
import javax.swing.SwingUtilities;
|
||||
import javax.swing.event.TableModelEvent;
|
||||
@ -122,6 +126,15 @@ public class MotorConfigurationPanel extends FlightConfigurablePanel<MotorMount>
|
||||
});
|
||||
this.add(resetIgnitionButton, "sizegroup button, wrap");
|
||||
|
||||
// Set 'Enter' key action to open the motor selection dialog
|
||||
table.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "Enter");
|
||||
table.getActionMap().put("Enter", new AbstractAction() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent ae) {
|
||||
selectMotor();
|
||||
}
|
||||
});
|
||||
|
||||
updateButtonState();
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user