private void updateState() { btnOK.setDisabled(StringUtils.isEmpty(textbox.getValue())); }
private void showError(String message) { if (message == null) { txtLayout.setBalloon(null); } else { txtLayout.setBalloon(StrUtil.formatMessage(message)); txtLayout.focus(); } } }
/** * 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 = "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")); } } }
/** * Place the specified tree node in edit mode. In this mode, the node's label is replaced with a * text box containing the label's value. * * @param node Target tree node. */ private void editNodeStart(Treenode node) { txtLabel.setAttribute(ITEM_ATTR, node); if (node == null) { popLabel.close(); } else { String label = node.getLabel(); node.setAttribute(LABEL_ATTR, label); txtLabel.setValue(label); node.setLabel(null); popLabel.open(node, "left top", "left top"); txtLabel.setFocus(true); } }
@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(""); }
/** * 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); } }
@Override public void afterInitialized(BaseComponent comp) { this.root = (Window) comp; root.setAttribute("controller", this); root.setTitle(root.getAttribute("title", "")); root.addClass("flavor:" + root.getAttribute("panelClass", "panel-primary")); prompt.setLabel(root.getAttribute("prompt", "")); textbox.setValue(root.getAttribute("oldValue", null)); textbox.selectAll(); updateState(); }
private void displayResource() { IBaseResource resource = getSelectedResource(); if (resource == null) { txtResource.setValue(null); btnDelete.setDisabled(true); } else { FhirContext ctx = fhirService.getClient().getFhirContext(); IParser parser = rbJSON.isChecked() ? ctx.newJsonParser() : ctx.newXmlParser(); parser.setPrettyPrint(true); txtResource.setValue(parser.encodeResourceToString(resource)); txtResource.selectRange(0, 0); btnDelete.setDisabled(false); } }
private void setMode(Mode newMode) { resetActivity(); if (newMode != mode) { mode = newMode; updateState(true); txtPassword.setFocus(mode == Mode.LOCK); } }
}); txtLabel.setWidth("95%"); txtLabel.setPattern("^(?!\\s*$).+"); IEventListener labelEditorListener = (event) -> { event.stopPropagation(); }; txtLabel.addEventListener(ChangeEvent.TYPE, labelEditorListener); txtLabel.addEventListener("blur", labelEditorListener); txtLabel.addEventListener("enter", labelEditorListener); resetTree();
@EventHandler(value = "change", target = "@grid") private void onChange$grid() { txtSearch.focus(); }
/** * If popup specified as a child, set it as the associated popup component. * * @see org.fujion.component.BaseComponent#afterAddChild(org.fujion.component.BaseComponent) */ @Override protected void afterAddChild(BaseComponent child) { super.afterAddChild(child); if (getPage() != null) { setPopup((Popup) child); } }
@EventHandler(value = "open", target = "editor") private void onOpen() { textbox.focus(); }
@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()); }
@Override protected void setValue(Object value) { editor.setValue((String) value); textbox.setValue((String) value); updateValue(); }
@EventHandler(value = "enter", target = "@textbox") @EventHandler(value = "click", target = "@btnOK") private void onCommit() { root.setAttribute("result", textbox.getValue()); root.close(); }