@Override public T getValue() { return columnComponent.getValue(); }
public Map<String, Object> collectParameters() { Map<String, Object> parameters = new HashMap<>(); for (String paramName : parameterComponents.keySet()) { Field parameterField = parameterComponents.get(paramName); Object value = parameterField.getValue(); parameters.put(paramName, value); } return parameters; }
@Override public Map<String, Object> getFormResult() { HashMap<String, Object> result = new HashMap<>(); for (Map.Entry<ProcFormParam, Field> entry : componentsMap.entrySet()) { ProcFormParam formParam = entry.getKey(); if (!formParam.isEditable()) continue; Field component = entry.getValue(); result.put(formParam.getName(), component.getValue()); } return result; }
protected void commitBulkChanges() { List<String> fields = new ArrayList<>(); for (Map.Entry<String, Field> fieldEntry : dataFields.entrySet()) { Field field = fieldEntry.getValue(); if (isFieldChanged(field)) { fields.add(managedFields.get(fieldEntry.getKey()).getFqn()); } } for (Map.Entry<String, Field> fieldEntry : dataFields.entrySet()) { Field field = fieldEntry.getValue(); if (!field.isEnabled()) { for (Entity item : items) { ensureEmbeddedPropertyCreated(item, fieldEntry.getKey()); item.setValueEx(fieldEntry.getKey(), null); } } else if (isFieldChanged(field)) { for (Entity item : items) { ensureEmbeddedPropertyCreated(item, fieldEntry.getKey()); item.setValueEx(fieldEntry.getKey(), field.getValue()); } } } Set<Entity> committed = dataSupplier.commit(new CommitContext(items)); Logger logger = LoggerFactory.getLogger(BulkEditorWindow.class); logger.info("Applied bulk editing for {} entries of {}. Changed properties: {}", committed.size(), metaClass, StringUtils.join(fields, ", ")); showNotification(formatMessage("bulk.successMessage", committed.size()), NotificationType.HUMANIZED); close(COMMIT_ACTION_ID); }
protected String getFieldValue(String name) { if (datasource != null) { return datasource.getItem().getValue(name); } else if (window != null) { Field field = (Field) window.getComponentNN(name); return (String) field.getValue(); } else { return (String) fieldGroup.getFieldValue(name); } }
@SuppressWarnings("unchecked") @Override public void paramChanged(Param oldParam, Param newParam) { Component oldParamEditComponent = paramEditComponent; for (Component component : paramEditComponentLayout.getComponents()) { paramEditComponentLayout.remove(component); } createParamEditLayout(); if (paramEditComponent instanceof Field) { ((Field) paramEditComponent).setRequired(condition.getRequired()); if (oldParam.getJavaClass().equals(newParam.getJavaClass()) && paramEditComponent.getClass().equals(oldParamEditComponent.getClass())) { ((Field) paramEditComponent).setValue(((Field) oldParamEditComponent).getValue()); } } }
protected void _addValue(Field componentForAdding) { Object value = componentForAdding.getValue(); if (value != null) { componentForAdding.setValue(null); if (!valueExists(value)) { addValueToLayout(value, ListEditorHelper.getValueCaption(value, itemType, timeZone, optionCaptionProvider)); } } }
Integer newMaxResultsValue = maxResultsField.getValue(); if (newMaxResultsValue != null) { maxResultsEl.setText(newMaxResultsValue.toString());
/** * The method is invoked before search. It sets datasource {@code maxResults} value based on the maxResults * field (if visible) or on maxFetchUI value. * Method also resets the datasource {@code firstResult} value */ protected void initDatasourceMaxResults() { checkState(); if (this.maxResults != -1 && !useMaxResults) { adapter.setMaxResults(maxResults); } else if (maxResultsAddedToLayout && useMaxResults) { Integer maxResults = maxResultsField.getValue(); if (maxResults != null && maxResults > 0) { adapter.setMaxResults(maxResults); } else { adapter.setMaxResults(persistenceManager.getFetchUI(adapter.getMetaClass().getName())); } } adapter.setFirstResult(0); }