In this step you will create a Utility project to house your control so they
can be used by multiple modules in an application.
In this step, you will:
To Start Workshop for WebLogic
If you haven't started Workshop for WebLogic yet, use these steps to do so.
... on Microsoft Windows
If you are using a Windows operating system, follow these instructions.
- From the Start menu, click All Programs > BEA
Products >
Workshop for WebLogic Platform 10.0
...on Linux
If you are using a Linux operating system, follow these instructions.
- Run BEA_HOME/workshop_10.0/workshop4WP/workshop4WP
To Create a Workspace
You use a workspace to contain related source code. This one will end up
containing both your control source and the source you'll test the control
with.
- If the Workshop Launcher dialog is not displayed, select
File > Switch Workspace. Otherwise, skip to the next
step.
- In the Workspace Launcher dialog, click Browse,
then browse to the directory that you want to contain your new workspace
directory.
This can be any directory. You'll be creating a new directory inside
this one for your workspace.
- When you have a directory selected, click Make New Folder.
Name the new folder JUnitTutorial press Enter
to create the folder, then click OK.
- In the Workspace Launcher, click OK.
- Close the Welcome view.

Workshop for WebLogic will create a new empty workspace in the folder you created, then refresh to display the workspace. Note that the Navigator view is empty.
To Create an Utility Project
An utility project contains shared code that can be used across multiple
different projects.
- Click File > New > Project.
- In the New Project dialog, expand J2EE,
select Utility Project, then click Next.
- In the New Java Utility Module dialog, in the Project
name field, enter MySharedControls, then click Next.
- Under Select Project Facets, confirm that the "Beehive
Contols" facet is selected. (This facet must be selected because it
contains ControlTestCase, an extension of junit.framework.TestCase, as well
as the control validation and build libraries.)
Click Finish.
To Create a Custom Control
In this step you will create the control to be tested.
- On the Project Explorer view, expand the node MySharedControls,
right-click the src folder and select New >
Package.
- In the New Java Package dialog, in the Name
field, enter sharedcontrols, and click Finish.
- On the Project Explorer view, right-click the sharedcontrols
package and select New > Custom Control.
- In the New Control dialog, in the Control name
field, enter EmployeeControl and
click Finish.
- On the Project Explorer view, open the package sharedcontrols
and double-click EmployeeControlImpl.java to open the
file's source code. Edit the source code so it appears as follows.
Code to add appears in red.
package sharedcontrols;
import org.apache.beehive.controls.api.bean.ControlImplementation;
import java.io.Serializable;
@ControlImplementation
public class EmployeeControlImpl implements EmployeeControl, Serializable {
private static final long serialVersionUID = 1L;
public String[] getManagerNames() {
return new String[]{"Jane","Bob","Amy"};
}
}
- Place the cursor inside the method name getManagerNames
and press Ctrl+1.
This will bring up an options menu.
Double-click the option Create in super type 'EmployeeControl'.
This will add the method signature to the control interface file EmployeeControl.java.

- Press Ctrl+Shift+S to save your work.