public void actionPerformed(ActionEvent event) {
// Get directory name.
Collection<File> sources = getSourceFiles();
File destination = getDestinationPath();
CommandData data = new CommandData();
data.addItem(Keys.SOURCE_FILES, sources);
data.addItem(Keys.DEST_DIR, destination);
JDialog dialog = new JDialog();
ZipUnzipPanel panel = new ZipUnzipPanel();
panel.setSource(sources);
panel.setDestination(destination);
dialog.add(panel);
dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
dialog.pack();
dialog.setVisible(true);
// Create command.
ZipUnzip command = new ZipUnzip();
try {
command.perform(data);
} catch (Exception exception) {
exception.printStackTrace();
}
// Refresh panels.
CommandData refreshData = new CommandData();
refreshData.addItem(Keys.PANELS, panels);
Refresh refresh = new Refresh();
try {
refresh.perform(refreshData);
} catch (Exception exception) {
exception.printStackTrace();