Exemplo n.º 1
0
 /** {@inheritDoc} */
 @Override
 protected WizardNewProjectCreationPage createNewProjectCreationPage() {
   WizardNewProjectCreationPage newProjectPage = super.createNewProjectCreationPage();
   newProjectPage.setTitle("Papyrus SysML Project");
   newProjectPage.setDescription("Create a New Papyrus SysML Project");
   return newProjectPage;
 }
  public void addPages() {
    channel = new ModelChannel("newBlockWizard");
    new NewMetroProjectWizardController().initialize();

    projectPage = new WizardNewProjectCreationPage("mainPage"); // $NON-NLS-1$
    String title =
        MetroStudioUI.getResourceString("new.blockDevelopment.mainPage.title"); // $NON-NLS-1$
    projectPage.setTitle(title);

    String descr =
        MetroStudioUI.getResourceString("new.blockDevelopment.mainPage.description"); // $NON-NLS-1$
    projectPage.setDescription(descr);

    addPage(projectPage);

    selectionPage = new NewMetroProjectSelectionPage("selectionPage", channel);
    title =
        MetroStudioUI.getResourceString("new.blockDevelopment.selectionPage.title"); // $NON-NLS-1$
    selectionPage.setTitle(title);

    descr =
        MetroStudioUI.getResourceString("new.blockDevelopment.mainPage.description"); // $NON-NLS-1$
    selectionPage.setDescription(descr);
    addPage(selectionPage);
  }
Exemplo n.º 3
0
 @Override
 public void addPages() {
   // TODO Auto-generated method stub
   super.addPages();
   page = new WizardNewProjectCreationPage("From Scratch Project Wizard");
   page.setTitle("New Project");
   page.setDescription("Creates a new planner project");
   addPage(page);
 }
Exemplo n.º 4
0
 protected void doPerformFinish(IProgressMonitor monitor) throws Exception {
   new org.emftext.sdk.concretesyntax.resource.cs.ui.CsNewProjectWizardLogic()
       .createExampleProject(
           monitor,
           wizardNewProjectCreationPage.getLocationPath(),
           wizardNewProjectCreationPage.getProjectName(),
           org.emftext.sdk.concretesyntax.resource.cs.ui.CsUIPlugin.PLUGIN_ID,
           NEW_PROJECT_ZIP_FILE_NAME);
 }
Exemplo n.º 5
0
 /**
  * {@inheritDoc}
  *
  * @see org.eclipse.jface.wizard.Wizard#getNextPage(org.eclipse.jface.wizard.IWizardPage)
  */
 @Override
 public IWizardPage getNextPage(IWizardPage page) {
   if (page instanceof WizardNewProjectCreationPage) {
     WizardNewProjectCreationPage newPage = (WizardNewProjectCreationPage) page;
     container = newPage.getProjectName();
     container =
         container
             + "/src/"
             + container.replaceAll("\\.", "/"); // $NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
     container = container + "/common"; // $NON-NLS-1$
     this.newAcceleoModulesCreationPage.setContainer(container);
   }
   return super.getNextPage(page);
 }
  @Override
  public void addPages() {
    super.addPages();

    mainPage =
        new WizardNewProjectCreationPage("basicNewProjectPage") // $NON-NLS-1$
        {

          @Override
          public void createControl(Composite parent) {
            super.createControl(parent);
            validatePage();
          }

          @Override
          protected boolean validatePage() {
            boolean valid = super.validatePage();
            if (!valid) {
              return false;
            }

            // Check if there's already a directory/files at the destination
            IPath location = getLocationPath();
            if (useDefaults()) {
              // needs to append the project name since getLocationPath() returns the workspace path
              // in this case
              location = location.append(getProjectName());
            }

            File file = location.toFile();
            if (file.exists()) {
              setMessage(Messages.NewSampleProjectWizard_LocationExistsMessage, WARNING);
              return true;
            }

            setErrorMessage(null);
            setMessage(null);
            return true;
          }
        };
    mainPage.setTitle(Messages.NewSampleProjectWizard_ProjectPage_Title);
    mainPage.setDescription(Messages.NewSampleProjectWizard_ProjectPage_Description);
    addPage(mainPage);

    String name = sample.getName();
    if (name != null) {
      mainPage.setInitialProjectName(name);
    }
  }
