aMap.put("cut", new AbstractAction("Cut fields") {
@Override
public void actionPerformed(ActionEvent e) {
List<TrackInfoItem> selectedItems = getSelectedItems(table);
if (!selectedItems.isEmpty()) {
TrackInfoItemSelection selection = new TrackInfoItemSelection(selectedItems);
getToolkit().getSystemClipboard().setContents(selection, selection);
getTagFieldModel(table).removeTrackInfoItems(selectedItems);
refreshTable(table);
}
}
});
aMap.put("copy", new AbstractAction("Copy fields") {
@Override
public void actionPerformed(ActionEvent e) {
List<TrackInfoItem> selectedItems = getSelectedItems(table);
if (!selectedItems.isEmpty()) {
TrackInfoItemSelection selection = new TrackInfoItemSelection(selectedItems);
getToolkit().getSystemClipboard().setContents(selection, selection);
}
}
});