java注释中空格和换行符的处理

java 注释换行写成



空格写成 

如:

/**
     * 弹出操作确认对话框,弹出的确认框分为上下两部分,上面是一串提示文字,下面有左右两个操作按钮

     *  -------------------------------

     * |                                      |

     * |                                      |

     * |         提示消息                 |

     * |                                      |

     * |                                      |

     * |------------------------------|

     * |                    |                 |

     * |      左按钮     |      右按钮  |

     * |                    |                 |

     *  -------------------------------
     *  
     * @param msgTxt  显示在dialog上的提示消息
     * @param leftButtonTxt 左下操作按钮的显示文字
     * @param rightButtonTxt 右下操作按钮的显示文字
     * @param leftButtonListener 左下操作按钮的点击回调
     * @param rightButtonListener 右下操作按钮的点击回调

     */
    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);
        
        //弹窗显示的提示消息
        TextView tv_msg = (TextView) dialog.findViewById(R.id.tv_msg);
        tv_msg.setText(msgTxt);
        
        //左边按钮的处理
        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();
            }
        });
        
        //右边按钮处理
        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();  
    }


显示的效果:

java注释中空格和换行符的处理_第1张图片

你可能感兴趣的:(环境配置,java)