use of org.eclipse.ui.dialogs.SaveAsDialog in project InformationSystem by ObeoNetwork.
the class ApplicationEditor method doSaveAs.
/**
* 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));
}
}
}
use of org.eclipse.ui.dialogs.SaveAsDialog in project InformationSystem by ObeoNetwork.
the class DatabaseEditor method doSaveAs.
/**
* 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));
}
}
}
use of org.eclipse.ui.dialogs.SaveAsDialog in project InformationSystem by ObeoNetwork.
the class OverviewEditor method doSaveAs.
/**
* 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));
}
}
}
use of org.eclipse.ui.dialogs.SaveAsDialog in project gemoc-studio by eclipse.
the class GexpressionsEditor method doSaveAs.
/**
* 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));
}
}
}
use of org.eclipse.ui.dialogs.SaveAsDialog in project webtools.sourceediting by eclipse.
the class AdvancedOptionsDialog method invokeExportDialog.
protected void invokeExportDialog() {
IPath originalFilePath = null;
IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
if (projects.length > 0) {
// $NON-NLS-1$
originalFilePath = projects[0].getFullPath().append(".xmlcatalog");
}
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);
String fileName = file.getLocation().toFile().toURI().toString();
// here we save the catalog entries to the selected file
try {
createFileIfRequired(file);
workingUserCatalog.setLocation(fileName);
workingUserCatalog.save();
} catch (Exception ex) {
try {
String title = XMLCatalogMessages.UI_LABEL_CATALOG_SAVE_ERROR;
String briefMessage = XMLCatalogMessages.UI_LABEL_CATALOG_COULD_NOT_BE_SAVED;
String reason = file.isReadOnly() ? NLS.bind(XMLCatalogMessages.UI_LABEL_FILE_IS_READ_ONLY, fileName) : NLS.bind(XMLCatalogMessages.ERROR_SAVING_FILE, fileName);
String details = NLS.bind(XMLCatalogMessages.ERROR_SAVING_FILE, fileName);
ErrorDialog.openError(Display.getCurrent().getActiveShell(), title, briefMessage, createStatus(reason, details));
} catch (Exception ex2) {
}
}
close();
}
}
}
Aggregations