![]() |
![]() |
![]() |
![]() |
This topic describes how to use a custom custom control. It explains how to:
Custom control files can be located:
The following instruction assume you are in the J2EE perspective (Window > Open Perspective > J2EE).
Default control interface and implementation classes are produced. Assuming that your control is named Hello, the following class files are produced:
Hello.java Interface Class File
package controls.myControl; import org.apache.beehive.controls.api.bean.ControlInterface; @ControlInterface public interface Hello { }
HelloImpl.java Implementation Class File
package controls.myControl; import org.apache.beehive.controls.api.bean.ControlImplementation; import java.io.Serializable; @ControlImplementation public class HelloImpl implements Hello, Serializable { private static final long serialVersionUID = 1L; }
Continue the composition of the custom control by adding methods to these class files.
If you have an existing custom control in your project or in a utility project in the current workspace, you can add a reference to that control to a control client by right-clicking anywhere within the client's Java source file and selecting Insert > Control.
A list of available controls appears. The heading Existing Project Controls lists the controls in the same project as the client. The heading Existing Application Controls lists the controls in the utility projects in the same workspace.
When you add a control reference to a client, Workshop for WebLogic Platform modifies your client's source code to include an annotation and variable declaration for the control. The annotation ensures that the control is recognized by Workshop for WebLogic Platform, and the variable declaration gives you a way to work with the control from your client code. For example, if you add a new custom control named Hello, the following code will be added to your client:
import org.apache.beehive.controls.api.bean.Control; import controls.myControl.Hello; @Control private Hello hello;Once you have a reference to a control, your client can call methods on that control. For more detail on calling a control method, see Invoking a Control Method.
![]() ![]() |