Package com.vaadin.ui

Examples of com.vaadin.ui.Field$ValueChangeEvent


        FormPropertyRenderer renderer = getRenderer(formProperty);
      
        // Be able to get the Form from any Renderer.
        renderer.setForm(form);
      
        Field editorComponent = renderer.getPropertyField(formProperty);
        if(editorComponent != null) {
          // Get label for editor component.
          form.addField(formProperty.getId(), editorComponent);
        }
      }
View Full Code Here


    Map<String, String> formPropertyValues = new HashMap<String, String>();
   
    // Get values from fields defined for each form property
    for(FormProperty formProperty : formProperties) {
      if(formProperty.isWritable()) {
        Field field = form.getField(formProperty.getId());
        FormPropertyRenderer renderer = getRenderer(formProperty);
        String fieldValue = renderer.getFieldValue(formProperty, field);
       
        formPropertyValues.put(formProperty.getId(), fieldValue);
      }
View Full Code Here

     
      @Override
      public Field createField(Container container, Object itemId,
          Object propertyId, Component uiContext) {

                Field field;
               
                if ("roleName".equals(propertyId)) {
                 
                  field = new TextField();
                  field.setReadOnly(true);
                    field.setWidth("80%");
                }
                else if ("browseAllowed".equals(propertyId)) {
                  field = new CheckBox();
                    field.setWidth("20%");
                }
                else
                  field = super.createField(container, itemId, propertyId, uiContext);
               
                return field;
View Full Code Here

  public QueueForm(final ProcessToolContext ctx, final I18NSource source, final GenericVaadinPortlet2BpmApplication application) {
   
    setFormFieldFactory(new DefaultFieldFactory() {
            @Override
            public Field createField(Item item, Object propertyId, Component uiContext) {
          Field field = super.createField(item, propertyId, uiContext);

          if ("process".equalsIgnoreCase(propertyId.toString())) {
              NativeSelect select = new NativeSelect();
              Collection<ProcessDefinitionConfig> processes = ctx.getProcessDefinitionDAO().getActiveConfigurations();
              BeanItemContainer<ProcessDefinitionConfig> ds = new BeanItemContainer<ProcessDefinitionConfig>(ProcessDefinitionConfig.class);
              ds.addAll(processes);
              select.setContainerDataSource(ds);
              select.setItemCaptionPropertyId("description");
              select.setItemCaptionMode(Select.ITEM_CAPTION_MODE_PROPERTY);
              select.setNullSelectionAllowed(false);
              select.setRequired(true);
              select.setPropertyDataSource(item.getItemProperty(propertyId));
              field = select;
          }
          else if ("name".equalsIgnoreCase(propertyId.toString())) {
            TextField text = new TextField();
            text.setNullRepresentation("");
            text.setRequired(true);
            field = text;
          }
          else if ("description".equalsIgnoreCase(propertyId.toString())) {
            TextField text = new TextField();
            text.setNullRepresentation("");
            text.setRequired(true);
            field = text;
          }
          else if ("rights".equalsIgnoreCase(propertyId.toString())) {
            RightsTable rights = new RightsTable(source, application);
            //rights.setHeight("150px");
            rights.setRequired(true);
            field = rights;
          }
         
          field.setCaption(source.getMessage("queues.add.form." + propertyId));
          field.setWidth(100, Sizeable.UNITS_PERCENTAGE);
          return field;
            }
        });
   
  }
View Full Code Here

public class GenericValueFieldFactory extends DefaultFieldFactory {
  @Override
  public Field createField(Item item, Object propertyId, Component uiContext) {
    Class<?> type = item.getItemProperty(propertyId).getType();
    Field field = createFieldByPropertyType(type);
    field.setCaption(createCaptionByPropertyId(propertyId));
    return field;
  }
View Full Code Here

    field.setCaption(createCaptionByPropertyId(propertyId));
    return field;
  }

  public static Field createFieldByPropertyType(Class<?> type) {
    Field field = DefaultFieldFactory.createFieldByPropertyType(type);

    if (field instanceof TextField && !type.isAssignableFrom(String.class)) {
      if (type.isEnum()) {
        Select select = new Select();
View Full Code Here

        if (!isPropertyVisible(propertyId)) {
            return null;
        }
        BeanItem<DictionaryItemWrapper> beanItem = Lang2.assumeType(item, BeanItem.class);
        DictionaryItemWrapper bean = beanItem.getBean();
        Field field = _VALUES.equals(propertyId)
        ? createItemValuesField(application, source, bean.getValueType())
                : new TextField(source.getMessage("dict.item." + propertyId));
        field.setWidth("100%");
        if (isPropertyEditable(propertyId)) {
            field.setRequired(isPropertyRequired(propertyId));
            field.setRequiredError(source.getMessage("dict.item." + propertyId + ".required"));
        }
        else {
            field.setReadOnly(true);
        }
        return field;
    }
View Full Code Here

  }

  @Override
  public Field createField(Container container, Object itemId, Object propertyId, Component uiContext) {
    Map<Object, Field> itemIdToFieldMap = fieldCache.get(propertyId);
    Field field;

    if (itemIdToFieldMap != null) {
      field = itemIdToFieldMap.get(itemId);
      if (field != null) {
        return field;
View Full Code Here

    while (parentOfSpinnerTextField != null || formFound) {
      if (parentOfSpinnerTextField instanceof Form) {
        Form f = (Form) parentOfSpinnerTextField;
        Collection<?> visibleItemProperties = f.getItemPropertyIds();
        for (Object fieldId : visibleItemProperties) {
          Field field = f.getField(fieldId);
          if (field == this) {
            /*
             * this SpinnerTextField is logically in a form. Do the
             * same thing as form does in its value change listener
             * that it registers to all fields.
View Full Code Here

TOP

Related Classes of com.vaadin.ui.Field$ValueChangeEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.