Package com.dooapp.fxform.handler

Examples of com.dooapp.fxform.handler.TypeFieldHandler


    protected void setup() {
        MyBean joe = new MyBean("Joe", "contact@", "How does this crazy form works?", true, MyBean.Subject.QUESTION);
        new ObjectPropertyObserver(joe);
        // register a factory for the userMap field that is not handled by default
        DefaultFactoryProvider.addGlobalFactory(new TypeFieldHandler(MapProperty.class), new MapPropertyFactory());
        fxForm.setSource(joe);
        fxForm.addFilters(new ReorderFilter("name", "welcome", "email", "subject", "message"));
        fxForm.setTitle("Dude, where is my form?");
        root.getChildren().add(createNode());
    }
View Full Code Here


    private final Map<ElementHandler, Callback<Void, FXFormNode>> USER_MAP = new LinkedHashMap<ElementHandler, Callback<Void, FXFormNode>>();

    public DefaultFactoryProvider() {
        // register default delegates
        DEFAULT_MAP.put(new TypeFieldHandler(StringProperty.class), new TextFieldFactory());
        DEFAULT_MAP.put(new TypeFieldHandler(BooleanProperty.class), new CheckboxFactory());
        DEFAULT_MAP.put(new EnumHandler(), new EnumChoiceBoxFactory());
        DEFAULT_MAP.put(new TypeFieldHandler(IntegerProperty.class), new TextFieldFactory());
        DEFAULT_MAP.put(new TypeFieldHandler(LongProperty.class), new TextFieldFactory());
        DEFAULT_MAP.put(new TypeFieldHandler(DoubleProperty.class), new TextFieldFactory());
        DEFAULT_MAP.put(new TypeFieldHandler(ListProperty.class), new TableViewFactory());
        DEFAULT_MAP.put(new ElementHandler() {
            @Override
            public boolean handle(Element element) {
                return BigDecimal.class.isAssignableFrom(element.getWrappedType());
            }
        }, new TextFieldFactory());
        DEFAULT_MAP.put(new TypeFieldHandler(ReadOnlyStringProperty.class), new LabelFactory());
        DEFAULT_MAP.put(new TypeFieldHandler(ReadOnlyBooleanProperty.class), new CheckboxFactory());
        DEFAULT_MAP.put(new TypeFieldHandler(ReadOnlyIntegerProperty.class), new LabelFactory());
        DEFAULT_MAP.put(new TypeFieldHandler(ReadOnlyLongProperty.class), new LabelFactory());
        DEFAULT_MAP.put(new TypeFieldHandler(ReadOnlyDoubleProperty.class), new LabelFactory());
    }
View Full Code Here

    protected void setup() {
        MyBean joe = new MyBean("Joe", "contact@", "How does this crazy form works?", "www.dooapp.com", true, MyBean.Subject.QUESTION);
        new ObjectPropertyObserver(joe);
        // register a factory for the userMap field that is not handled by default
        DefaultFactoryProvider.addGlobalFactory(new TypeFieldHandler(MapProperty.class), new MapPropertyFactory());
        fxForm.setSource(joe);
        fxForm.addFilters(new ReorderFilter("name", "email", "website", "subject", "message"));
        fxForm.setTitle("Dude, where is my form?");
        root.getChildren().add(createNode());
    }
