protected Row getSelectedRow() { return grid.getRows().getSelectedRow(); }
private IBaseResource getSelectedResource() { Row row = tblResources.getRows().getSelectedRow(); return row == null ? null : (IBaseResource) row.getData(); }
/** * Sets the {@link Selectable selectable} setting. * * @param selectable The {@link Selectable selectable} setting. */ @PropertySetter(value = "selectable", defaultValue = "no", description = "The selectability setting.") public void setSelectable(Selectable selectable) { if (propertyChange("selectable", this.selectable, this.selectable = defaultify(selectable, Selectable.NO), true)) { if (selectable != Selectable.MULTIPLE && !selected.isEmpty()) { unselect(selectable == Selectable.NO ? null : getSelectedRow()); } } }
/** * Sets the currently viewed topic when a search result is selected. */ @EventHandler(value = "change", target = "@tblSrchResults") private void onSelect$tblSrchResults() { Row row = tblSrchResults.getRows().getSelectedRow(); setTopic((HelpTopic) row.getData()); }
/** * Handles the selection of a row in the property grid. * * @param event Row selection event. */ @EventHandler(value = "change", target = "rowProperties") private void onRowSelect(ChangeEvent event) { Rows rows = gridProperties.getRows(); Row selectedRow = rows.getSelectedCount() == 0 ? null : rows.getSelectedRow(); PropertyEditorBase<?> editor = selectedRow == null ? null : (PropertyEditorBase<?>) (selectedRow.getAttribute(EDITOR_ATTR)); PropertyInfo propInfo = editor == null ? null : editor.getPropInfo(); setPropertyDescription( propInfo == null ? "@cwf.shell.designer.property.grid.propdx.some.caption" : propInfo.getName(), propInfo == null ? " " : propInfo.getDescription()); if (editor != null) { editor.setFocus(); } }