Processing of Java annotation hollow and line feed

Source: Internet
Author: User

Java note Wrapping written in <P/> or <BR/>
Spaces written in &nbsp;

Such as:

/**
* Pop-up Operation confirmation dialog box, pop-up confirmation box is divided into two parts, above is a string of prompt text, the following has about two action buttons <BR/>
*-------------------------------<BR/>
* |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& Nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br/>
* |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& Nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br/>
* |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; hint Message &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<BR/>
* |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& Nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br/>
* |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& Nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br/>
* |------------------------------|<br/>
* |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<BR/>
* |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; left button &nbsp;&nbsp;&nbsp;&nbsp;& nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Right Button &nbsp;&nbsp;|<BR/>
* |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<BR/>
*  -------------------------------
*
* @param msgtxt displayed on the dialog message
* @param leftbuttontxt The display text of the lower left operation button
* @param rightbuttontxt The display text of the lower right action button
* @param leftbuttonlistener to the lower left operation button Click Callback
* @param rightbuttonlistener to the right hand button to click the callback <BR/>
*/
private void Showconfirmdialog (String msgtxt, String leftbuttontxt, String rightbuttontxt, Final Onclicklistener Leftbuttonlistener, Final Onclicklistener Rightbuttonlistener) {
Final Dialog Dialog = new Dialog (this,r.style.pospassportdialog);
Dialog.setcanceledontouchoutside (FALSE);
Dialog.setcontentview (R.layout.dialog_confirm_no_title);
Layoutparams LP = Dialog.getwindow (). GetAttributes ();
Lp.height = Getresources (). Getdisplaymetrics (). Heightpixels/3;

Dialog.getwindow (). SetAttributes (LP);

Cue message for window display
TextView tv_msg = (TextView) Dialog.findviewbyid (r.id.tv_msg);
Tv_msg.settext (MsgTxt);

Processing of the left button
Final Button LeftButton = (Button) Dialog.findviewbyid (R.id.left_button);
Leftbutton.settext (Leftbuttontxt);
Leftbutton.setonclicklistener (New Onclicklistener () {
@Override
public void OnClick (View v) {
if (Leftbuttonlistener!=null) {
Leftbuttonlistener.onclick (LeftButton);
}
Dialog.cancel ();
}
});

Right button handling
Final Button Rightbutton = (Button) Dialog.findviewbyid (R.id.right_button);
Rightbutton.settext (Rightbuttontxt);
Rightbutton.setonclicklistener (New Onclicklistener () {
@Override
public void OnClick (View v) {
if (Rightbuttonlistener!= null) {
Rightbuttonlistener.onclick (Rightbutton);
}
Dialog.cancel ();
}
});

Dialog.show ();
}


The effect displayed:


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.