wst common
test plan: wtp project explorer.
WTP LogoWTP Home
Java Drag and Drop
 

The Project Explorer supports a handful of drag and drop capabilities useful when developing Java. In addition to the resource drag and drop functions like moving folders and files, there is support for dragging Java packages, Java classes, and Java interfaces.

 
  1. File->New->Project...->Java Project to create a simple Java project named Test1.

  2. File->New->Project...->Java Project to create a simple Java project named Test2.

  3. Right-click on Test1 project, select New->Source Folder and add "src" as source folder.

    Figure 1: Select "New > Source Folder" from a project in the WTP Project Explorer.

  4. Add "src" as source folder to the Test2 project also.

  5. Right-click on Test1 project, select New->Package and add "test1" as package to src.

    Figure 2: Select "New > Package" from the source folder you just created.

  6. Right-click on Test2 project, select New->Package and add "test2" as package to src.

  7. Right-click on test1 package, select New->Class and add "Test1" as class to test1 package.

    Figure 3: Select "New > Class" from the package you just created.

  8. Drag and drop test1 package onto the src folder in the Test2 project. Click OK.

    Figure 4: A selection dialog allows you to choose the action to perform on the Drag and Drop if there are multiple options. This dialog is supressed by default if there is only one option. If this dialog appears, hit OK.

  9. Drag and drop the Test1 class onto the test2 package. Click OK (twice if the above dialog appears).

    Figure 5: A dialog allows you to choose the options to apply in the Move action.

J2EE Drag and Drop
 

The J2EE Project Explorer adds drag and drop functionality to make working with J2EE modules and applications much easier. A module project can simply be dropped onto an Enterprise Application project to add that module to the application. Also, a Java project can be dropped onto the Enterprise Application project to add that Java project as a utility jar for the targetted application.

 
  1. Right-click the Enterprise Applications group, and select New->Enterprise Application Project. Add "TestEAR".

    Figure 6: Select "New > Enterprise Application Project" from the Enterprise Applications Module Group in the Project Explorer.

  2. Import or create an EJB module project.

  3. Import or create a simple Java project.

  4. Drag and drop the EJB project onto the Enterprise Application project to add that EJB JAR as a module for that application.

    Figure 7: A selection dialog allows you to choose the action to perform on the Drag and Drop if there are multiple options. Select "J2EE Add Module" and hit OK.

  5. Repeated the process for Application Clients, Connectors, and Web projects.

  6. Drag and drop the Java project onto the Enterprise Application to add that JAR as a utility JAR for that application.

    Figure 8: A selection dialog allows you to choose the action to perform on the Drag and Drop if there are multiple options. Select "J2EE Utility Jar" and hit OK.

 

Return to overview.