java setmessage_Java Message.setTitle方法代码示例

import org.kuali.rice.kcb.bo.Message; //导入方法依赖的package包/类

/**

* @see org.kuali.rice.kcb.service.MessagingService#deliver(org.kuali.rice.kcb.dto.MessageDTO)

*/

@Override

public Long deliver(MessageDTO message) throws MessageDeliveryException {

if (message == null) {

throw new RiceIllegalArgumentException("message is null");

}

Collection delivererTypes = getDelivererTypesForUserAndChannel(message.getRecipient(), message.getChannel());

LOG.debug("Deliverer types for " + message.getRecipient() + "/" + message.getChannel() + ": " + delivererTypes.size());

if (delivererTypes.isEmpty()) {

// no deliverers configured? just skipp it

LOG.debug("No deliverers are configured for " + message.getRecipient() + "/" + message.getChannel());

return null;

}

final Message m = new Message();

m.setTitle(message.getTitle());

m.setDeliveryType(message.getDeliveryType());

m.setChannel(message.getChannel());

m.setRecipient(message.getRecipient());

m.setContentType(message.getContentType());

m.setUrl(message.getUrl());

m.setContent(message.getContent());

m.setOriginId(message.getOriginId());

LOG.debug("saving message: " +m);

messageService.saveMessage(m);

for (String type: delivererTypes) {

MessageDelivery delivery = new MessageDelivery();

delivery.setDelivererTypeName(type);

delivery.setMessage(m);

// MessageDeliverer deliverer = delivererRegistry.getDeliverer(delivery);

// if (deliverer != null) {

// deliverer.deliverMessage(delivery);

// }

LOG.debug("saving messagedelivery: " +delivery);

messageDeliveryService.saveMessageDelivery(delivery);

}

LOG.debug("queuing job");

queueJob(MessageProcessingJob.Mode.DELIVER, m.getId(), null, null);

LOG.debug("returning");

return m.getId();

}

import java.awt.Button; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; public class Dialog { private String icon; private String title; private String message; private Button submit; private Button cancel; private Button close; private Dialog(){ } private Dialog(String icon, String title, String message, Button submit, Button cancel, Button close) { this.icon = icon; this.title = title; this.message = message; this.submit = submit; this.cancel = cancel; this.close = close; this.submit = new Button(); // 初始化submit按钮 this.cancel = new Button(); // 初始化cancel按钮 this.close = new Button(); // 初始化close按钮 } public void show(){ //弹出 } public void dismiss(){ //关闭 } static class Builder{ private Dialog dialog = new Dialog(); public Builder title(String title){ dialog.setTitle(title); return this; } public Builder icon(String icon){ dialog.setIcon(icon); return this; } public Builder message(String message){ dialog.setMessage(message); return this; } public Dialog build(){ return dialog; } } public void setSubmitText(String text){ submit.setLabel(text); } public void setCancelText(String text){ cancel.setLabel(text); } public void setCloseText(String text){ close.setLabel(text); } /** * 回调函数 * @param callback */ public void addListenerOnSubmit(SubmitCallBackListener callback){ submit.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { //当用户对按钮执行了动作操作以后, //程序会到此处执行 callback.submitCallback(e); } }); } public String getIcon() { return icon; } public void setIcon(String icon) { this.icon = icon; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } }这段代码怎么在myeclipse中运行出对话框
最新发布
05-25
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值