private boolean checkInOut(String data) { String inout = piece(data, ";", 2); String opt = (String) rgInOut.getSelectedItem().getValue(); return opt.contains(inout); }
/** Deselects all of the currently selected radio button and selects * the radio button with the given index. */ public void setSelectedIndex(int jsel) { if (jsel < 0) jsel = -1; if (_jsel != jsel) { if (jsel < 0) { Radio r = getSelectedItem(); if (r != null) r.setSelected(false); } else { getItemAtIndex(jsel).setSelected(true); } } }
/** * When a radio button is selected, its associated patient list is activated. */ public void onCheck$rgrpLists() { Radio radio = rgrpLists.getSelectedItem(); if (radio == null) { radio = rgrpLists.getItemAtIndex(0); rgrpLists.setSelectedItem(radio); } IPatientList list = (IPatientList) radio.getAttribute(ATTR_PATIENT_LIST); setActiveList(list); }
public void onClick$btnOK() { clearMessages(); Radio radio = rgReason.getSelectedItem(); String reasonCode = radio == null ? null : (String) radio.getValue(); if (reasonCode == null) { Clients.wrongValue(rgReason, "You must select a reason for the deletion."); return; } String reasonText = "3".equals(reasonCode) ? txtOther.getText().trim() : null; if (reasonText != null && reasonText.isEmpty()) { Clients.wrongValue(txtOther, "Please enter text describing the reason for the deletion."); return; } try { service.delete(record, reasonCode, reasonText); } catch (Exception e) { PromptDialog.showError(e.getMessage()); return; } root.setAttribute("ok", true); root.detach(); } }
/** Make sure only one of them is checked. */ private void fixSiblings(boolean checked, boolean byclient) { final Radiogroup group = getRadiogroup(); if (group != null) { if (checked) { final Radio sib = group.getSelectedItem(); if (sib != null && sib != this) { if (byclient) { sib._checked = false; } else { sib.setChecked(false); //and fixSelectedIndex return; } } } group.fixSelectedIndex(); group.syncSelectionToModel(); } }
public void onClick$btnSearch() { String text = txtSearch.getValue().trim(); boolean synonym = rgrpLookupMode.getSelectedIndex() == 1; FMDate date = new FMDate(datSearch.getValue()); Long max = (Long) rgrpMaxResults.getSelectedItem().getValue(); String[] filters = getSelectedSubsets(); List<TermMatch> matches = TermUtil.lookupSCT(text, synonym, date, max, filters); TreeNode<Object> rootNode = new DefaultTreeNode<>(null, null, false); buildModel(rootNode, matches); DefaultTreeModel<Object> model = new DefaultTreeModel<>(rootNode); treeSearch.setModel(model); }