Example #1
0
  @Override
  public void addPages() {
    if (isToolbar) {
      pathToSave = null;
    }
    salesforceSchemaWizardPage0 =
        new Step0WizardPage(
            connectionProperty,
            pathToSave,
            ERepositoryObjectType.METADATA_SALESFORCE_SCHEMA,
            !isRepositoryObjectEditable(),
            creation);

    salesforceSchemaWizardPage0.setTitle(
        Messages.getString("SalesforceWizardPage.titleCreate.Step")
            + " 1 " //$NON-NLS-1$ //$NON-NLS-2$
            + Messages.getString("FileWizardPage.of")
            + ALL_STEPS); //$NON-NLS-1$
    salesforceSchemaWizardPage0.setDescription(
        Messages.getString("SalesforceWizardPage.descriptionCreate.Step1")); // $NON-NLS-1$
    addPage(salesforceSchemaWizardPage0);
    if (creation) {
      setWindowTitle(Messages.getString("SalesforceSchemaWizard.windowTitleCreate")); // $NON-NLS-1$
    } else {
      setWindowTitle(Messages.getString("SalesforceSchemaWizard.windowTitleUpdate")); // $NON-NLS-1$
    }
    page1 =
        new SalesforceWizardPage(
            1,
            connectionItem,
            isRepositoryObjectEditable(),
            existingNames,
            salesforceAPI,
            contextModeManager);
    page1.setTitle(
        Messages.getString("SalesforceWizardPage.titleCreate.Step")
            + " 2 " //$NON-NLS-1$ //$NON-NLS-2$
            + Messages.getString("FileWizardPage.of")
            + ALL_STEPS); //$NON-NLS-1$
    page1.setDescription(
        Messages.getString("SalesforceWizardPage.descriptionCreate.Step2")); // $NON-NLS-1$
    addPage(page1);
    page1.setPageComplete(false);
  }
Example #2
0
  @Override
  public boolean performFinish() {
    boolean formIsPerformed = false;
    formIsPerformed = page1.isPageComplete();
    if (formIsPerformed) {
      IProxyRepositoryFactory factory = ProxyRepositoryFactory.getInstance();
      try {
        if (creation) {
          String nextId = factory.getNextId();
          connectionProperty.setId(nextId);
          factory.create(connectionItem, salesforceSchemaWizardPage0.getDestinationPath());
        } else {
          // update
          RepositoryUpdateManager.updateFileConnection(connectionItem);
          refreshInFinish(salesforceSchemaWizardPage0.isNameModifiedByUser());
          updateConnectionItem();
        }
        ProxyRepositoryFactory.getInstance()
            .saveProject(ProjectManager.getInstance().getCurrentProject());

      } catch (Exception e) {
        String detailError = e.toString();
        new ErrorDialogWidthDetailArea(
            getShell(),
            PID,
            Messages.getString("CommonWizard.persistenceException"), // $NON-NLS-1$
            detailError);
        log.error(
            Messages.getString("CommonWizard.persistenceException")
                + "\n"
                + detailError); //$NON-NLS-1$ //$NON-NLS-2$
        return false;
      }
      return true;
    } else {
      return false;
    }
  }