fileName = fileName.substring(0, fileName.lastIndexOf("."));
dialog.setTitle("Export to image");
dialog.setOriginalFile(editorFile);
dialog.create();
dialog.setMessage("Specify a name and location for the image. Either enter .png, .jpg or .bmp extension.");
dialog.open();
IPath path = dialog.getResult();
if (path != null) {
IWorkspace workspace = ResourcesPlugin.getWorkspace();
IFile file = workspace.getRoot().getFile(path);
String ext = file.getFileExtension();