Package org.apache.tapestry5

Examples of org.apache.tapestry5.SelectModel


    @Test
    public void get_locale_model()
    {
        LocalizationSetter setter = new LocalizationSetterImpl(null, null, null, "en,fr");

        SelectModel model = setter.getSupportedLocalesModel();

        assertNull(model.getOptionGroups());

        List<OptionModel> options = model.getOptions();

        assertEquals(options.size(), 2);

        assertEquals(options.get(0).getLabel(), "English");
        // Note that the label is localized to the underlying locale, not the default locale.
View Full Code Here


    @Test
    public void get_locale_model()
    {
        LocalizationSetter setter = new LocalizationSetterImpl(null, null, null, "en,fr");

        SelectModel model = setter.getSupportedLocalesModel();

        assertNull(model.getOptionGroups());

        List<OptionModel> options = model.getOptions();

        assertEquals(options.size(), 2);

        assertEquals(options.get(0).getLabel(), "English");
        // Note that the label is localized to the underlying locale, not the default locale.
View Full Code Here

        Messages messages = mockMessages();
        stub_contains(messages, false);

        replay();

        SelectModel model = new EnumSelectModel(Stooge.class, messages);

        List<OptionModel> options = model.getOptions();

        assertEquals(options.size(), 3);

        checkOption(options, 0, "Moe", Stooge.MOE);
        checkOption(options, 1, "Larry", Stooge.LARRY);
View Full Code Here

        train_contains(messages, "Stooge.LARRY", true);
        train_get(messages, "Stooge.LARRY", "Mr. Larry Fine");

        replay();

        SelectModel model = new EnumSelectModel(Stooge.class, messages);

        List<OptionModel> options = model.getOptions();

        assertEquals(options.size(), 3);

        checkOption(options, 0, "Moe", Stooge.MOE);
        checkOption(options, 1, "Mr. Larry Fine", Stooge.LARRY);
View Full Code Here

        train_contains(messages, "MOE", true);
        train_get(messages, "MOE", "Sir Moe Howard");

        replay();

        SelectModel model = new EnumSelectModel(Stooge.class, messages);

        List<OptionModel> options = model.getOptions();

        assertEquals(options.size(), 3);

        checkOption(options, 0, "Sir Moe Howard", Stooge.MOE);
        checkOption(options, 1, "Larry", Stooge.LARRY);
View Full Code Here

    @Test
    public void get_locale_model()
    {
        LocalizationSetter setter = new LocalizationSetterImpl(null, null, null, "en,fr");

        SelectModel model = setter.getSupportedLocalesModel();

        assertNull(model.getOptionGroups());

        List<OptionModel> options = model.getOptions();

        assertEquals(options.size(), 2);

        assertEquals(options.get(0).getLabel(), "English");
        // Note that the label is localized to the underlying locale, not the default locale.
View Full Code Here

        ComponentEventCallback<SelectModel> callback = new ComponentEventCallback<SelectModel>()
        {
            public boolean handleResult(SelectModel result)
            {
                SelectModel matches = coercer.coerce(result, SelectModel.class);
               
                model = matches;

                return true;
            }
View Full Code Here

        ComponentEventCallback<SelectModel> callback = new ComponentEventCallback<SelectModel>()
        {
            public boolean handleResult(SelectModel result)
            {
                SelectModel matches = coercer.coerce(result, SelectModel.class);
               
                model = matches;

               
                return true;
View Full Code Here

 
  @Inject
    private Messages _messages;

  public SelectModel getSM() {
return new SelectModel() {
     
      public void visit(SelectModelVisitor visitor) {
        // TODO Auto-generated method stub
       
      }
View Full Code Here

  }
 
  SelectModel onProvideCompletionsFromFirst(String part)
  {
   
    return new SelectModel() {
     
      public void visit(SelectModelVisitor visitor) {
        // TODO Auto-generated method stub
       
      }
View Full Code Here

TOP

Related Classes of org.apache.tapestry5.SelectModel

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.