if (preparedFile.isImageFile()) {
Image image = (Image) preparedFile.getContent();
dispatchService.fireEvent(new ShowImageEvent(image));
} else if (preparedFile.isTextFile()) {
String text = (String) preparedFile.getContent();
dispatchService.fireEvent(new ShowTextEvent(text));
}
} catch (ShowFileContentAdapterException e) {
JOptionPane.showMessageDialog(null, BaseBundle.getValue("error.unknow.file.type"));
}
}