/** * Retrieve the response and close the dialog. * * @param component The component associated with the response. */ private void close(BaseComponent component) { response = component == null ? null : (DialogResponse<?>) component.getData(); root.close(); }
/** * Find the first child containing the specified data object. * * @param data The data object to find. * @return The child with the data object, or null if not found. */ public BaseComponent findChildByData(Object data) { for (BaseComponent child : children) { if (ObjectUtils.equals(data, child.getData())) { return child; } } return null; }
/** * Searches for a comboitem that has a date range equivalent to the specified range. * * @param range The date range to locate. * @return A comboitem containing the date range, or null if not found. */ public Dateitem findMatchingItem(DateRange range) { for (BaseComponent item : getChildren()) { if (range.equals(item.getData())) { return (Dateitem) item; } } return null; }
/** * Searches for a Listitem that has a date range equivalent to the specified range. * * @param range The date range to locate. * @return A Listitem containing the date range, or null if not found. */ public Listitem findMatchingItem(DateRange range) { for (BaseComponent item : getChildren()) { if (range.equals(item.getData())) { return (Listitem) item; } } return null; }
@Override public void onEvent(Event event) { BaseComponent target = event.getCurrentTarget(); Event newEvent = new Event("showManifest", target.getAncestor(Grid.class), target.getData()); EventUtil.send(newEvent); }
/** * Show detail for specified component. * * @param item The component containing the model object. */ protected void showDetail(BaseComponent item) { @SuppressWarnings("unchecked") M modelObject = item == null ? null : (M) item.getData(); String detail = modelObject == null ? null : getDetail(modelObject); if (!StringUtils.isEmpty(detail)) { if (getShowDetailPane()) { detailView.setContent(detail); } else { Map<String, Object> map = new HashMap<>(); map.put("title", detailTitle); map.put("content", detail); map.put("allowPrint", getAllowPrint()); try { Window window = (Window) PageUtil .createPage(Constants.RESOURCE_PREFIX + "resourceListDetailPopup.fsp", null, map).get(0); window.modal(null); } catch (Exception e) { DialogUtil.showError(e); } } } }