private void updateState() { btnOK.setDisabled(StringUtils.isEmpty(textbox.getValue())); }
@EventHandler(value = "click", target = "btnSend") private void onClick$btnSend() { messageCount++; if (chkAutoGenerate.isChecked()) { tboxEventData.setValue("Sending test event #" + messageCount); } eventManager.fireRemoteEvent(tboxEventName.getValue(), tboxEventData.getValue(), parseRecipients(tboxEventRecipients.getValue())); info("Fired", tboxEventName.getValue()); }
/** * Called after a node's label has been edited. Updates the node's label with the edited value * and takes the node out of edit mode. */ private void editNodeStop() { Treenode currentEdit = (Treenode) txtLabel.getAttribute(ITEM_ATTR); txtLabel.removeAttribute(ITEM_ATTR); popLabel.close(); if (currentEdit != null) { String oldLabel = (String) currentEdit.getAttribute(LABEL_ATTR); String newLabel = txtLabel.getValue(); newLabel = newLabel != null && !newLabel.trim().isEmpty() ? newLabel : oldLabel; currentEdit.setLabel(newLabel); if (!newLabel.equals(oldLabel)) { updateLabel(currentEdit, newLabel); } } }
@EventHandler(value = "enter", target = "@textbox") @EventHandler(value = "click", target = "@btnOK") private void onCommit() { root.setAttribute("result", textbox.getValue()); root.close(); }
/** * Perform a search. */ @EventHandler(value = "click", target = "btnSearch") private void onClick$btnSearch() { txtSearch.setFocus(true); lblNotFound.setVisible(false); String text = txtSearch.getValue(); tree.setSelectedNode(null); if (text != null && !text.isEmpty()) { text = text.toLowerCase(); iterator = iterator == null ? tree.iterator() : iterator; while (iterator.hasNext()) { Treenode node = iterator.next(); if (node.getLabel().toLowerCase().contains(text)) { node.makeVisible(); node.setSelected(true); return; } } iterator = null; lblNotFound.setVisible(true); } }
/** * Perform the search and display the results. */ @EventHandler(value = "click", target = "btnSearch") private void onClick$btnSearch() { modelAndView.setModel(null); tblSrchResults.getRows().destroyChildren(); String query = txtSearch.getValue(); showMessage(null); if (query != null && query.trim().length() > 0) { HelpUtil.getSearchService().search(query, helpSets, this); } else { showMessage("cwf.help.tab.search.noentry"); } }
@EventHandler(value = "click", target = "btnUnlock") private void onClick$btnUnlock() { String s = txtPassword.getValue(); txtPassword.setValue(null); lblInfo.setLabel(null); txtPassword.focus(); if (!StringUtils.isEmpty(s)) { if (securityService.validatePassword(s)) { setMode(Mode.BASELINE); } else { lblInfo.setLabel(StrUtil.getLabel("cwf.sessionmonitor.lock.badpassword.message")); } } }
@EventHandler(value = "click", target = "btnNewEvent") private void onClick$btnNewEvent() { String eventName = StringUtils.trimToNull(tboxNewEvent.getValue()); if (eventName != null && !containsEvent(eventName)) { Listitem item = new Listitem(); item.setLabel(eventName); lboxEventList.addChild(item); } tboxNewEvent.setValue(""); }
@EventHandler(value = "click", target = "btnOK") public void onClick$btnOK() { String name = txtLayout.getValue().trim(); if (!LayoutUtil.validateName(name)) { showError(MSG_LAYOUT_BADNAME); return; } LayoutIdentifier id = new LayoutIdentifier(name, rbShared.isChecked()); if (LayoutUtil.layoutExists(id)) { if (!allowDups) { showError(MSG_LAYOUT_DUP); } else { DialogUtil.confirm(MSG_LAYOUT_OVERWRITE, CAP_LAYOUT_OVERWRITE, (confirm) -> { if (confirm) { close(id); } }); } } else { close(id); } }