Skip Navigation

Embedding a Swing App

Before you begin:

You can use the build.bat file that is included in the sample Swing plug-in archive. It compiles and packs the sources that are included in the Swing plug-in. The archive also includes source code for a sample Swing app and MANIFEST.MF. These files are located in the SwingAppCode folder.

        To make build.bat function, add javac.exe and jar.exe from the Java SDK to your PATH system variable.

Adding Plug-in Dependencies

  1. From Eclipse Package Explorer, add the following plug-in dependencies:

    • org.eclipse.albireo.core

    • com.sabre.edge.platform.core.common

    • If you are embedding your Swing application in an editor, the com.sabre.edge.platform.core.editor dependency is also required.

Adding JAR Files for Your Application

  1. In Package Explorer, right-click the package name.

        Choose New > Folder from the menu. Name the folder lib.

  1. Put the JAR file for your application into the lib folder. (See the following figure.)

If you need a sample application, you can copy the sample.jar file from the sample Swing plug-in.
  1. Open the Runtime tab.

  1. In the MANIFEST.MF file, click Add. Select the folder that contains the application JAR file. After you select the folder, Eclipse adds the JAR to the classpath in your plug-in.

Next, you will add the UI extension points for either an editor, a view, or both. Complete one of the following procedures to wrap your class:

Afterwards, you must complete the steps in the following procedures: