/** * Open an appropriate dialog so that the user can specify a manifest * to save */ protected void handleNewManifestFileBrowseButtonPressed() { // Use Save As dialog to select a new file inside the workspace SaveAsDialog dialog= new SaveAsDialog(getContainer().getShell()); dialog.create(); dialog.getShell().setText(JarPackagerMessages.JarManifestWizardPage_saveAsDialog_title); dialog.setMessage(JarPackagerMessages.JarManifestWizardPage_saveAsDialog_message); dialog.setOriginalFile(createFileHandle(fJarPackage.getManifestLocation())); if (dialog.open() == Window.OK) { fJarPackage.setManifestLocation(dialog.getResult()); fNewManifestFileText.setText(dialog.getResult().toString()); } }
@Override protected Control createContents(Composite parent) { Control contents = super.createContents(parent); initializeControls(); validatePage(); resourceGroup.setFocus(); setTitle(IDEWorkbenchMessages.SaveAsDialog_title); ImageDescriptor descriptor = IDEInternalWorkbenchImages.getImageDescriptor( IDEInternalWorkbenchImages.IMG_DLGBAN_SAVEAS_DLG); if(descriptor != null) { dlgTitleImage = descriptor.createImage(); setTitleImage(dlgTitleImage); } setMessage(IDEWorkbenchMessages.SaveAsDialog_message); return contents; }
SaveAsDialog dialog = new SaveAsDialog(getShell()); if (originalFilePath != null) { IFile originalFile = ResourcesPlugin.getWorkspace().getRoot().getFile(originalFilePath); dialog.setOriginalFile(originalFile); dialog.create(); dialog.getShell().setText(XMLCatalogMessages.UI_LABEL_EXPORT_DIALOG_TITLE); dialog.setTitle(XMLCatalogMessages.UI_LABEL_EXPORT_DIALOG_HEADING); dialog.setMessage(XMLCatalogMessages.UI_LABEL_EXPORT_DIALOG_MESSAGE); dialog.setBlockOnOpen(true); int rc = dialog.open(); if (rc == Window.OK) { IPath path = dialog.getResult(); if (path != null) { IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
IEditorInput input = getEditorInput(); SaveAsDialog dialog = new SaveAsDialog(shell); dialog.setOriginalName(((SQLEditorStorageEditorInput) input).getName() + ".sql"); dialog.create(); if (dialog.open() == Window.CANCEL) IPath filePath = dialog.getResult(); if (filePath == null)
/** * This also changes the editor's input. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void doSaveAs() { SaveAsDialog saveAsDialog = new SaveAsDialog(getSite().getShell()); saveAsDialog.open(); IPath path = saveAsDialog.getResult(); if (path != null) { IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path); if (file != null) { doSaveAs(URI.createPlatformResourceURI(file.getFullPath().toString(), true), new FileEditorInput(file)); } } }
SaveAsDialog dialog = new SaveAsDialog( getSite().getShell() ); if ( !( getEditorInput() instanceof NonExistingServerConfigurationInput ) ) dialog.setOriginalFile( ResourcesPlugin.getWorkspace().getRoot().getFile( new Path( getEditorInput().getToolTipText() ) ) ); if ( dialog.open() != Dialog.OK ) IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile( dialog.getResult() );
ImageElement data = view.getAdapter(ImageElement.class); if (data != null) { SaveAsDialog dialog = new SaveAsDialog(HandlerUtil.getActiveShell(event)); dialog.setTitle(PDEUIMessages.SaveToWorkspace_SaveImageToWorkspace); dialog.setOriginalName(data.getFileName()); if (dialog.open() == Window.OK) { IPath result = dialog.getResult();
IDEWorkbenchMessages.SaveAsDialog_overwriteQuestion, path .toString()); MessageDialog d = new MessageDialog(getShell(), IDEWorkbenchMessages.Question, null, question, MessageDialog.QUESTION, 0, case 2: // Cancel default: cancelPressed(); return; close();
if (!resourceGroup.areAllValuesValid()) { if (!resourceGroup.getResource().equals("")) { //$NON-NLS-1$ setErrorMessage(resourceGroup.getProblemMessage()); } else { setErrorMessage(null); IProject project = workspace.getRoot().getProject(projectName); if(!project.isOpen()) { setErrorMessage(IDEWorkbenchMessages.SaveAsDialog_closedProjectMessage); return false; setErrorMessage(result.getMessage()); return false; setErrorMessage(null); return true;
SaveAsDialog dialog= new SaveAsDialog(shell); dialog.open(); IPath path= dialog.getResult();
/** * Open an appropriate dialog so that the user can specify a manifest * to save */ protected void handleNewManifestFileBrowseButtonPressed() { // Use Save As dialog to select a new file inside the workspace SaveAsDialog dialog= new SaveAsDialog(getContainer().getShell()); dialog.create(); dialog.getShell().setText(JarPackagerMessages.JarManifestWizardPage_saveAsDialog_title); dialog.setMessage(JarPackagerMessages.JarManifestWizardPage_saveAsDialog_message); dialog.setOriginalFile(createFileHandle(fJarPackage.getManifestLocation())); if (dialog.open() == Window.OK) { fJarPackage.setManifestLocation(dialog.getResult()); fNewManifestFileText.setText(dialog.getResult().toString()); } }
/** * Open an appropriate dialog so that the user can specify a manifest * to save */ protected void handleNewManifestFileBrowseButtonPressed() { // Use Save As dialog to select a new file inside the workspace SaveAsDialog dialog= new SaveAsDialog(getContainer().getShell()); dialog.create(); dialog.getShell().setText(JarPackagerMessages.JarManifestWizardPage_saveAsDialog_title); dialog.setMessage(JarPackagerMessages.JarManifestWizardPage_saveAsDialog_message); dialog.setOriginalFile(createFileHandle(fJarPackage.getManifestLocation())); if (dialog.open() == Window.OK) { fJarPackage.setManifestLocation(dialog.getResult()); fNewManifestFileText.setText(dialog.getResult().toString()); } }
/** * Open an appropriate dialog so that the user can specify a manifest * to save */ protected void handleNewManifestFileBrowseButtonPressed() { // Use Save As dialog to select a new file inside the workspace SaveAsDialog dialog= new SaveAsDialog(getContainer().getShell()); dialog.create(); dialog.getShell().setText(JarPackagerMessages.JarManifestWizardPage_saveAsDialog_title); dialog.setMessage(JarPackagerMessages.JarManifestWizardPage_saveAsDialog_message); dialog.setOriginalFile(createFileHandle(fJarPackage.getManifestLocation())); if (dialog.open() == Window.OK) { fJarPackage.setManifestLocation(dialog.getResult()); fNewManifestFileText.setText(dialog.getResult().toString()); } }
/** * Open an appropriate destination browser so that the user can specify a source * to import from */ protected void handleDescriptionFileBrowseButtonPressed() { SaveAsDialog dialog= new SaveAsDialog(getContainer().getShell()); dialog.create(); dialog.getShell().setText(JarPackagerMessages.JarOptionsPage_saveAsDialog_title); dialog.setMessage(JarPackagerMessages.JarOptionsPage_saveAsDialog_message); dialog.setOriginalFile(createFileHandle(fJarPackage.getDescriptionLocation())); if (dialog.open() == Window.OK) { IPath path= dialog.getResult(); path= path.removeFileExtension().addFileExtension(JarPackagerUtil.DESCRIPTION_EXTENSION); fDescriptionFileText.setText(path.toString()); } }
/** * Open an appropriate destination browser so that the user can specify a source * to import from */ protected void handleDescriptionFileBrowseButtonPressed() { SaveAsDialog dialog= new SaveAsDialog(getContainer().getShell()); dialog.create(); dialog.getShell().setText(JarPackagerMessages.JarOptionsPage_saveAsDialog_title); dialog.setMessage(JarPackagerMessages.JarOptionsPage_saveAsDialog_message); dialog.setOriginalFile(createFileHandle(fJarPackage.getDescriptionLocation())); if (dialog.open() == Window.OK) { IPath path= dialog.getResult(); path= path.removeFileExtension().addFileExtension(AJJarPackagerUtil.DESCRIPTION_EXTENSION); fDescriptionFileText.setText(path.toString()); } }
/** * Open an appropriate destination browser so that the user can specify a source * to import from */ protected void handleDescriptionFileBrowseButtonPressed() { SaveAsDialog dialog= new SaveAsDialog(getContainer().getShell()); dialog.create(); dialog.getShell().setText(JarPackagerMessages.JarOptionsPage_saveAsDialog_title); dialog.setMessage(JarPackagerMessages.JarOptionsPage_saveAsDialog_message); dialog.setOriginalFile(createFileHandle(fJarPackage.getDescriptionLocation())); if (dialog.open() == Window.OK) { IPath path= dialog.getResult(); path= path.removeFileExtension().addFileExtension(JarPackagerUtil.DESCRIPTION_EXTENSION); fDescriptionFileText.setText(path.toString()); } }
/** * Open an appropriate destination browser so that the user can specify a source * to import from */ protected void handleDescriptionFileBrowseButtonPressed() { SaveAsDialog dialog= new SaveAsDialog(getContainer().getShell()); dialog.create(); dialog.getShell().setText(JarPackagerMessages.JarOptionsPage_saveAsDialog_title); dialog.setMessage(JarPackagerMessages.JarOptionsPage_saveAsDialog_message); dialog.setOriginalFile(createFileHandle(fJarPackage.getDescriptionLocation())); if (dialog.open() == Window.OK) { IPath path= dialog.getResult(); path= path.removeFileExtension().addFileExtension(JarPackagerUtil.DESCRIPTION_EXTENSION); fDescriptionFileText.setText(path.toString()); } }
/** * Open an appropriate destination browser so that the user can specify a source * to import from */ protected void handleDescriptionFileBrowseButtonPressed() { SaveAsDialog dialog= new SaveAsDialog(getContainer().getShell()); dialog.create(); dialog.getShell().setText(JarPackagerMessages.JarPackageWizardPage_saveAsDialog_title); dialog.setMessage(JarPackagerMessages.JarPackageWizardPage_saveAsDialog_message); dialog.setOriginalFile(createFileHandle(fJarPackage.getDescriptionLocation())); if (dialog.open() == Window.OK) { IPath path= dialog.getResult(); path= path.removeFileExtension().addFileExtension(AJJarPackagerUtil.DESCRIPTION_EXTENSION); fDescriptionFileText.setText(path.toString()); } }
public void doSaveAs(IProgressMonitor monitor) throws Exception { // Get the editor shell Shell shell = getEditor().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(); // Warn the user if the underlying file does not exist if (fDocumentProvider.isDeleted(fEditorInput) && (file != null)) { String message = NLS.bind(PDEUIMessages.InputContext_errorMessageFileDoesNotExist, file.getName()); dialog.setErrorMessage(null); dialog.setMessage(message, IMessageProvider.WARNING); } // Open the dialog if (dialog.open() == Window.OK) { // Get the path to where the new file will be stored IPath path = dialog.getResult(); handleSaveAs(monitor, path); } }
ITargetDefinition target = getTarget(); SaveAsDialog dialog = new SaveAsDialog(getSite().getShell()); dialog.create(); dialog.setMessage(PDEUIMessages.TargetEditor_0, IMessageProvider.NONE); if (target.getHandle() instanceof WorkspaceFileTargetHandle) { WorkspaceFileTargetHandle currentTargetHandle = (WorkspaceFileTargetHandle) target.getHandle(); dialog.setOriginalFile(currentTargetHandle.getTargetFile()); dialog.open(); IPath path = dialog.getResult();