本文整理汇总了Java中org.zkoss.zul.Button类的典型用法代码示例。如果您正苦于以下问题:Java Button类的具体用法?Java Button怎么用?Java Button使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Button类属于org.zkoss.zul包,在下文中一共展示了Button类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: readTransactions
import org.zkoss.zul.Button; //导入依赖的package包/类
private List<Cost> readTransactions() throws IOException, Exception {
String firstLine = getFirstLine();
InputStream is = new ByteArrayInputStream(media.getStringData().getBytes());
Reader reader2 = new InputStreamReader(is);
reader = new BufferedReader(reader2);
// reader = new BufferedReader(media.getReaderData());
TransactionReader importTransactions = transactionReaderFactory.getTransactionReader(firstLine);
importTransactions.reset();
List<Cost> result = importTransactions.readFile(reader);
boolean unmatchedTransactions = listContainsUnmatchedTransactions(result);
boolean longDescriptions = listContainsLongDescriptions(result);
if (!unmatchedTransactions && !longDescriptions) {
importBtn.setDisabled(false);
} else if (unmatchedTransactions) {
Messagebox.show("Er zijn nog onbepaalde transacties. Voeg tekstfragmenten toe, waarmee transacties herkend kunnen worden voor een bepaalde kostensoort.", null,
new Messagebox.Button[] { Messagebox.Button.OK }, Messagebox.EXCLAMATION, null);
return filterUnmatchedTransactions(result);
} else if (longDescriptions) {
Messagebox.show("Er zijn nog lange omschrijvingen. Maak deze wat korter om ze in te kunnen lezen.", null, new Messagebox.Button[] { Messagebox.Button.OK }, Messagebox.EXCLAMATION, null);
return filterLongDescriptions(result);
}
return result;
}
示例3: kill
import org.zkoss.zul.Button; //导入依赖的package包/类
@Command
@NotifyChange(value = { "btnsDisabled", "customer" })
public void kill() {
Messagebox.show("Do you want to remove the client?", "Remove", new Messagebox.Button[]{
Messagebox.Button.YES, Messagebox.Button.NO}, Messagebox.QUESTION,
(Messagebox.ClickEvent t) -> {
QLog.l().logQUser().debug("Kill by " + user.getName() + " customer " + customer.getFullNumber());
if (t.getButton() != null && t.getButton().compareTo(Messagebox.Button.YES) == 0) {
final CmdParams params = new CmdParams();
params.userId = user.getUser().getId();
Executer.getInstance().getTasks().get(Uses.TASK_KILL_NEXT_CUSTOMER)
.process(params, "", new byte[4]);
customer.refreshPrevious();
customer = null;
// Set the current working service to be empty
QUser quser = QUserList.getInstance().getById(params.userId);
quser.setCurrentService("");
setKeyRegim(KEYS_MAY_INVITE);
service_list.setModel(service_list.getModel());
refreshListServices();
service_list.invalidate();
BindUtils.postNotifyChange(null, null, Form.this, "*");
serveCustomerDialogWindow.setVisible(false);
}
});
}
示例4: 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);
}
示例5: 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);
}
示例6: setActive
import org.zkoss.zul.Button; //导入依赖的package包/类
private void setActive(Button button, int value) {
switch (value){
case 2:
button.setSclass("button right button_2");
break;
case 1:
button.setSclass("button center button_1");
break;
default:
button.setSclass("button left button_0");
break;
}
}
示例7: setInactive
import org.zkoss.zul.Button; //导入依赖的package包/类
private void setInactive(Button button, int value) {
switch (value){
case 2:
button.setSclass("button right");
break;
case 1:
button.setSclass("button center");
break;
default:
button.setSclass("button left");
break;
}
}
示例8: clickListPostponedInvite
import org.zkoss.zul.Button; //导入依赖的package包/类
@Command
public void clickListPostponedInvite() {
if (user.getPlan().isEmpty() || pickedPostponed == null) {
return;
}
Messagebox.show("Do you want to invite citizen " + pickedPostponed.getFullNumber() + " ?",
l("inviting_client"), new Messagebox.Button[] {
Messagebox.Button.YES, Messagebox.Button.NO },
Messagebox.QUESTION,
(Messagebox.ClickEvent t) -> {
QLog.l().logQUser().debug(
"Invite postponed by " + user.getName() + " citizen " + pickedPostponed
.getFullNumber());
if (t.getButton() != null
&& t.getButton().compareTo(Messagebox.Button.YES) == 0) {
final CmdParams params = new CmdParams();
// @param userId id юзера который вызывает The user who causes
// @param id это ID кастомера которого вызываем из пула отложенных, оно есть т.к. с качстомером давно работаем
// It is the ID of the caller which is called from the pool of deferred, it is because With a long-stroke tool we have been working for
// a long time
params.customerId = pickedPostponed.getId();
params.userId = user.getUser().getId();
Executer.getInstance().getTasks().get(Uses.TASK_INVITE_POSTPONED)
.process(params, "", new byte[4]);
customer = user.getUser().getCustomer();
setKeyRegim(KEYS_INVITED);
BindUtils.postNotifyChange(null, null, Form.this, "postponList");
BindUtils.postNotifyChange(null, null, Form.this, "customer");
BindUtils.postNotifyChange(null, null, Form.this, "btnsDisabled");
this.addServeScreen();
this.begin();
pickedPostponed = null;
}
else {
pickedPostponed = null;
}
});
}
示例9: 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);
}
});
}
}
示例10: constructComponent
import org.zkoss.zul.Button; //导入依赖的package包/类
@Override
public ZkButton constructComponent() {
suppress(defaultConstructorIn(Button.class));
suppress(method(Vlayout.class, "setId", String.class));
return new ZkButton(compId);
}