/* (non-Javadoc)
   * @See org.teiid.designer.ui.wizards.INewModelWizardContributor#doFinish(org.teiid.designer.core.workspace.ModelResource, org.eclipse.core.runtime.IProgressMonitor)
   */
  @Override
  public void doFinish(ModelResource modelResource, IProgressMonitor monitor) {
    String transactionName =
        Util.getString("TransformationLinkContributor.transactionName"); // $NON-NLS-1$
    boolean started = ModelerCore.startTxn(transactionName, this);
    boolean succeeded = false;
    try {
      IStructuralCopyTreePopulator populator = transformationLinkPage.getTreePopulator();
      TreeViewer viewer = transformationLinkPage.getViewer();
      Map extraProperties =
          transformationLinkPage.isClearSupportsUpdate()
              ? MAP_CLEAR_SUPPORTS_UPDATES
              : MAP_KEEP_SUPPORTS_UPDATES;
      if ((populator != null) && (viewer != null)) {

        // all nodes selected, copy all:
        populator.copyModel(
            (ModelResource) viewer.getInput(),
            modelResource,
            extraProperties,
            transformationLinkPage.isCopyAllDescriptions(),
            monitor);
      }
      succeeded = true;
    } catch (Exception ex) {
      String message =
          UiConstants.Util.getString(
              "TransformationLinkContributor.doFinishError", //$NON-NLS-1$
              modelResource.getItemName());
      UiConstants.Util.log(IStatus.ERROR, ex, message);
    } finally {
      if (started) {
        if (succeeded) {
          ModelerCore.commitTxn();
        } else {
          ModelerCore.rollbackTxn();
        }
      }
    }
  }
 @Override
 public boolean copyAllDescriptions() {
   return transformationLinkPage.isCopyAllDescriptions();
 }