});
keyStrokes = copyKeyStrokesFromAction(RENAME_ACTION_ID, KeyStroke.getKeyStroke("alt shift R"));
registerAction("renameScratch", keyStrokes, new AbstractAction() {
@Override public void actionPerformed(ActionEvent event) {
final Scratch scratch = selectedScratch();
if (scratch != null) {
ScratchListPopup.this.dispose();
onRenameScratch(scratch);
}
}
});
keyStrokes = copyKeyStrokesFromAction(DELETE_ACTION_ID, KeyStroke.getKeyStroke("DELETE"));
registerAction("deleteScratch", keyStrokes, new AbstractAction() {
@Override public void actionPerformed(ActionEvent event) {
Scratch scratch = selectedScratch();
if (scratch != null) {
ScratchListPopup.this.dispose();
onScratchDelete(scratch);
}
}
});
keyStrokes = copyKeyStrokesFromAction(DELETE_NO_PROMPT_ACTION_ID, KeyStroke.getKeyStroke("ctrl DELETE"));
registerAction("deleteScratchWithoutPrompt", keyStrokes, new AbstractAction() {
@Override public void actionPerformed(ActionEvent event) {
Scratch scratch = selectedScratch();
if (scratch != null) {
onScratchDeleteWithoutPrompt(scratch);
delete(scratch);
}
}
});
registerAction("moveScratchUp", KeyStroke.getKeyStroke("alt UP"), new AbstractAction() {
@Override public void actionPerformed(ActionEvent event) {
Scratch scratch = selectedScratch();
if (scratch != null) {
move(scratch, ScratchConfig.UP);
onScratchMoved(scratch, ScratchConfig.UP);
}
}
});
registerAction("moveScratchDown", KeyStroke.getKeyStroke("alt DOWN"), new AbstractAction() {
@Override public void actionPerformed(ActionEvent event) {
Scratch scratch = selectedScratch();
if (scratch != null) {
move(scratch, ScratchConfig.DOWN);
onScratchMoved(scratch, ScratchConfig.DOWN);
}
}