private boolean isFieldBound(Field memberField, Object objectWithMemberFields) { try { HasValue field = (HasValue) getMemberFieldValue(memberField, objectWithMemberFields); return bindings.stream() .anyMatch(binding -> binding.getField() == field); } catch (Exception e) { return false; } }
Objects.requireNonNull(binding, "null is not a valid editor field"); if (!(binding.getField() instanceof Component)) { throw new IllegalArgumentException( "Binding target must be a component.");
} else { c = (Component) binding.get().getField();
protected Component getComponentFor(ET pojo, String property) { EditorStuff editorsstuff = provideEditorStuff(pojo); Component c = null; Optional<Binder.Binding<ET, ?>> binding = editorsstuff.bfg.getBinding(property); if (binding.isPresent()) { c = (Component) binding.get().getField(); } else { try { // property that is not a property editor field but custom UI "column" java.lang.reflect.Field f = editorType.getDeclaredField(property); f.setAccessible(true); c = (Component) f.get(editorsstuff.editor); } catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException ex) { Logger.getLogger(AbstractElementCollection.class.getName()). log(Level.SEVERE, null, ex); } if (c == null) { c = new Label(""); } } return c; }
/** * Gets the bound field for this status. * * @return the field */ public HasValue<?> getField() { return getBinding().getField(); } }