Package org.apache.tapestry5.internal

Examples of org.apache.tapestry5.internal.OptionModelImpl


    public static void contributeTypeCoercer(Configuration<CoercionTuple> configuration) {
   
    //Convert between String and org.apache.tapestry5.OptionModelImpl and vice versa
    configuration.add(new CoercionTuple<String, OptionModel>(String.class, OptionModel.class, new Coercion<String, OptionModel>() {
      public OptionModel coerce(String input) {
        return new OptionModelImpl(input);
      }
    }));
    configuration.add(new CoercionTuple<OptionModel, String>(OptionModel.class, String.class, new Coercion<OptionModel, String>() {
      public String coerce(OptionModel input) {
        return input.getValue().toString();
View Full Code Here


    roleModelsList = new ArrayList<OptionModel>();

    allRoles = roleService.findAll();
    for (Role role : allRoles) {
      OptionModel option = new OptionModelImpl(getMessages().get("account." + role.getName()), role.getName());
      roleModelsList.add(option);
    }
  }
View Full Code Here

  public List<OptionModel> getOptions() {
   
    List<OptionModel> options = CollectionFactory.newList();
   
    for(Person p : list) {
      options.add(new OptionModelImpl(p.getName(), p));
    }
   
    return options;
  }
View Full Code Here

      }
     
      public List<OptionModel> getOptions() {
        List<OptionModel> options = CollectionFactory.newList();
       
        options.add(new OptionModelImpl("1", 1));
        options.add(new OptionModelImpl("2", 2));
        options.add(new OptionModelImpl("3", 3));
       
        return options;
      }
     
      public List<OptionGroupModel> getOptionGroups() {
View Full Code Here

      }
     
      public List<OptionModel> getOptions() {
        List<OptionModel> options = CollectionFactory.newList();
       
        options.add(new OptionModelImpl("1", 1));
        options.add(new OptionModelImpl("2", 2));
        options.add(new OptionModelImpl("3", 3));
       
        return options;
      }
     
      public List<OptionGroupModel> getOptionGroups() {
View Full Code Here

    {
        List<OptionModel> options = CollectionFactory.newList();

        for (Locale l : supportedLocales)
        {
            options.add(new OptionModelImpl(l.getDisplayName(l), l));
        }

        return new SelectModelImpl(null, options);
    }
View Full Code Here

            final ValueEncoder encoder = this.valueEncoderSource.getValueEncoder(propertyAdapter.getType());

            final Object label = propertyAdapter.get(object);

            options.add(new OptionModelImpl(encoder.toClient(label), object));

        }

        return new SelectModelImpl(null, options);
    }
View Full Code Here

        for (T value : values)
        {
            String label = TapestryInternalUtils.getLabelForEnum(messages, prefix, value);

            options.add(new OptionModelImpl(label, value));
        }
    }
View Full Code Here

    {
        List<OptionModel> options = CollectionFactory.newList();

        for (Locale l : supportedLocales)
        {
            options.add(new OptionModelImpl(l.getDisplayName(l), l));
        }

        return new SelectModelImpl(null, options);
    }
View Full Code Here

        message = null;
    }

    public SelectModel getClickCountModel()
    {
        OptionModel one = new OptionModelImpl("one", 1);
        OptionModel two = new OptionModelImpl("two", 2);
        OptionModel three = new OptionModelImpl("three", 3);

        return new SelectModelImpl(one, two, three);
    }
View Full Code Here

TOP

Related Classes of org.apache.tapestry5.internal.OptionModelImpl

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.