cornercorner
FeaturesPluginsDocs & SupportCommunityPartners

Project Importer

Author: Martin Krauskopf
Version: 1.1.5
Last Update: 02/16/2005

Contents:

  1. Introduction
  2. Requirements
  3. Design specification
    • Invoking
    • Step 1: Choosing the way to import
      • a) Importing from the Eclipse Workspace
      • b) Importing Eclipse project directly
    • Step 2: Project to Import
  4. Imported projects
  5. Open issues

1. Introduction

    Project Importer adds an ability to import projects from other IDEs into NetBeans IDE. Currently only Eclipse in versions 3.0 and above is supported. It is available as a module on NetBeans Autoupdate Center.

2. Requirements

    Project Importer provides following:
  • Imports both internal and external Eclipse Java Project with
    • Both internal and external source roots
    • Both internal and external libraries (jar, zip)
    • Eclipse classpath Variables
    • Eclipse User Libraries (i.e. containers for multiple jars)
    • Used JDK (new one is created if there is not such platform in NetBeans yet)
  • Recognizing non-java project.
Imports means that user will be able to work with imported projects in the same manner as with newly created projects. Complete NetBeans Java Project structure will be created.

3. Design specification

Invoking:

    Project Importer wizard can be invoked through the menu items under the File -> Import Project submenu. As it was noted only Eclipse is supported in the meantime. (figure 1).

Menu Item
figure 1 - Menu Item

User has two ways to import Eclipse project(s) into the NetBeans.

Step 1: Choosing the way to import
  • a) Importing from the Eclipse Workspace - with the first option of the importer wizard user chooses Eclipse Workspace which will be parsed to acquire information about Workspace projects. If user enters (or selects with a file chooser) incorrect workspace the appropriate message will be shown (as you can see on figure 2a). After choosing regular workspace user can continue to the project selection step.

    Menu Item
    figure 2a - Workspace selection

  • b) Importing Eclipse project directly - this option was added to support cases when user doesn't have installed Eclipse IDE at all but has a single Eclipse project he wants to import (e.g. downloaded from sf.net). User has to choose the location where the Eclipse project is stored and the targed location where the NetBeans project will be created (imported). If user enters (or selects with a file chooser) directory which doesn't contain regular Eclipse project the appropriate message will be shown (as you can see on figure 2b). User has to select targed location which doesn't contain any of selected projects. Also when the target location cannot be used (e.g. low privileges) the warning message will be displayed.
    After pushing Finish button progress dialog will appear and project is imported and opened in the NetBeans IDE.

    Menu Item
    figure 2b - Workspace selection


Step 2: Project to Import

    In the second step (figure 3a) user selects projects which will be imported into the NetBeans IDE. If user selects project which has some Required projects on the build path those projects will be selected as well without possibility to unselect them. Non-java projects cannot be selected, they are disabled with appropriate tooltip set. Note that the importer remembers selected projects when they become required ones so user will not lost a previous selection.
All selected projects will be imported (created as NetBeans projects) in the same location which was selected by user. If one of those projects already exists in the specified location or the target location cannot be used (e.g. low privileges) appropriate message will be shown. User has to select location which doesn't contain any of selected projects.
After pushing Finish button progress dialog will appear and projects are imported and opened in the NetBeans IDE.

Menu Item
figure 3a - Project to Import

If the Project Importer encounters any problems which should be shown to the user the Warning dialog will appear with the warning messages displayed (figure 3b).

Menu Item
figure 3b - Project to Import

4. Imported projects

    In the location chosen by user are only files related to the general NetBeans project. All source files and libraries stays in their original location - they are not copied. So user can easily shares them from both IDE and e.g. if the sources are under the CVS it will keep working as before. Labels for source folders remains the same as they were in Eclipse (also for linked folders). User Libraries and Variables are imported as a set of JARs (this could be improved in the future (see Open issues)). If a JDK used by an eclipse project is not found in the NetBeans it will be created and correctly set for a NetBeans project. Project libraries and required projects are set as well. See the figure 4 for example result.
Now user is able to work (build, compile, ...) with imported projects in the same manner as with newly created NetBeans projects.

Menu Item
figure 4 - Explorer

5. Open issues

  • Eclipse User Libraries and Variables are currently imported as a set of JARs. It would be nice if they would be imported as regular NetBeans Libraries. (see issue 55111)

Companion
Projects:
MySQL Database Server   GlassFish Community: an Open Source Application Server   Open Solaris  Open JDK: an Open SourceJDK   Mobile & Embedded Community     Sponsored by 
Sponsored by Sun Microsystems