/**
  * Create a new model.
  * <!-- begin-user-doc -->
  * <!-- end-user-doc -->
  *
  * @generated
  */
 protected EObject createInitialModel() {
   EClass eClass =
       (EClass)
           argumentationPackage.getEClassifier(initialObjectCreationPage.getInitialObjectName());
   EObject rootObject = argumentationFactory.create(eClass);
   return rootObject;
 }
  /**
   * The framework calls this to create the contents of the wizard.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   *
   * @generated
   */
  @Override
  public void addPages() {
    // Create a page, set the title, and the initial model file name.
    //
    newFileCreationPage =
        new ArgumentationModelWizardNewFileCreationPage("Whatever", selection); // $NON-NLS-1$
    newFileCreationPage.setTitle(
        SACMEditorPlugin.INSTANCE.getString("_UI_ArgumentationModelWizard_label")); // $NON-NLS-1$
    newFileCreationPage.setDescription(
        SACMEditorPlugin.INSTANCE.getString(
            "_UI_ArgumentationModelWizard_description")); //$NON-NLS-1$
    newFileCreationPage.setFileName(
        SACMEditorPlugin.INSTANCE.getString("_UI_ArgumentationEditorFilenameDefaultBase")
            + "."
            + FILE_EXTENSIONS.get(0)); // $NON-NLS-1$ //$NON-NLS-2$
    addPage(newFileCreationPage);

    // Try and get the resource selection to determine a current directory for the file dialog.
    //
    if (selection != null && !selection.isEmpty()) {
      // Get the resource...
      //
      Object selectedElement = selection.iterator().next();
      if (selectedElement instanceof IResource) {
        // Get the resource parent, if its a file.
        //
        IResource selectedResource = (IResource) selectedElement;
        if (selectedResource.getType() == IResource.FILE) {
          selectedResource = selectedResource.getParent();
        }

        // This gives us a directory...
        //
        if (selectedResource instanceof IFolder || selectedResource instanceof IProject) {
          // Set this for the container.
          //
          newFileCreationPage.setContainerFullPath(selectedResource.getFullPath());

          // Make up a unique new name here.
          //
          String defaultModelBaseFilename =
              SACMEditorPlugin.INSTANCE.getString(
                  "_UI_ArgumentationEditorFilenameDefaultBase"); //$NON-NLS-1$
          String defaultModelFilenameExtension = FILE_EXTENSIONS.get(0);
          String modelFilename =
              defaultModelBaseFilename + "." + defaultModelFilenameExtension; // $NON-NLS-1$
          for (int i = 1; ((IContainer) selectedResource).findMember(modelFilename) != null; ++i) {
            modelFilename =
                defaultModelBaseFilename + i + "." + defaultModelFilenameExtension; // $NON-NLS-1$
          }
          newFileCreationPage.setFileName(modelFilename);
        }
      }
    }
    initialObjectCreationPage =
        new ArgumentationModelWizardInitialObjectCreationPage("Whatever2"); // $NON-NLS-1$
    initialObjectCreationPage.setTitle(
        SACMEditorPlugin.INSTANCE.getString("_UI_ArgumentationModelWizard_label")); // $NON-NLS-1$
    initialObjectCreationPage.setDescription(
        SACMEditorPlugin.INSTANCE.getString(
            "_UI_Wizard_initial_object_description")); //$NON-NLS-1$
    addPage(initialObjectCreationPage);
  }