本文整理汇总了Java中org.zkoss.zul.Button.addEventListener方法的典型用法代码示例。如果您正苦于以下问题:Java Button.addEventListener方法的具体用法?Java Button.addEventListener怎么用?Java Button.addEventListener使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.zkoss.zul.Button
的用法示例。
在下文中一共展示了Button.addEventListener方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSpecialProperty
import org.zkoss.zul.Button; //导入方法依赖的package包/类
@Override
public Component getSpecialProperty(final Component cmp, String name, IDeveloperStudio dev) {
Button edit = new Button("Edit");
final IDeveloperStudio developer = dev;
edit.addEventListener(Events.ON_CLICK, new EventListener<MouseEvent>() {
@Override
public void onEvent(MouseEvent arg0) throws Exception {
TableFieldProperties dialog = new TableFieldProperties((TableField)cmp);
developer.getDesigner().appendChild(dialog);
dialog.doModal();
}
});
return edit;
}
示例2: buildForm
import org.zkoss.zul.Button; //导入方法依赖的package包/类
@Override
protected void buildForm() throws Exception {
CustomForm form = (CustomForm) getForm();
Borderlayout mainLayout = new Borderlayout();
form.appendChild(mainLayout);
North mainPanelNorth = new North();
mainLayout.appendChild(mainPanelNorth);
Center mainPanelCenter = new Center();
mainLayout.appendChild(mainPanelCenter);
processButton = new Button();
processButton.setLabel("Print Plugin Info");
processButton.setStyle("text-align: right");
mainPanelNorth.appendChild(processButton);
pluginInfo = new WStringEditor();
pluginInfo.getComponent().setText("");
pluginInfo.getComponent().setWidth("100%");
pluginInfo.setReadWrite(true);
mainPanelCenter.appendChild(pluginInfo.getComponent());
processButton.addEventListener(Events.ON_CLICK, this);
}
示例3: addItem
import org.zkoss.zul.Button; //导入方法依赖的package包/类
private void addItem(int sizeX, int sizeY) {
GridItem item = new GridItem();
item.setSizeX(sizeX);
item.setSizeY(sizeY);
item.setStyle("background-color: " + randomColor());
Button closeButton = new Button("X");
closeButton.addEventListener(Events.ON_CLICK, new CloseItemEventListener(item));
item.appendChild(closeButton);
gridster.appendChild(item);
}
示例4: doAfterCompose
import org.zkoss.zul.Button; //导入方法依赖的package包/类
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public void doAfterCompose(Component comp) throws Exception {
super.doAfterCompose(comp);
projectDao = (ProjectDao) SpringUtil.getBean("projectDao");
businessCalendarDao = (BusinessCalendarDao) SpringUtil.getBean("businessCalendarDao");
auditLogger = (AuditLogger) SpringUtil.getBean("auditLogger");
costDao = (CostDao) SpringUtil.getBean("costDao");
calendarService = (CalendarService) SpringUtil.getBean("calendarService");
final User user = getUser();
if (user != null) {
List<BusinessCalendarEvent> calendarEvents = calendarService.getEvents();
calendarModel = new BusinessCalendarModel(calendarEvents);
calendars.setModel(this.calendarModel);
invoiceButton.setDisabled(true);
discount.setDisabled(true);
sendInvoiceButton = (Button) Path.getComponent("/win/invoiceWindow/sendInvoiceButton");
sendInvoiceButton.addEventListener("onClick", new EventListener() {
public void onEvent(Event event) throws Exception {
sendInvoice();
}
private void sendInvoice() throws Exception {
MailHelper.sendInvoice(invoice, invoiceBuf, user);
registerInvoice();
auditLogger.log(SEND_INVOICE, user);
alert(Labels.getLabel("invoice.sent"));
}
private void registerInvoice() throws Exception {
Cost cost = new Cost();
cost.setUser(user);
cost.setDescription(Labels.getLabel("invoice") + " " + invoice.getInvoiceNumber());
cost.setAmount(invoice.getNetAmount());
cost.setVat(invoice.getVatAmount());
cost.setDate(new Date());
cost.setCostType(INVOICE_SENT);
costDao.persistEntity(cost);
}
});
}
}