Exemplo n.º 7
0
  @Override
  public boolean performFinish() {
    try {
      // TODO Auto-generated method stub
      // See http://www.programcreek.com/2011/05/eclipse-jdt-tutorial-java-model/
      //

      IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
      // Crea un nuevo projecto
      final IProject project = root.getProject(page.getProjectName());
      project.create(null);
      project.open(null);

      // Map props = project.getPersistentProperties();

      /*			//Crear el proyecto Java
      			IProjectDescription description = project.getDescription();
      			//description.setLocation(page.getLocationPath());
      			//Associate nature
      			description.setNatureIds(new String[]{JavaCore.NATURE_ID});
      			project.setDescription(description, null);
      			IJavaProject javaProject = JavaCore.create(project);
      */
      IFolder folder = project.getFolder("models");
      folder.create(true, true, null);
      folder = project.getFolder("src-gen");
      folder.create(true, true, null);

      return true;
    } catch (CoreException e) {
      // TODO Auto-generated catch block
      MessageDialog.openError(getShell(), "Error", e.getMessage());
      return false;
    }
  }
 /**
  * Use this method to read the project settings from the wizard pages and feed them into the
  * project info class.
  */
 @Override
 protected IProjectInfo getProjectInfo() {
   net.certware.intent.ui.wizard.IntentSpecificationProjectInfo projectInfo =
       new net.certware.intent.ui.wizard.IntentSpecificationProjectInfo();
   projectInfo.setProjectName(mainPage.getProjectName());
   return projectInfo;
 }
 /**
  * Use this method to read the project settings from the wizard pages and feed them into the
  * project info class.
  */
 @Override
 protected IProjectInfo getProjectInfo() {
   org.uqbar.project.wollok.ui.wizard.WollokDslProjectInfo projectInfo =
       new org.uqbar.project.wollok.ui.wizard.WollokDslProjectInfo();
   projectInfo.setProjectName(mainPage.getProjectName());
   return projectInfo;
 }
 @Override
 public void addPage(IWizardPage page) {
   super.addPage(page);
   IWizardPage mainPage = getPage("basicNewProjectPage");
   if (mainPage instanceof WizardNewProjectCreationPage) {
     ((WizardNewProjectCreationPage) mainPage)
         .setInitialProjectName(getInitalProjectName().replace(" ", "_"));
   }
 }
  private IProject createNewProject() {
    if (newProject != null) {
      return newProject;
    }

    // get a project handle
    final IProject newProjectHandle = mainPage.getProjectHandle();
    // get a project descriptor
    URI location = null;
    if (!mainPage.useDefaults()) {
      location = mainPage.getLocationURI();
    }

    IProjectDescription description =
        ResourceUtil.getProjectDescription(
            mainPage.getLocationPath(), sample.getNatures(), ArrayUtil.NO_STRINGS);
    description.setName(newProjectHandle.getName());
    description.setLocationURI(location);

    try {
      if (sample.isRemote()) {
        cloneFromGit(sample.getLocation(), newProjectHandle, description);
      } else {
        doBasicCreateProject(newProjectHandle, description);

        // FIXME Move the logic for extracting/applying samples to IProjectSample! See
        // IProjectTemplate!
        ZipUtil.extract(
            new File(sample.getLocation()),
            newProjectHandle.getLocation(),
            ZipUtil.Conflict.PROMPT,
            new NullProgressMonitor());

        doPostProjectCreation(newProjectHandle);
      }
    } catch (IOException e) {
      return null;
    } catch (CoreException e) {
      return null;
    }

    newProject = newProjectHandle;
    return newProject;
  }
  @Override
  public void createControl(Composite parent) {
    super.createControl(parent);
    Dialog.applyDialogFont(getControl());

    // add selection?

    createDynamicGroup((Composite) getControl());
    // switchTo(updateData(tree, right, showSup, CDTMainWizardPage.this, getWizard()),
    // getDescriptor(tree));
  }
