/**
  * The framework calls this to create the contents of the wizard.
  * <!-- begin-user-doc -->
  * <!-- end-user-doc -->
  *
  * @generated
  */
 public void addPages() {
   initialObjectCreationPage = new WorkaroundModelWizardInitialObjectCreationPage("Whatever2");
   initialObjectCreationPage.setTitle(
       WorkaroundEditorPlugin.INSTANCE.getString("_UI_WorkaroundModelWizard_label"));
   initialObjectCreationPage.setDescription(
       WorkaroundEditorPlugin.INSTANCE.getString("_UI_Wizard_initial_object_description"));
   addPage(initialObjectCreationPage);
 }
  /**
   * Do the work after everything is specified.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   *
   * @generated
   */
  public boolean performFinish() {
    try {
      // Get the URI of the model file.
      //
      final URI fileURI = getModelURI();
      if (new File(fileURI.toFileString()).exists()) {
        if (!MessageDialog.openQuestion(
            getShell(),
            WorkaroundEditorPlugin.INSTANCE.getString("_UI_Question_title"),
            WorkaroundEditorPlugin.INSTANCE.getString(
                "_WARN_FileConflict", new String[] {fileURI.toFileString()}))) {
          initialObjectCreationPage.selectFileField();
          return false;
        }
      }

      // Do the work within an operation.
      //
      IRunnableWithProgress operation =
          new IRunnableWithProgress() {
            public void run(IProgressMonitor progressMonitor) {
              try {
                // Create a resource set
                //
                ResourceSet resourceSet = new ResourceSetImpl();

                // Create a resource for this file.
                //
                Resource resource = resourceSet.createResource(fileURI);

                // Add the initial model object to the contents.
                //
                EObject rootObject = createInitialModel();
                if (rootObject != null) {
                  resource.getContents().add(rootObject);
                }

                // Save the contents of the resource to the file system.
                //
                Map options = new HashMap();
                options.put(XMLResource.OPTION_ENCODING, initialObjectCreationPage.getEncoding());
                resource.save(options);
              } catch (Exception exception) {
                WorkaroundEditorPlugin.INSTANCE.log(exception);
              } finally {
                progressMonitor.done();
              }
            }
          };

      getContainer().run(false, false, operation);

      return WorkaroundEditorAdvisor.openEditor(workbench, fileURI);
    } catch (Exception exception) {
      WorkaroundEditorPlugin.INSTANCE.log(exception);
      return false;
    }
  }
 /**
  * Get the URI from the page.
  * <!-- begin-user-doc -->
  * <!-- end-user-doc -->
  *
  * @generated
  */
 public URI getModelURI() {
   return initialObjectCreationPage.getFileURI();
 }
 /**
  * Create a new model.
  * <!-- begin-user-doc -->
  * <!-- end-user-doc -->
  *
  * @generated
  */
 protected EObject createInitialModel() {
   EClass eClass =
       (EClass) workaroundPackage.getEClassifier(initialObjectCreationPage.getInitialObjectName());
   EObject rootObject = workaroundFactory.create(eClass);
   return rootObject;
 }