use of com.liferay.ide.ui.form.IDEFormEditor in project liferay-ide by liferay.
the class InputContext method doSaveAs.
/**
* @param monitor
*/
public void doSaveAs(IProgressMonitor monitor) throws Exception {
// Get the editor shell
IDEFormEditor editor = getEditor();
Shell shell = editor.getSite().getShell();
// Create the save as dialog
SaveAsDialog dialog = new SaveAsDialog(shell);
// Set the initial file name to the original file name
IFile file = null;
if (_fEditorInput instanceof IFileEditorInput) {
file = ((IFileEditorInput) _fEditorInput).getFile();
dialog.setOriginalFile(file);
}
// Create the dialog
dialog.create();
if (_fDocumentProvider.isDeleted(_fEditorInput) && (file != null)) {
String message = NLS.bind("File does not exist: {0}", file.getName());
dialog.setErrorMessage(null);
dialog.setMessage(message, IMessageProvider.WARNING);
}
if (dialog.open() == Window.OK) {
// Get the path to where the new file will be stored
IPath path = dialog.getResult();
_handleSaveAs(monitor, path);
}
}
Aggregations