Examples of FXForm


Examples of com.dooapp.fxform.FXForm

    validator = new DefaultFXFormValidator();
  }

  @Test
  public void testThatBean1ValidationIsOk() {
    FXForm fxForm = new FXForm();
    Bean1 bean1 = new Bean1();
    fxForm.setSource(bean1);
    Assert.assertEquals(0, validator.validate(fxForm.getElements().get(0), "").size());
    Bean2 bean2 = new Bean2();
    fxForm.setSource(bean2);
    Assert.assertEquals(1, validator.validate(fxForm.getElements().get(0), "").size());
  }
View Full Code Here

Examples of com.dooapp.fxform.FXForm

  }

  @Test
  public void testThatReorderWorksWellWithSpecificFieldFilter() throws FilterException {
    Bean2 bean2 = new Bean2();
    FXForm fxForm = new FXFormBuilder().include("name", MyAddress.class.getName() + "-address").build
        ();
    fxForm.setSource(new MultipleBeanSource(bean2, bean2.getAddress()));
    ReorderFilter reorderFilter = new ReorderFilter("name", MyAddress.class.getName() + "-address");
    reorderFilter.filter(fxForm.getElements());
  }
View Full Code Here

Examples of com.dooapp.fxform.FXForm

*/
public class Issue6Test {

    @Test
    public void testIssue6() {
        FXForm readOnlyFXForm = new ReadOnlyFXForm();
        readOnlyFXForm.setSource(null);
        readOnlyFXForm.setSource(new TestBean());
        readOnlyFXForm.setSource(null);
        readOnlyFXForm.setSource(new TestBean());
    }
View Full Code Here

Examples of com.dooapp.fxform.FXForm

    @Override
    public Node getPanel(Stage stage) {
        Pane root = new Pane();

        FXForm form = new FXFormBuilder<>().include("lastName", "firstName", "age").resourceBundle(Utils.SAMPLE).build();
        form.setSkin(new com.dooapp.fxform.view.skin.FXMLSkin(form, getClass().getResource("/fxmlSkin.fxml")));
        User user = new User();
        form.setSource(user);
        root.getChildren().add(form);
        return root;
    }
View Full Code Here

Examples of com.dooapp.fxform.FXForm

        }
    }

    @Test
    public void testIssue25() {
        FXForm fxForm = new FXForm();
        Bean bean = new Bean();
        bean.setContent(new Content());
        fxForm.setSource(bean);
        Assert.assertTrue(bean.getContent() instanceof Content);
    }
View Full Code Here

Examples of com.dooapp.fxform.FXForm

        bp.setStyle("-fx-padding: 10;");
        choiceBox.getItems().addAll("Inline skin", "Default skin");
        bp.setTop(choiceBox);
        title.setFont(Font.font(24));

        FXForm form = new FXFormBuilder<>()
                .includeAndReorder("firstName", "lastName", "age", "favoriteMovie", "coolDeveloper")
                .resourceBundle(Utils.SAMPLE)
                .build();
        form.setSource(user);
        box.getChildren().addAll(title, form);
        choiceBox.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<String>() {
            @Override
            public void changed(ObservableValue<? extends String> observableValue, String s, String s2) {
                if (s2.equals("Inline skin")) {
                    title.setText("Inline skin");
                    form.setSkin(new InlineSkin(form));
                } else {
                    title.setText("Default skin");
                    form.setSkin(new DefaultSkin(form));
                }
            }
        });
        bp.setCenter(box);
        choiceBox.getSelectionModel().selectFirst();
View Full Code Here

Examples of com.dooapp.fxform.FXForm

    @Override
    public Node getPanel(Stage stage) {
        Pane root = new Pane();

        FXForm form = new FXFormBuilder<>()
                .includeAndReorder("firstName", "lastName", "age", "favoriteMovie", "coolDeveloper", "street", "city", "zip")
                .resourceBundle(Utils.SAMPLE)
                .build();
        User user = new User();
        form.setSource(new MultipleBeanSource(user, user.address.get()));

        root.getChildren().add(form);
        return root;
    }
View Full Code Here

Examples of com.dooapp.fxform.FXForm

    }

    @Test
    public void testIssue23() {
        Bean bean = new Bean();
        FXForm fxForm = new FXForm();
        fxForm.setSource(bean);
        Assert.assertNotNull(bean.getTest());
    }
View Full Code Here

Examples of com.dooapp.fxform.FXForm

    }

    @Override
    public Node getPanel(Stage stage) {
        Pane root = new Pane();
        FXForm form = new FXFormBuilder<>()
                .includeAndReorder("firstName", "lastName", "age", "favoriteMovie")
                .resourceBundle(Utils.SAMPLE)
                .readOnly(true)
                .build();

        User user = new User();
        user.firstName.set("Robert");
        user.lastName.set("Shepard");
        user.age.setValue(42);
        user.favoriteMovie.setValue(Movies.LOTR);
        form.setSource(user);

        root.getChildren().add(form);
        return root;
    }
View Full Code Here

Examples of com.dooapp.fxform.FXForm

    }

    @Override
    public Node getPanel(Stage stage) {
        Pane root = new Pane();
        FXForm form = new FXFormBuilder<>().includeAndReorder("firstName", "lastName", "age").resourceBundle(Utils.SAMPLE).build();
        UserWithCustomFactory userWithCustomFactory = new UserWithCustomFactory();
        form.setSource(userWithCustomFactory);
        root.getChildren().add(form);
        return root;
    }
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.