[fixes #1088] Set 'Enter' hotkey for recovery and separation tables
This commit is contained in:
parent
b26ae9e541
commit
65927d485b
@ -2,14 +2,18 @@ package net.sf.openrocket.gui.main.flightconfigpanel;
|
||||
|
||||
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.JButton;
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.JDialog;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JScrollPane;
|
||||
import javax.swing.JTable;
|
||||
import javax.swing.KeyStroke;
|
||||
import javax.swing.ListSelectionModel;
|
||||
import javax.swing.SwingUtilities;
|
||||
|
||||
@ -59,6 +63,15 @@ public class RecoveryConfigurationPanel extends FlightConfigurablePanel<Recovery
|
||||
}
|
||||
});
|
||||
this.add(resetDeploymentButton, "sizegroup button, wrap");
|
||||
|
||||
// Set 'Enter' key action to open the recovery 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) {
|
||||
selectDeployment();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -2,14 +2,18 @@ package net.sf.openrocket.gui.main.flightconfigpanel;
|
||||
|
||||
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.JButton;
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.JDialog;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JScrollPane;
|
||||
import javax.swing.JTable;
|
||||
import javax.swing.KeyStroke;
|
||||
import javax.swing.ListSelectionModel;
|
||||
import javax.swing.SwingUtilities;
|
||||
|
||||
@ -63,6 +67,14 @@ public class SeparationConfigurationPanel extends FlightConfigurablePanel<AxialS
|
||||
});
|
||||
this.add(resetDeploymentButton, "sizegroup button, wrap");
|
||||
|
||||
// Set 'Enter' key action to open the separation 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) {
|
||||
selectSeparation();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
x
Reference in New Issue
Block a user