Exemplo n.º 13
0
  /**
   * Creates the sole wizard page contributed by this base implementation; the standard Eclipse
   * WizardNewProjectCreationPage.
   *
   * @see WizardNewProjectCreationPage#WizardNewProjectCreationPage(String)
   */
  public void init(IWorkbench workbench, IStructuredSelection selection) {
    // Set default image for all wizard pages
    IPath path =
        new Path(
            org.emftext.sdk.concretesyntax.resource.cs.ui.CsUIResourceBundle
                .NEW_PROJECT_WIZARD_PAGE_ICON);
    Bundle bundle =
        org.emftext.sdk.concretesyntax.resource.cs.ui.CsUIPlugin.getDefault().getBundle();
    URL url = FileLocator.find(bundle, path, null);
    ImageDescriptor descriptor = ImageDescriptor.createFromURL(url);
    setDefaultPageImageDescriptor(descriptor);

    wizardNewProjectCreationPage = new WizardNewProjectCreationPage(pageName);
    wizardNewProjectCreationPage.setTitle(pageTitle);
    wizardNewProjectCreationPage.setDescription(pageDescription);
    wizardNewProjectCreationPage.setInitialProjectName(pageProjectName);

    this.addPage(wizardNewProjectCreationPage);
    setWindowTitle(
        org.emftext.sdk.concretesyntax.resource.cs.ui.CsUIResourceBundle
            .NEW_PROJECT_WIZARD_WINDOW_TITLE);
  }
  private void cloneFromGit(
      String gitURL, final IProject projectHandle, final IProjectDescription projectDescription) {
    IPath path = mainPage.getLocationPath();
    // when default is used, getLocationPath() only returns the workspace root, so needs to append
    // the project name
    // to the path
    if (mainPage.useDefaults()) {
      path = path.append(projectDescription.getName());
    }

    // Wipe the destination directory if it already exists, or git clone will fail.
    File directory = path.toFile();
    if (directory.exists()) {
      FileUtil.deleteRecursively(directory);
    }

    // FIXME Run an IRunnableWithProgress in wizard container, have it just do job.run(monitor)!
    Job job = new CloneJob(gitURL, path.toOSString(), true, true);
    job.addJobChangeListener(
        new JobChangeAdapter() {

          @Override
          public void done(IJobChangeEvent event) {
            if (!event.getResult().isOK()) {
              return;
            }

            try {
              projectHandle.setDescription(projectDescription, null);
              projectHandle.refreshLocal(IResource.DEPTH_INFINITE, null);
            } catch (CoreException e) {
              IdeLog.logError(SamplesUIPlugin.getDefault(), e);
            }

            doPostProjectCreation(newProject);
          }
        });
    job.schedule(500);
  }
