Пример #1
0
 protected T read(String design) {
   try {
     return (T) Design.read(new ByteArrayInputStream(design.getBytes("UTF-8")));
   } catch (UnsupportedEncodingException e) {
     throw new RuntimeException(e);
   }
 }
Пример #2
0
  @Test(expected = DesignException.class)
  public void fieldsCannotBeBoundToAnInvalidTemplate() throws IOException {
    InvalidLayoutTemplate template = new InvalidLayoutTemplate();
    InputStream htmlFile =
        new FileInputStream("server/tests/src/com/vaadin/tests/design/testFile.html");

    Design.read(htmlFile, template);
  }
Пример #3
0
 public TaskOptionLayout(Task task) {
   Design.read(this);
   Responsive.makeResponsive(this);
   scheduleStartDate.setResolution(Resolution.MINUTE);
   scheduleEndDate.setResolution(Resolution.MINUTE);
   setDefaultScheduler(task);
   binder.setItemDataSource(task);
   binder.bind(scheduleStartDate, "scheduleStartDate");
   binder.bind(scheduleEndDate, "scheduleEndDate");
   binder.setBuffered(true);
 }
Пример #4
0
 @Test
 public void fieldsAreBoundToATemplate() throws IOException {
   LayoutTemplate template = new LayoutTemplate();
   InputStream htmlFile =
       new FileInputStream("server/tests/src/com/vaadin/tests/design/testFile.html");
   Design.read(htmlFile, template);
   assertNotNull(template.getFirstButton());
   assertNotNull(template.getSecondButton());
   assertNotNull(template.getYetanotherbutton());
   assertNotNull(template.getClickme());
   assertEquals("Native click me", template.getFirstButton().getCaption());
 }
 public Design() {
   com.vaadin.ui.declarative.Design.read(this);
 }
 public MatchDesign() {
   Design.read(this);
 }
Пример #7
0
 @Before
 public void setUp() throws Exception {
   ctx =
       Design.read(
           new FileInputStream("server/tests/src/com/vaadin/tests/design/testFile.html"), null);
 }
Пример #8
0
 private DesignContext deSerializeDesign(ByteArrayOutputStream out) {
   ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
   return Design.read(in, null);
 }
Пример #9
0
 public SalesOverviewDesign() {
   Design.read(this);
 }