This lesson will show you how to add the dependencies,
import images, and to create a Java class
to handle the view.
Note: Before you complete this lesson, you should
create an Eclipse plug-in project with
the following attributes:
- Project Name : com.ibm.carma.plugin.view
- Plug-in ID : com.ibm.carma.plugin.view
- Plug-in Name : New View
To perform the set up for this plug-in:
- In the Plug-in Development perspective,
right click on the com.ibm.carma.plugin.view plug-in
project and select, PDE Tools > Open
Manifest. Find the Dependencies tab
at the bottom of the Plug-in Editor.
- Select the Dependencies tab, and
click the Add button. In the dialog box that
opens, filter for each of the following if they are not already listed:
- org.eclipse.ui.ide
- com.ibm.carma.ui
For each dependency, as it appears in the list, highlight it,
and click OK.
- Next, you want to import your files from the local source
to the project. In the Package Explorer view,
right click on com.ibm.carma.plugin.view, and select New > Folder.
In the New Folder dialog box that appears,
select CARMA Developer View as the parent folder,
and enter icons as the name. Click Finish. You should see the icons directory appear
under the com.ibm.carma.plugin.view plug-in project.
- To import the icons, right click on the icons directory
and select Import. In the Import dialog
box that opens, select General > File
System. Click Next.
- Browse for the particular directory where your images are
stored. Once you have selected the directory, the directory structure
will be shown in the left panel below, and the individual files will
be shown in the right. Mark the files or directories you want to import
with a check mark, and click Finish to import
the files. Back in the Package Explorer view,
if you expand the icons directory, you should see
your selected files now within the directory.
- Finally, you want to set up the Java class that will handle the view. Start
by creating a package to contain the file; right click on com.ibm.carma.plugin.view,
and select New > Package.
- In the New Java Package dialog box
that opens, enter view as the package name. You should see the package appear under the src directory
of the plug-in project.
- To add the Java class,
right click on the view package you just created,
and select New > Class. The New Java Class dialog box
opens.
- In the Name text field, enter the
class name as CARMADeveloperView.
- To the left of the Superclass text
field, click Browse. The Superclass
Selection dialog box will open.
- In the text field, enter BaseCarmaBrowser.
Select the class that matches your filter, and click OK.
- Back in the New Java Class view,
click Finish to create the Java class. The dialog box will close and the
class will open in the editor.