}
private TextEditor createEditor(final File file) {
String mainTitle = StringUtils.capitalize(fileType.toString().toLowerCase()) + " data";
int chunkSize = 100000;
TextEditor editor = TextEditorFactory.openFileInChunks(mainTitle, file, charset, chunkSize);
if (editor instanceof GenericEditor) {
((GenericEditor) editor).setSubTitle(tx.getName());
}
editor.setEditable(true);
editor.decorateText(TextStyles.DefaultText.asTextDecorator());
editor.addResource(new AbstractWindowElementResource() {
@Override
public void dispose(WindowElement e) {
file.delete();
}