Search in sources :

Example 1 with ImportProjectSettings

use of org.talend.repository.ui.actions.ImportProjectSettings 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();
    }
}
Also used : ImportProjectSettings(org.talend.repository.ui.actions.ImportProjectSettings) ExportProjectSettings(org.talend.repository.ui.actions.ExportProjectSettings) FileDialog(org.eclipse.swt.widgets.FileDialog) PersistenceException(org.talend.commons.exception.PersistenceException)

Aggregations

FileDialog (org.eclipse.swt.widgets.FileDialog)1 PersistenceException (org.talend.commons.exception.PersistenceException)1 ExportProjectSettings (org.talend.repository.ui.actions.ExportProjectSettings)1 ImportProjectSettings (org.talend.repository.ui.actions.ImportProjectSettings)1