Package org.eclipse.ui.internal.wizards.datatransfer

Examples of org.eclipse.ui.internal.wizards.datatransfer.WizardProjectsImportPage


    if (!dotproject.exists()){
      return Services.getMessage("project.dotproject.missing", folder);
    }

    // hacky, but I want to re-use the eclipse logic as much as possible.
    WizardProjectsImportPage page = new WizardProjectsImportPage();

    // construct a ProjectRecord
    Constructor<WizardProjectsImportPage.ProjectRecord> construct =
      WizardProjectsImportPage.ProjectRecord.class
      .getDeclaredConstructor(WizardProjectsImportPage.class, File.class);
    construct.setAccessible(true);
    WizardProjectsImportPage.ProjectRecord record =
      construct.newInstance(page, dotproject);

    String projectName = record.getProjectName();
    IProject project = ProjectUtils.getProject(projectName);
    if(project.exists()){
      return Services.getMessage("project.name.exists", projectName, folder);
    }

    // need to initialize the wizard page's 'createdProjects' list.
    Field field = page.getClass().getDeclaredField("createdProjects");
    field.setAccessible(true);
    field.set(page, new ArrayList<IProject>());

    // create the project from the ProjectRecord
    Method method = page.getClass().getDeclaredMethod(
        "createExistingProject",
        WizardProjectsImportPage.ProjectRecord.class,
        IProgressMonitor.class);
    method.setAccessible(true);
    Boolean result = (Boolean)method.invoke(page, record, new NullProgressMonitor());
View Full Code Here

TOP

Related Classes of org.eclipse.ui.internal.wizards.datatransfer.WizardProjectsImportPage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.