use of org.talend.repository.ui.actions.ExportProjectSettings in project tdi-studio-se by Talend.
the class ProjectSettingsPreferenceDialog method importPressed.
private void importPressed() {
FileDialog fileDialog = new FileDialog(getShell(), SWT.OPEN);
//$NON-NLS-1$
String[] files = new String[] { "*.xml" };
fileDialog.setFilterExtensions(files);
String path = fileDialog.open();
ImportProjectSettings settings = new ImportProjectSettings(path);
boolean error = false;
ExportProjectSettings original = new ExportProjectSettings(TEMP_PRODUCT_SETTING_XML);
original.saveProjectSettings();
try {
settings.updateProjectSettings();
} catch (Exception e) {
error = true;
showErrorMessage();
}
// close the projec settings and open it again to get new settings
if (!error) {
close();
ProjectSettingDialog dialog = new ProjectSettingDialog();
dialog.open();
}
}
use of org.talend.repository.ui.actions.ExportProjectSettings in project tdi-studio-se by Talend.
the class ProjectSettingsPreferenceDialog method exportPressed.
private void exportPressed() {
saveCurrentSettings();
FileDialog fileDialog = new FileDialog(getShell(), SWT.SAVE);
//$NON-NLS-1$
fileDialog.setFileName("ProjectSettings.xml");
//$NON-NLS-1$
String[] files = new String[] { "*.xml" };
fileDialog.setFilterExtensions(files);
String path = fileDialog.open();
if (path != null) {
if (!new File(path).exists() || MessageDialog.openConfirm(getShell(), //$NON-NLS-1$
Messages.getString("ProjectSettingsPreferenceDialog.overwriteTitle"), Messages.getString("ProjectSettingsPreferenceDialog.overwriteMessage"))) {
//$NON-NLS-1$
ExportProjectSettings settings = new ExportProjectSettings(path);
settings.saveProjectSettings();
}
}
}
Aggregations