View Full Code Here

    private final Map<ElementHandler, Callback<Void, FXFormNode>> USER_MAP = new HashMap();

    public DefaultFactoryProvider() {
        // register default delegates
        DEFAULT_MAP.put(new TypeFieldHandler(StringProperty.class), new TextFieldFactory());
        DEFAULT_MAP.put(new TypeFieldHandler(BooleanProperty.class), new CheckboxFactory());
        DEFAULT_MAP.put(new EnumHandler(), new EnumChoiceBoxFactory());
        DEFAULT_MAP.put(new TypeFieldHandler(IntegerProperty.class), new TextFieldFactory());
        DEFAULT_MAP.put(new TypeFieldHandler(LongProperty.class), new TextFieldFactory());
        DEFAULT_MAP.put(new TypeFieldHandler(DoubleProperty.class), new TextFieldFactory());
        DEFAULT_MAP.put(new ElementHandler() {
            @Override
            public boolean handle(Element element) {
                return BigDecimal.class.isAssignableFrom(element.getWrappedType());
            }
View Full Code Here

    protected void setup() {
        MyBean joe = new MyBean("Joe", "contact@", "How does this crazy form works?", true, MyBean.Subject.QUESTION);
        new ObjectPropertyObserver(joe);
        // register a factory for the userMap field that is not handled by default
        DefaultFactoryProvider.addGlobalFactory(new TypeFieldHandler(MapProperty.class), new MapPropertyFactory());
        fxForm = new FXFormBuilder()
                .source(joe)
                .categorize("-USER-", "name", "welcome", "email", "-DATA-", "subject", "message")
                .resourceBundle(ResourceBundle.getBundle("com.dooapp.fxform.Demo"))
                .build();
View Full Code Here

    private final Map<ElementHandler, Callback<Void, FXFormNode>> USER_MAP = new LinkedHashMap<ElementHandler, Callback<Void, FXFormNode>>();

    public DefaultFactoryProvider() {
        // register default delegates
        DEFAULT_MAP.put(new TypeFieldHandler(StringProperty.class), new TextFieldFactory());
        DEFAULT_MAP.put(new TypeFieldHandler(BooleanProperty.class), new CheckboxFactory());
        DEFAULT_MAP.put(new EnumHandler(), new EnumChoiceBoxFactory());
        DEFAULT_MAP.put(new TypeFieldHandler(IntegerProperty.class), new TextFieldFactory());
        DEFAULT_MAP.put(new TypeFieldHandler(LongProperty.class), new TextFieldFactory());
        DEFAULT_MAP.put(new TypeFieldHandler(DoubleProperty.class), new TextFieldFactory());
        DEFAULT_MAP.put(new TypeFieldHandler(ListProperty.class), new TableViewFactory());
        DEFAULT_MAP.put(new WrappedTypeHandler(BigDecimal.class), new TextFieldFactory());
        DEFAULT_MAP.put(new WrappedTypeHandler(Color.class), new ColorPickerFactory());
        DEFAULT_MAP.put(new WrappedTypeHandler(LocalDate.class), new DatePickerFactory());
        DEFAULT_MAP.put(new TypeFieldHandler(ReadOnlyStringProperty.class), new LabelFactory());
        DEFAULT_MAP.put(new TypeFieldHandler(ReadOnlyBooleanProperty.class), new CheckboxFactory());
        DEFAULT_MAP.put(new TypeFieldHandler(ReadOnlyIntegerProperty.class), new LabelFactory());
        DEFAULT_MAP.put(new TypeFieldHandler(ReadOnlyLongProperty.class), new LabelFactory());
        DEFAULT_MAP.put(new TypeFieldHandler(ReadOnlyDoubleProperty.class), new LabelFactory());
    }
View Full Code Here

    private final Map<ElementHandler, Callback<Void, FXFormNode>> USER_MAP = new HashMap();

    public DefaultFactoryProvider() {
        // register default delegates
        DEFAULT_MAP.put(new TypeFieldHandler(StringProperty.class), new TextFieldFactory());
        DEFAULT_MAP.put(new TypeFieldHandler(BooleanProperty.class), new CheckboxFactory());
        DEFAULT_MAP.put(new EnumHandler(), new ChoiceBoxFactory());
        DEFAULT_MAP.put(new TypeFieldHandler(IntegerProperty.class), new TextFieldFactory());
        DEFAULT_MAP.put(new TypeFieldHandler(LongProperty.class), new TextFieldFactory());
        DEFAULT_MAP.put(new TypeFieldHandler(DoubleProperty.class), new TextFieldFactory());
    }
View Full Code Here

TOP

Related Classes of com.dooapp.fxform.handler.TypeFieldHandler

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.