SaveAsDialog dialog = new SaveAsDialog(getWorkbenchPart().getSite().getShell());
dialog.setOriginalName(Messages.ExportAction_JPEG_ORIGINAL_TITLE);
dialog.create();
dialog.setMessage(BeansGraphPlugin.getResourceString("Editor.SaveAsDialog.message")); //$NON-NLS-1$
dialog.setOriginalName(Messages.ExportAction_PNG_ORIGINAL_TITLE);
dialog.open();
IPath path = dialog.getResult();
if (path != null) {
IWorkspace workspace = ResourcesPlugin.getWorkspace();
IFile file = workspace.getRoot().getFile(path);
String ext = file.getFileExtension();