@Override public FormTableBinding removeBinding(int mColumn) { FormTableBinding binding = boundColumns.remove(mColumn); if (binding != null) { if (boundPaths.remove(binding.getMember().getMemberPath()) != binding) { throw new BindingException("Binding " + binding + " missing in path map"); } } return binding; }
@Override @SuppressWarnings("unchecked") public void addBinding(Binding binding) { if (binding instanceof FxTableBinding) { FxTableBinding<S,?> oldBinding = boundPaths.put(binding.getMember().getMemberPath(), (FxTableBinding<S,?>) binding); if (oldBinding != null) { throw new BindingException(binding + ": binding path '" + binding.getMember().getMemberPath() + "' already bound to column " + oldBinding.getConfiguration().getName()); } } }
/** * Sets the component name to some meaningful value.<br> * Required by some GUI testing tools. * <p> * The component name will be the <code>memberPath</code> prepended * with the names of the parent components, each separated by a slash.<br> * Example: * <pre> * "Shipment/ShipmentFile/Booking/shipment.customer.addressNumber" * </pre> */ protected void updateComponentName() { if (component instanceof Component) { if (((Component) component).getName() == null) { // if not already set by the application StringBuilder buf = new StringBuilder(getMember().getMemberPath()); // prepend the parent names, if any Component parent = ((Component) component).getParent(); while (parent != null) { if (parent.getName() != null) { buf.insert(0, parent.getName() + "/"); } parent = parent.getParent(); } ((Component) component).setName(buf.toString()); LOGGER.fine("{0}.setName(\"{1}\")", component.getComponentPath(), ((Component) component).getName()); } } }
@Override public FxComponentBinding removeBinding(FxComponent component) { FxComponentBinding binding = boundComponents.remove(component); if (binding != null) { if (boundPaths.remove(binding.getMember().getMemberPath()) != binding) { throw new BindingException("Binding " + binding + " missing in path map"); } binding.getComponent().setBinding(null); } return binding; }
/** * Sets the component name to some meaningful value.<br> * Required by some GUI testing tools. * <p> * The component name will be the <code>memberPath</code> prepended * with the names of the parent components, each separated by a slash.<br> * Example: * <pre> * "Shipment/ShipmentFile/Booking/shipment.customer.addressNumber" * </pre> */ protected void updateComponentName() { if (component instanceof Component && ((Component) component).getName() == null) { // if not already set by the application StringBuilder buf = new StringBuilder(getMember().getMemberPath()); // prepend the parent names, if any Component parent = ((Component) component).getParent(); while (parent != null) { if (parent.getName() != null) { buf.insert(0, parent.getName() + "/"); } parent = parent.getParent(); } ((Component) component).setName(buf.toString()); LOGGER.fine("{0}.setName(\"{1}\")", component.getComponentPath(), ((Component) component).getName()); } }
@Override public FormComponentBinding removeBinding(FormComponent component) { FormComponentBinding binding = boundComponents.remove(component); if (binding != null) { if (boundPaths.remove(binding.getMember().getMemberPath()) != binding) { throw new BindingException("Binding " + binding + " missing in path map"); } binding.getComponent().setBinding(null); } return binding; }
/** * Programmatically adds a binding to this form. * * @param binding the binding to add */ @Override public void addBinding(Binding binding) { if (binding instanceof FormTableBinding) { FormTableBinding oldBinding = boundPaths.put(binding.getMember().getMemberPath(), (FormTableBinding) binding); if (oldBinding != null) { throw new BindingException(binding + ": binding path '" + binding.getMember().getMemberPath() + "' already bound to column " + oldBinding.getColumn()); } oldBinding = boundColumns.put(((FormTableBinding) binding).getColumn(), (FormTableBinding) binding); if (oldBinding != null) { throw new BindingException(binding + ": column '" + ((FormTableBinding) binding).getColumn() + "' already bound to " + oldBinding.getMember().getMemberPath()); } } }
@Override public ValidationContext createValidationContext(ValidationScope scope) { return new ValidationContext(getMember().getMemberPath(), getMember().getType(), getModelValue(), getParentObject(), scope); }
@Override public void addBinding(Binding binding) { if (binding instanceof FxComponentBinding) { FxComponentBinding oldBinding = boundPaths.put(binding.getMember().getMemberPath(), (FxComponentBinding) binding); if (oldBinding != null) { throw new BindingException(binding + ": binding path '" + binding.getMember().getMemberPath() + "' already bound to " + oldBinding.getComponent().getComponentPath()); if (oldBinding != null) { throw new BindingException(binding + ": component '" + ((FxComponentBinding) binding).getComponent().getComponentPath() + "' already bound to " + oldBinding.getMember().getMemberPath());
@Override public List<ValidationResult> validate() { Object parentObject = getParentObject(); if (validators != null && parentObject != null && isValidationRequired()) { List<ValidationResult> results = ValidationUtilities.getInstance().validateObject( validators, binder.getValidationScope(), member.getMemberPath(), parentObject, getModelValue(), getMember().getType()); fireValidated(results); binder.fireValidated(this, results); return results; } return Collections.emptyList(); }
@Override public void addBinding(Binding binding) { if (binding instanceof FormComponentBinding) { FormComponentBinding oldBinding = boundPaths.put(binding.getMember().getMemberPath(), (FormComponentBinding) binding); if (oldBinding != null) { throw new BindingException(binding + ": binding path '" + binding.getMember().getMemberPath() + "' already bound to " + oldBinding.getComponent().getComponentPath()); if (oldBinding != null) { throw new BindingException(binding + ": component '" + ((FormComponentBinding) binding).getComponent().getComponentPath() + "' already bound to " + oldBinding.getMember().getMemberPath());
ValidationScope scope = ValidationScopeFactory.getInstance().getMandatoryScope(); ValidationContext validationContext = new ValidationContext( getMember().getMemberPath(), getMember().getType(), modelValue, ValidationScope scope = ValidationScopeFactory.getInstance().getChangeableScope(); ValidationContext validationContext = new ValidationContext( getMember().getMemberPath(), getMember().getType(), modelValue,
ValidationScope scope = ValidationScopeFactory.getInstance().getMandatoryScope(); ValidationContext validationContext = new ValidationContext( getMember().getMemberPath(), getMember().getType(), modelValue, ValidationScope scope = ValidationScopeFactory.getInstance().getChangeableScope(); ValidationContext validationContext = new ValidationContext( getMember().getMemberPath(), getMember().getType(), modelValue,
ValidationScope scope = ValidationScopeFactory.getInstance().getMandatoryScope(); ValidationContext validationContext = new ValidationContext( getMember().getMemberPath(), getMember().getType(), modelValue, ValidationScope scope = ValidationScopeFactory.getInstance().getChangeableScope(); ValidationContext validationContext = new ValidationContext( getMember().getMemberPath(), getMember().getType(), modelValue,
ValidationScope scope = ValidationScopeFactory.getInstance().getMandatoryScope(); ValidationContext validationContext = new ValidationContext( getMember().getMemberPath(), getMember().getType(), modelValue, ValidationScope scope = ValidationScopeFactory.getInstance().getChangeableScope(); ValidationContext validationContext = new ValidationContext( getMember().getMemberPath(), getMember().getType(), modelValue,
ValidationScope scope = ValidationScopeFactory.getInstance().getMandatoryScope(); ValidationContext validationContext = new ValidationContext( mandatoryBinding.getMember().getMemberPath(), mandatoryBinding.getMember().getType(), mandatoryBinding.getModelValue(), ValidationScope scope = ValidationScopeFactory.getInstance().getChangeableScope(); ValidationContext validationContext = new ValidationContext( changeableBinding.getMember().getMemberPath(), changeableBinding.getMember().getType(), changeableBinding.getModelValue(),
ValidationScope scope = ValidationScopeFactory.getInstance().getMandatoryScope(); ValidationContext validationContext = new ValidationContext( mandatoryBinding.getMember().getMemberPath(), mandatoryBinding.getMember().getType(), mandatoryBinding.getModelValue(), ValidationScope scope = ValidationScopeFactory.getInstance().getChangeableScope(); ValidationContext validationContext = new ValidationContext( changeableBinding.getMember().getMemberPath(), changeableBinding.getMember().getType(), changeableBinding.getModelValue(),