Weblogic Platform 8.1 custom control

Source: Internet
Author: User

Weblogic Platform 8.1 custom controls generally consist of two files: JCs files and java files.
JCS is the meaning of Java Control source, representing the source file, implementing the function of custom control; Java file representing

The following is an example of an interface that can be called by a widget:

1) the JCS file code is as follows:
Package verifyfunds. poutil;
Import java. util. stringtokenizer;
/**
* Provides a number formatting utility function for
* Verifyfunds Sample Control.
* Author's note: Weblogic Platform 8.1 defines many javadoc to facilitate our development and deployment.
* @ JCs: JC-jar label = "poutil"
* @ Editor-Info: code-gen control-interface = "true"
*/
// Note: by default, the JCS file is suffixed with "impl" after the Java file, and poutil. Java is the interface to be implemented by JCs.
// JCs all implement the com. Bea. Control. controlsource Interface
Public class poutilimpl implements poutil, Com. Bea. Control. controlsource
{
/**
* Formats a purchase order number, removing
* Non-numeric characters.
* The following figure shows the specific function implementation. If you are not interested, skip this step.
* @ Common: Operation
*/
Public int formatnumber (string stringnumber)
{
Stringbuffer delimiters = new stringbuffer ();

For (INT I = 0; I <stringnumber. Length (); I ++)
{
If (stringnumber. charat (I) <'0' | stringnumber. charat (I)>

'9 ')
Delimiters. append (stringnumber. charat (I ));
}

Stringtokenizer tokens = new stringtokenizer (stringnumber,

Delimiters. tostring ());
Stringbuffer cleanstring = new stringbuffer ();

While (tokens. hasmoretokens ())
{
Cleanstring. append (tokens. nexttoken ());
}
Int number = new INTEGER (cleanstring. tostring (). intvalue ();
Return number;
}
}
Javadoc annotation @ common: operation indicates that this method is part of a public interface. When this annotation appears

, WebLogic Workshop includes this method in the public interfaces listed in. java. In the design view,

This annotation is represented by the blue arrow icon.

2) the Java file code is as follows:
Package verifyfunds. poutil;

Import com. Bea. Control. Control;
// All interfaces inherit from Com. Bea. Control. Control.
Public interface poutil extends control
{
/**
* Formats a purchase order number, removing non-numeric characters.
*/
// Corresponds to the @ common: Operation Method in the JCS File
Int formatnumber (Java. Lang. String stringnumber );
}
WebLogic Workshop provides a good interface, so that we can develop and understand it in a graphic way.

Pretty good.
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.