Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Import a Custom Project
Import a Custom Project [message #1815674] Tue, 08 October 2019 09:24 Go to next message
Mihnea-Costache Marin is currently offline Mihnea-Costache MarinFriend
Messages: 68
Registered: September 2019
Member
Hello,

I have a plugin that creates a project. I am using class which implements INewWizard, IExecutableExtension. This way, I can create a wizard(I have another class which provides the files and the logic behind it).

Now, I am working on importing a project. I managed to get the wizard to appear on the import page, but I am not sure how to configure the logic behind to look through the workspace and select a project.

Is there a way of doing this?

Thank you!
Re: Import a Custom Project [message #1815679 is a reply to message #1815674] Tue, 08 October 2019 10:13 Go to previous messageGo to next message
Emmanuel Chebbi is currently offline Emmanuel ChebbiFriend
Messages: 123
Registered: February 2018
Senior Member
Hello,

Quote:
I am not sure how to configure the logic behind to look through the workspace and select a project

Not sure to understand why you want to do that: importing a project within the workspace means that the project already exists somewhere outside of the workspace, right?

I have never wrote a custom Import wizard because the Import Existing Projects into Workspace wizard has always fulfilled my needs but I think you'll need two things:

  1. a dialog allowing the user to select the project to import (such as DirectoryDialog [1])
  2. a code that imports this project when the user validates. See for instance this answer on StackOverflow [2].

The latter assumes that the project to import is already an Eclipse project (it has a .project file at its root). If that's not the case you'll have to create a new project as you did in your NewProject wizard.

[1] https://help.eclipse.org/2019-09/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fapi%2Forg%2Feclipse%2Fswt%2Fwidgets%2FDirectoryDialog.html
[2] https://stackoverflow.com/a/12430228
Re: Import a Custom Project [message #1815689 is a reply to message #1815679] Tue, 08 October 2019 13:21 Go to previous messageGo to next message
Mihnea-Costache Marin is currently offline Mihnea-Costache MarinFriend
Messages: 68
Registered: September 2019
Member
Isn't there already a DirectoryDialog? For creating a wizard there is WizardNewProjectCreationPage. I assume there must be one for importing a project as well
Re: Import a Custom Project [message #1815692 is a reply to message #1815689] Tue, 08 October 2019 13:50 Go to previous message
Emmanuel Chebbi is currently offline Emmanuel ChebbiFriend
Messages: 123
Registered: February 2018
Senior Member
Quote:
Isn't there already a DirectoryDialog?

The class indeed exists; I linked it in my previous post.

Quote:
For creating a wizard there is WizardNewProjectCreationPage. I assume there must be one for importing a project as well

If you want to reuse the page I think that you're looking for WizardExternalProjectImportPage [1].

If you want the whole wizard you should rather check ExternalProjectImportWizard [2]

[1] https://help.eclipse.org/2019-09/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fapi%2Forg%2Feclipse%2Fui%2Fwizards%2Fdatatransfer%2FWizardExternalProjectImportPage.html
[2] https://help.eclipse.org/2019-09/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fapi%2Forg%2Feclipse%2Fui%2Fwizards%2Fdatatransfer%2FExternalProjectImportWizard.html
Previous Topic:Debug perspective source code window
Next Topic:duplicate entry of classpath and project
Goto Forum:
  


Current Time: Fri Apr 26 03:53:02 GMT 2024

Powered by FUDForum. Page generated in 0.03033 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top