Package fi.luomus.commons.containers

Examples of fi.luomus.commons.containers.SelectionImple.addOption()


        String contents = resourceChild.getContents();
        if (contents == null) continue;
        desc.append(contents).append(" ");
      }
      Utils.removeLastChar(desc);
      selection.addOption(new SelectionOptionImple(id, desc.toString()));
    }
    return selection;
  }
 
  @Override
View Full Code Here


        if (contents == null) continue;
        desc.append(contents).append(", ");
      }
      Utils.removeLastChar(desc);
      Utils.removeLastChar(desc);
      selection.addOption(new SelectionOptionImple(id, desc.toString().trim()));
    }
    return selection;
  }
 
  @Override
View Full Code Here

      }
    }

    public void test__adding_option() {
      SelectionImple s = new SelectionImple("name");
      s.addOption(new SelectionOptionImple("value", "descripTION"));
      assertEquals("VALUE", s.getOptions().iterator().next().getValue());
      assertEquals("descripTION", s.getOptions().iterator().next().getText());
    }

    public void test__adding_option_with_existing_value() {
View Full Code Here

      assertEquals("descripTION", s.getOptions().iterator().next().getText());
    }

    public void test__adding_option_with_existing_value() {
      SelectionImple s = new SelectionImple("my-selection");
      s.addOption(new SelectionOptionImple("myvalue", "descripTION"));
      try {
        s.addOption(new SelectionOptionImple("myvalue", "whatever"));
        fail("Should throw exception");
      } catch (IllegalStateException e) {
        assertEquals("Selection my-selection already contains value MYVALUE" , e.getMessage());
View Full Code Here

    public void test__adding_option_with_existing_value() {
      SelectionImple s = new SelectionImple("my-selection");
      s.addOption(new SelectionOptionImple("myvalue", "descripTION"));
      try {
        s.addOption(new SelectionOptionImple("myvalue", "whatever"));
        fail("Should throw exception");
      } catch (IllegalStateException e) {
        assertEquals("Selection my-selection already contains value MYVALUE" , e.getMessage());
      }
    }
View Full Code Here

      }
    }
   
    public void test__it_maintais_correct_order() {
      SelectionImple s = new SelectionImple("name");
      s.addOption(new SelectionOptionImple("a", "A"));
      s.addOption(new SelectionOptionImple("b", "B"));
      s.addOption(new SelectionOptionImple("c", "C"));
      s.addOption(new SelectionOptionImple("d", "D"));
      s.addOption(new SelectionOptionImple("e", "E"));
      s.addOption(new SelectionOptionImple("f", "F"));
View Full Code Here

    }
   
    public void test__it_maintais_correct_order() {
      SelectionImple s = new SelectionImple("name");
      s.addOption(new SelectionOptionImple("a", "A"));
      s.addOption(new SelectionOptionImple("b", "B"));
      s.addOption(new SelectionOptionImple("c", "C"));
      s.addOption(new SelectionOptionImple("d", "D"));
      s.addOption(new SelectionOptionImple("e", "E"));
      s.addOption(new SelectionOptionImple("f", "F"));
      s.addOption(new SelectionOptionImple("g", "G"));
View Full Code Here

   
    public void test__it_maintais_correct_order() {
      SelectionImple s = new SelectionImple("name");
      s.addOption(new SelectionOptionImple("a", "A"));
      s.addOption(new SelectionOptionImple("b", "B"));
      s.addOption(new SelectionOptionImple("c", "C"));
      s.addOption(new SelectionOptionImple("d", "D"));
      s.addOption(new SelectionOptionImple("e", "E"));
      s.addOption(new SelectionOptionImple("f", "F"));
      s.addOption(new SelectionOptionImple("g", "G"));
      s.addOption(new SelectionOptionImple("h", "H"));
View Full Code Here

    public void test__it_maintais_correct_order() {
      SelectionImple s = new SelectionImple("name");
      s.addOption(new SelectionOptionImple("a", "A"));
      s.addOption(new SelectionOptionImple("b", "B"));
      s.addOption(new SelectionOptionImple("c", "C"));
      s.addOption(new SelectionOptionImple("d", "D"));
      s.addOption(new SelectionOptionImple("e", "E"));
      s.addOption(new SelectionOptionImple("f", "F"));
      s.addOption(new SelectionOptionImple("g", "G"));
      s.addOption(new SelectionOptionImple("h", "H"));
      String descriptions = "";
View Full Code Here

      SelectionImple s = new SelectionImple("name");
      s.addOption(new SelectionOptionImple("a", "A"));
      s.addOption(new SelectionOptionImple("b", "B"));
      s.addOption(new SelectionOptionImple("c", "C"));
      s.addOption(new SelectionOptionImple("d", "D"));
      s.addOption(new SelectionOptionImple("e", "E"));
      s.addOption(new SelectionOptionImple("f", "F"));
      s.addOption(new SelectionOptionImple("g", "G"));
      s.addOption(new SelectionOptionImple("h", "H"));
      String descriptions = "";
      for (SelectionOption o : s) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.