data.addItem(Keys.NEW_NAME, newName);
// Get file to be renamed.
File file = getSelectedFile();
data.addItem(Keys.FILE, file);
// Create command.
Rename rename = new Rename();
try {
rename.perform(data);
} catch (Exception exception) {
exception.printStackTrace();
}
// Refresh panels.
CommandData refreshData = new CommandData();