Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright 2014 Fernando Rincon Martin <frm.rincon@gmail.com> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
 
 package org.abstractform.binding.vaadin;
 
 import java.util.Map;
 
 
 
 
 @SuppressWarnings("rawtypes")
 public class VaadinBindingFormToolkit implements BFormToolkit<Component> {
 
 
 	}
 
 	public VaadinBindingFormToolkit(FormToolkit<ComponentdelegateToolKit) {
 		this. = delegateToolKit;
 	}
 
 	public VaadinBindingFormInstance buildForm(Form formMap<StringObjectextraObjects) {
 		VaadinFormInstance delegate = (VaadinFormInstance.buildForm(formextraObjects);
 				.getComponentIterator().next(), delegate);
 		replaceFormInstanceReferences(delegateformInstance);
 		return formInstance;
 	}
 
 		for (String fieldId : delegate.getFieldIds()) {
 			AbstractComponent component = delegate.getComponentById(fieldId);
 			if (component.getData() instanceof VaadinDataObject) {
 				VaadinDataObject dataObject = (VaadinDataObjectcomponent.getData();
 				Field field = dataObject.getField();
 					if (component instanceof Container.Viewer) {
 						final Container.Viewer viewer = (Container.Viewercomponent;
 						final VaadinSelectorContainer container = new VaadinSelectorContainer(factory.createSelectorProvider(real));
 
 						if (viewer instanceof AbstractSelect) {
 							final AbstractSelect abstractSelect = (AbstractSelectviewer;
 
 								public void containerItemSetChange(ItemSetChangeEvent event) {
 									boolean readOnly = abstractSelect.isReadOnly();
 									abstractSelect.setReadOnly(false);
 									abstractSelect.sanitizeSelection();
 									abstractSelect.setReadOnly(readOnly);
 								}
 
 							});
 							viewer.setContainerDataSource(container);
 						}
 					}
 				}
 			}
		}
	}
		return buildForm(form, Collections.<StringObjectemptyMap());
	}
	public <S> VaadinBindingFormInstance<S> buildForm(BForm<S> formBindingToolkit bindingToolkitMap<StringObjectextraObjects) {
		return buildForm(formbindingToolkitextraObjectstrue);
	}
	/*
	 * (non-Javadoc)
	 * 
	 * @see org.abstractform.binding.BFormToolkit#buildForm(org.abstractform.binding.BForm)
	 */
	public <U> VaadinBindingFormInstance<U> buildForm(BForm<U> form) {
		try {
			return buildForm(form, BindingService.getInstance().getBindingToolkit());
catch (ServiceNotFoundException e) {
			throw new UnsupportedOperationException("Default binding toolkit not found"e);
		}
	}
	private ComponentContainer addValidationSummaryField(Component oldMainboolean validationSummaryVisible) {
		// add error sumary layout
		VerticalLayout summary = new VerticalLayout();
		summary.setVisible(validationSummaryVisible);
		main.addComponent(summary);
		main.addComponent(oldMain);
		return main;
	}
	public <S> VaadinBindingFormInstance<S> buildForm(BForm<S> formBindingToolkit bindingToolkit) {
		return buildForm(formbindingToolkit, Collections.<StringObjectemptyMap());
	}
	public <S> VaadinBindingFormInstance<S> buildForm(BForm<S> formBindingToolkit bindingToolkit,
			Map<StringObjectextraObjectsboolean immediate) {
		VaadinFormInstance delegate = (VaadinFormInstance.buildForm(formextraObjects);
				.getComponentIterator().next(), delegate);
		bindingToolkit.bindFields(instanceform);
		replaceFormInstanceReferences(delegateinstance);
		return instance;
	}
	/*
	 * (non-Javadoc)
	 * 
	 * @see org.abstractform.core.FormToolkit#getImplementationClass()
	 */
		return Component.class;
	}
New to GrepCode? Check out our FAQ X