Exemplo n.º 15
0
  @Override
  public boolean performFinish() {
    fNewRProject =
        new ProjectCreator(
            fFirstPage.getProjectName(),
            (fFirstPage.useDefaults()) ? null : fFirstPage.getLocationPath(),
            (fReferencePage != null) ? fReferencePage.getReferencedProjects() : null,
            fFirstPage.getSelectedWorkingSets()) {
          @Override
          protected void doConfigProject(final IProject project, final IProgressMonitor monitor)
              throws CoreException {
            RProjects.setupRProject(fNewRProject.getProjectHandle(), monitor);
          }
        };

    final boolean result = super.performFinish();

    if (result && fNewRProject.getProjectHandle() != null) {
      updatePerspective();
      selectAndReveal(fNewRProject.getProjectHandle());
    }

    return result;
  }
  @Override
  public void createControl(Composite parent) {
    FieldDecoration infoDecor =
        FieldDecorationRegistry.getDefault()
            .getFieldDecoration(FieldDecorationRegistry.DEC_INFORMATION);

    // Create controls
    super.createControl(parent);
    Composite control = (Composite) getControl();

    Group grpProjectSettings = new Group(control, SWT.NONE);
    grpProjectSettings.setText("Project Settings");

    new Label(grpProjectSettings, SWT.NONE).setText("Version:");
    txtVersion = new Text(grpProjectSettings, SWT.BORDER);

    new Label(grpProjectSettings, SWT.NONE).setText("Name:");
    txtName = new Text(grpProjectSettings, SWT.BORDER);

    ControlDecoration txtNameDecor = new ControlDecoration(txtName, SWT.LEFT | SWT.CENTER);
    txtNameDecor.setImage(infoDecor.getImage());
    txtNameDecor.setDescriptionText("Defines a human-readable name for the bundle");

    new Label(grpProjectSettings, SWT.NONE).setText("Description:");
    txtDescription = new Text(grpProjectSettings, SWT.BORDER);

    ControlDecoration txtDescDecor = new ControlDecoration(txtDescription, SWT.LEFT | SWT.CENTER);
    txtDescDecor.setImage(infoDecor.getImage());
    txtDescDecor.setDescriptionText("Defines a short human-readable description for the bundle");

    new Label(grpProjectSettings, SWT.NONE).setText("Provider:");
    txtVendor = new Text(grpProjectSettings, SWT.BORDER);

    ControlDecoration txtVendorDecor = new ControlDecoration(txtVendor, SWT.LEFT | SWT.CENTER);
    txtVendorDecor.setImage(infoDecor.getImage());
    txtVendorDecor.setDescriptionText(
        "The name of the company, organisation or individual providing the bundle");

    // Set values
    txtDescription.setText(description);
    txtVersion.setText(version.toString());
    txtVendor.setText(vendor);
    txtName.setText(name);

    // Add listeners
    ModifyListener txtModListener =
        new ModifyListener() {
          public void modifyText(ModifyEvent e) {
            description = txtDescription.getText();
            vendor = txtVendor.getText();
            name = txtName.getText();

            validateSettings();
          }
        };
    txtDescription.addModifyListener(txtModListener);
    txtVersion.addModifyListener(txtModListener);
    txtVendor.addModifyListener(txtModListener);
    txtName.addModifyListener(txtModListener);

    // Layout
    control.setLayout(new GridLayout());
    grpProjectSettings.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
    grpProjectSettings.setLayout(new GridLayout(2, false));
    txtDescription.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
    txtVersion.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
    txtVendor.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
    txtName.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
  }
 @Override
 public void createControl(Composite parent) {
   super.createControl(parent);
   Composite control = (Composite) getControl();
   createPluginDetailsGroup(control);
 }
 /**
  * Use this method to add pages to the wizard. The one-time generated version of this class will
  * add a default new project page to the wizard.
  */
 public void addPages() {
   mainPage = new WizardNewProjectCreationPage("basicNewProjectPage");
   mainPage.setTitle("IntentSpecification Project");
   mainPage.setDescription("Create a new IntentSpecification project.");
   addPage(mainPage);
 }
Exemplo n.º 19
0
 /**
  * Use this method to add pages to the wizard. The one-time generated version of this class will
  * add a default new project page to the wizard.
  */
 public void addPages() {
   mainPage = new WizardNewProjectCreationPage("basicNewProjectPage"); // $NON-NLS-1$
   mainPage.setTitle(Messages.WollokDslNewProjectWizard_pageTitle);
   mainPage.setDescription(Messages.WollokDslNewProjectWizard_pageDescription);
   addPage(mainPage);
 }