}
private void assignHotkeys() {
// assign keys 1-6 - set priority of selected items
final Action setPriorityAction = new AbstractAction() {
public void actionPerformed(final ActionEvent event) {
final FreenetPriority prio = FreenetPriority.getPriority( new Integer(event.getActionCommand()));
final List<FrostUploadItem> selectedItems = modelTable.getSelectedItems();
changeItemPriorites(selectedItems, prio);
}
};
getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_1, 0), "SETPRIO");
getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_2, 0), "SETPRIO");
getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_3, 0), "SETPRIO");
getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_4, 0), "SETPRIO");
getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_5, 0), "SETPRIO");
getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_6, 0), "SETPRIO");
getActionMap().put("SETPRIO", setPriorityAction);
// Enter
final Action setOpenFileAction = new AbstractAction() {
public void actionPerformed(final ActionEvent event) {
openFile(modelTable.getSelectedItem());
}
};
getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0),"OpenFile");