├── .github └── workflows │ └── maven.yml ├── .gitignore ├── .travis.yml ├── README.md ├── core ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── dooapp │ │ │ └── fxform │ │ │ ├── AbstractFXForm.java │ │ │ ├── FXForm.java │ │ │ ├── ReadOnlyFXForm.java │ │ │ ├── adapter │ │ │ ├── Adapter.java │ │ │ ├── AdapterException.java │ │ │ ├── AdapterMatcher.java │ │ │ ├── AdapterProvider.java │ │ │ ├── AnnotationAdapterProvider.java │ │ │ ├── ConverterWrapper.java │ │ │ ├── DefaultAdapter.java │ │ │ ├── DefaultAdapterMatcher.java │ │ │ ├── DefaultAdapterProvider.java │ │ │ ├── FloatToDoubleAdapter.java │ │ │ ├── FormAdapter.java │ │ │ ├── IntegerToDoubleAdapter.java │ │ │ ├── ObjectPropertyAdapterMatcher.java │ │ │ ├── PropertyTypeMatcher.java │ │ │ ├── ToStringConverter.java │ │ │ └── TypeAdapterMatcher.java │ │ │ ├── annotation │ │ │ ├── Accessor.java │ │ │ ├── FormFactory.java │ │ │ └── NonVisual.java │ │ │ ├── builder │ │ │ └── FXFormBuilder.java │ │ │ ├── controller │ │ │ ├── ConstraintController.java │ │ │ ├── ElementController.java │ │ │ ├── LabelController.java │ │ │ ├── NodeController.java │ │ │ ├── PropertyEditorController.java │ │ │ ├── PropertyElementController.java │ │ │ └── ReadOnlyPropertyEditorController.java │ │ │ ├── filter │ │ │ ├── AbstractNameFilter.java │ │ │ ├── CategorizeFilter.java │ │ │ ├── ElementListFilter.java │ │ │ ├── ExcludeFilter.java │ │ │ ├── FilterException.java │ │ │ ├── IncludeFilter.java │ │ │ ├── NonVisualFilter.java │ │ │ ├── ReorderFilter.java │ │ │ └── field │ │ │ │ ├── ExcludeFieldFilter.java │ │ │ │ ├── FieldFilter.java │ │ │ │ ├── IncludeFieldFilter.java │ │ │ │ ├── NonVisualFieldFilter.java │ │ │ │ ├── PrivateFinalStaticFilter.java │ │ │ │ └── SyntheticFieldFilter.java │ │ │ ├── handler │ │ │ ├── AbstractWrappedTypeHandler.java │ │ │ ├── ElementHandler.java │ │ │ ├── EnumHandler.java │ │ │ ├── InterfaceWrappedTypeHandler.java │ │ │ ├── NamedFieldHandler.java │ │ │ ├── TypeFieldHandler.java │ │ │ └── WrappedTypeHandler.java │ │ │ ├── model │ │ │ ├── BufferedElementFactory.java │ │ │ ├── Category.java │ │ │ ├── DefaultElementFactory.java │ │ │ ├── DefaultElementProvider.java │ │ │ ├── Element.java │ │ │ ├── ElementFactory.java │ │ │ ├── ElementProvider.java │ │ │ ├── FormException.java │ │ │ ├── JavaBeanElementFactory.java │ │ │ ├── PropertyElement.java │ │ │ ├── PropertyElementFactory.java │ │ │ └── impl │ │ │ │ ├── AbstractFieldElement.java │ │ │ │ ├── AbstractSourceElement.java │ │ │ │ ├── BufferedElement.java │ │ │ │ ├── BufferedPropertyElement.java │ │ │ │ ├── PropertyFieldElement.java │ │ │ │ ├── PropertyMethodElement.java │ │ │ │ ├── ReadOnlyPropertyFieldElement.java │ │ │ │ ├── ReadOnlyPropertyMethodElement.java │ │ │ │ ├── SourceListBinding.java │ │ │ │ ├── SourceMapBinding.java │ │ │ │ ├── SourceObjectBinding.java │ │ │ │ └── java │ │ │ │ ├── AbstractJavaBeanElement.java │ │ │ │ ├── JavaBeanBooleanPropertyElement.java │ │ │ │ ├── JavaBeanDoublePropertyElement.java │ │ │ │ ├── JavaBeanFloatPropertyElement.java │ │ │ │ ├── JavaBeanIntegerPropertyElement.java │ │ │ │ ├── JavaBeanLongPropertyElement.java │ │ │ │ ├── JavaBeanObjectPropertyElement.java │ │ │ │ └── JavaBeanStringPropertyElement.java │ │ │ ├── reflection │ │ │ ├── FieldProvider.java │ │ │ ├── MultipleBeanSource.java │ │ │ ├── ReflectionUtils.java │ │ │ └── impl │ │ │ │ ├── CacheReflectionFieldProvider.java │ │ │ │ ├── MultipleSourceFieldProvider.java │ │ │ │ └── ReflectionFieldProvider.java │ │ │ ├── resource │ │ │ ├── DefaultResourceProvider.java │ │ │ └── ResourceProvider.java │ │ │ ├── utils │ │ │ ├── AnnotationLoader.java │ │ │ ├── Disposable.java │ │ │ ├── ObjectUtils.java │ │ │ └── ValueAnnotation.java │ │ │ ├── validation │ │ │ ├── ClassLevelValidator.java │ │ │ ├── DefaultFXFormValidator.java │ │ │ ├── FXFormValidator.java │ │ │ ├── NotAdaptableConstraintDescriptor.java │ │ │ ├── NotAdaptableInputValue.java │ │ │ ├── PropertyElementValidator.java │ │ │ └── Warning.java │ │ │ └── view │ │ │ ├── DisposableNode.java │ │ │ ├── FXFormNode.java │ │ │ ├── FXFormNodeWrapper.java │ │ │ ├── FXFormSkin.java │ │ │ ├── FXFormSkinFactory.java │ │ │ ├── NodeCreationException.java │ │ │ ├── NodeType.java │ │ │ ├── control │ │ │ ├── AutoHidableLabel.java │ │ │ ├── ConstraintLabel.java │ │ │ └── map │ │ │ │ ├── MapEditorControl.java │ │ │ │ ├── MapElementProvider.java │ │ │ │ ├── MapEntryElement.java │ │ │ │ └── MapEntryPropertyElement.java │ │ │ ├── factory │ │ │ ├── AnnotationFactoryProvider.java │ │ │ ├── DefaultFactoryProvider.java │ │ │ ├── DefaultLabelFactoryProvider.java │ │ │ ├── DefaultTooltipFactoryProvider.java │ │ │ ├── DisableFactoryProviderWrapper.java │ │ │ ├── FactoryProvider.java │ │ │ └── impl │ │ │ │ ├── AutoHidableLabelFactory.java │ │ │ │ ├── CheckboxFactory.java │ │ │ │ ├── ColorPickerFactory.java │ │ │ │ ├── ConfirmationEnumChoiceBox.java │ │ │ │ ├── DatePickerFactory.java │ │ │ │ ├── DefaultConstraintFactory.java │ │ │ │ ├── EnumChoiceBoxFactory.java │ │ │ │ ├── FXFormChoiceBoxNode.java │ │ │ │ ├── FXFormTableView.java │ │ │ │ ├── LabelFactory.java │ │ │ │ ├── ListChoiceBoxFactory.java │ │ │ │ ├── MapEditorControlFactory.java │ │ │ │ ├── PaginatedTableView.java │ │ │ │ ├── PaginatedTableViewFactory.java │ │ │ │ ├── ParseErrorConstraintViolation.java │ │ │ │ ├── PasswordFieldFactory.java │ │ │ │ ├── SubClassFactory.java │ │ │ │ ├── TableViewFactory.java │ │ │ │ ├── TextAreaFactory.java │ │ │ │ ├── TextFactory.java │ │ │ │ └── TextFieldFactory.java │ │ │ ├── property │ │ │ ├── ChoiceBoxDefaultProperty.java │ │ │ ├── ComboBoxDefaultProperty.java │ │ │ ├── DefaultPropertyProvider.java │ │ │ ├── PropertyProvider.java │ │ │ └── TableViewProperty.java │ │ │ └── skin │ │ │ ├── DefaultSkin.java │ │ │ ├── FXMLSkin.java │ │ │ ├── InlineSkin.java │ │ │ └── NodeSkin.java │ └── resources │ │ └── com │ │ └── dooapp │ │ └── fxform │ │ └── view │ │ └── control │ │ └── warning.png │ ├── site │ └── site.xml │ └── test │ ├── java │ └── com │ │ └── dooapp │ │ └── fxform │ │ ├── FXFormTest.java │ │ ├── FailOnUncaughtExceptionRule.java │ │ ├── JavaFXRule.java │ │ ├── TestBean.java │ │ ├── TestEnum.java │ │ ├── TestUtils.java │ │ ├── filter │ │ ├── AbstractFilterTest.java │ │ ├── ExcludeFilterTest.java │ │ ├── IncludeFilterTest.java │ │ ├── NonVisualFilterTest.java │ │ └── ReorderFilterTest.java │ │ ├── handler │ │ ├── EnumHandlerTest.java │ │ ├── NamedFieldHandlerTest.java │ │ └── TypeFieldHandlerTest.java │ │ ├── issues │ │ ├── Issue101Test.java │ │ ├── Issue103Test.java │ │ ├── Issue112Test.java │ │ ├── Issue115Test.java │ │ ├── Issue116Test.java │ │ ├── Issue126Test.java │ │ ├── Issue127Test.java │ │ ├── Issue131Test.java │ │ ├── Issue135Test.java │ │ ├── Issue144Test.java │ │ ├── Issue149Test.java │ │ ├── Issue150Test.java │ │ ├── Issue156Test.java │ │ ├── Issue161Test.java │ │ ├── Issue162Test.java │ │ ├── Issue167Test.java │ │ ├── Issue170Test.java │ │ ├── Issue171Test.java │ │ ├── Issue178Test.java │ │ ├── Issue186Test.java │ │ ├── Issue195Test.java │ │ ├── Issue197Test.java │ │ ├── Issue198Test.java │ │ ├── Issue206Test.java │ │ ├── Issue207Test.java │ │ ├── Issue208Test.java │ │ ├── Issue23Test.java │ │ ├── Issue25Test.java │ │ ├── Issue34Test.java │ │ ├── Issue54Test.java │ │ ├── Issue56Test.java │ │ ├── Issue59Test.java │ │ ├── Issue61Test.java │ │ ├── Issue6Test.java │ │ ├── Issue7Test.java │ │ ├── Issue81Test.java │ │ ├── Issue82Test.java │ │ ├── Issue89Test.java │ │ ├── Issue8Test.java │ │ ├── Issue95Test.java │ │ ├── Issue96Test.java │ │ ├── Issue97Test.java │ │ ├── MemoryLeakTest.java │ │ ├── issue142 │ │ │ ├── Issue142Bean.java │ │ │ ├── Issue142CustomControl.java │ │ │ └── Issue142Test.java │ │ └── issue154 │ │ │ ├── Issue154ControlList.java │ │ │ ├── Issue154ControlMap.java │ │ │ └── Issue154Test.java │ │ ├── model │ │ ├── BufferedElementFactoryTest.java │ │ ├── PropertyElementFactoryTest.java │ │ └── impl │ │ │ ├── BufferedPropertyElementTest.java │ │ │ └── PropertyMethodElementTest.java │ │ ├── reflection │ │ ├── MultipleBeanSourceTest.java │ │ ├── UtilTest.java │ │ ├── classcast │ │ │ ├── ClassCastTest.java │ │ │ ├── Device.java │ │ │ ├── DeviceModel.java │ │ │ └── SuperDevice.java │ │ └── impl │ │ │ └── ReflectionFieldProviderTest.java │ │ └── utils │ │ └── ObjectUtilsTest.java │ └── resources │ ├── Issue115Test.properties │ ├── Issue144Test.properties │ ├── Issue56Test.properties │ ├── Issue56Test2.properties │ ├── issue116.fxml │ └── issues │ ├── issue142 │ └── issue142.fxml │ ├── issue154 │ └── issue154.fxml │ └── issue170 │ ├── issue170.fxml │ └── issue170_no_scrollpane.fxml ├── demo ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── dooapp │ │ │ └── fxform │ │ │ ├── BigDecimalAdapter.java │ │ │ ├── Demo.java │ │ │ ├── DemoFormController.java │ │ │ ├── MyBean.java │ │ │ ├── ObjectPropertyObserver.java │ │ │ ├── TableBean.java │ │ │ ├── map │ │ │ ├── MapPropertyControl.java │ │ │ ├── MapPropertyFactory.java │ │ │ └── MapPropertySkin.java │ │ │ └── validation │ │ │ ├── ColorAndDate.java │ │ │ ├── ColorAndDateValidator.java │ │ │ ├── PasswordMatch.java │ │ │ └── PasswordMatchValidator.java │ └── resources │ │ ├── ValidationMessages.properties │ │ └── com │ │ └── dooapp │ │ └── fxform │ │ ├── Demo.properties │ │ ├── Demo_form.fxml │ │ ├── Demo_fr.properties │ │ ├── lined_paper.png │ │ ├── material-fx-v0.3.css │ │ └── style.css │ └── site │ └── site.xml ├── extensions ├── pom.xml └── src │ └── main │ └── java │ └── com │ └── dooapp │ └── fxform2 │ └── extensions │ ├── Address.java │ ├── AddressFactory.java │ ├── AddressField.java │ ├── AddressSuggestionProvider.java │ ├── AlgoliaAddressSuggestionProvider.java │ └── AutoCompleteAddress.java ├── pom.xml ├── samples ├── FXForm2 Sampler.jpg ├── README.md ├── pom.xml └── src │ └── main │ ├── java │ └── com │ │ └── dooapp │ │ └── fxform │ │ ├── FXFormSample.java │ │ ├── FXFormSampler.java │ │ ├── Utils.java │ │ ├── model │ │ └── Movies.java │ │ └── samples │ │ ├── CategorizedForm.java │ │ ├── CustomFactoryForm.java │ │ ├── CuteCssForm.java │ │ ├── DifferentSkinForm.java │ │ ├── DynamicFilteredForm.java │ │ ├── EnableDisableForm.java │ │ ├── FXMLSkin.java │ │ ├── ListPropertyForm.java │ │ ├── MultiBeanForm.java │ │ ├── ReadOnlyForm.java │ │ ├── SimpleForm.java │ │ └── ValidationForm.java │ └── resources │ ├── META-INF │ └── services │ │ └── fxsampler.FXSamplerProject │ ├── form.css │ ├── fxformSampler.properties │ ├── fxmlSkin.fxml │ ├── list.css │ └── sample.properties └── src └── site └── site.xml /.github/workflows/maven.yml: -------------------------------------------------------------------------------- 1 | # This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time 2 | # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven 3 | 4 | # This workflow uses actions that are not certified by GitHub. 5 | # They are provided by a third-party and are governed by 6 | # separate terms of service, privacy policy, and support 7 | # documentation. 8 | 9 | name: Java CI with Maven 10 | 11 | on: 12 | push: 13 | branches: [ "master" ] 14 | pull_request: 15 | branches: [ "master" ] 16 | 17 | jobs: 18 | build: 19 | 20 | runs-on: ubuntu-latest 21 | 22 | steps: 23 | - uses: actions/checkout@v3 24 | - name: Set up JDK 17 25 | uses: actions/setup-java@v3 26 | with: 27 | java-version: '17' 28 | distribution: 'temurin' 29 | cache: maven 30 | - name: Build with Maven 31 | run: xvfb-run mvn -B package --file pom.xml 32 | 33 | # Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive 34 | # - name: Update dependency graph 35 | # uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6 36 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | target 3 | target/* 4 | target/** 5 | *.ipr 6 | *.iws 7 | .idea 8 | *.iml 9 | *.pydevproject 10 | .project 11 | .metadata 12 | bin/** 13 | tmp/** 14 | tmp/**/* 15 | *.tmp 16 | *.bak 17 | *.swp 18 | *~.nib 19 | local.properties 20 | .classpath 21 | .settings/ 22 | .loadpath 23 | nbproject/ 24 | nbactions.xml 25 | .DS_Store 26 | Icon? 27 | 28 | # Thumbnails 29 | ._* 30 | 31 | # Files that might appear on external disk 32 | .Spotlight-V100 33 | .Trashes -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: java 2 | jdk: 3 | - openjdk8 4 | services: 5 | - xvfb 6 | before_install: 7 | - sudo apt update 8 | - sudo apt install openjfx 9 | sudo: false 10 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/adapter/Adapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, dooApp 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | * Neither the name of dooApp nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | */ 12 | 13 | package com.dooapp.fxform.adapter; 14 | 15 | /** 16 | * Created at 27/09/12 10:57.
17 | * 18 | * @author Antoine Mischler 19 | */ 20 | public interface Adapter { 21 | 22 | public V adaptTo(T from) throws AdapterException; 23 | 24 | public T adaptFrom(V to) throws AdapterException; 25 | 26 | } 27 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/adapter/AdapterException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, dooApp 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | * Neither the name of dooApp nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | */ 12 | 13 | package com.dooapp.fxform.adapter; 14 | 15 | /** 16 | * User: Antoine Mischler 17 | * Date: 21/11/2013 18 | * Time: 14:44 19 | */ 20 | public class AdapterException extends Exception { 21 | 22 | public AdapterException(Throwable cause) { 23 | super(cause); 24 | } 25 | 26 | public AdapterException(String message) { 27 | super(message); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/adapter/AdapterMatcher.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, dooApp 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | * Neither the name of dooApp nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | */ 12 | 13 | package com.dooapp.fxform.adapter; 14 | 15 | import com.dooapp.fxform.model.Element; 16 | import com.dooapp.fxform.view.FXFormNode; 17 | 18 | /** 19 | * User: Antoine Mischler 20 | * Date: 29/09/12 21 | * Time: 18:54 22 | */ 23 | public interface AdapterMatcher { 24 | 25 | public boolean matches(Class fromClass, Class toClass, Element element, FXFormNode fxFormNode); 26 | 27 | } 28 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/adapter/AdapterProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, dooApp 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | * Neither the name of dooApp nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | */ 12 | 13 | package com.dooapp.fxform.adapter; 14 | 15 | import com.dooapp.fxform.model.Element; 16 | import com.dooapp.fxform.view.FXFormNode; 17 | 18 | /** 19 | * User: Antoine Mischler 20 | * Date: 29/09/12 21 | * Time: 17:30 22 | */ 23 | public interface AdapterProvider { 24 | 25 | /** 26 | * Provide the adapter from fromClass to toClass for the given element and node. 27 | * 28 | * @param fromClass 29 | * @param toClass 30 | * @param element 31 | * @param fxFormNode 32 | * @return 33 | */ 34 | Adapter getAdapter(Class fromClass, Class toClass, Element element, FXFormNode fxFormNode); 35 | 36 | } 37 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/adapter/ConverterWrapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, dooApp 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | * Neither the name of dooApp nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | */ 12 | 13 | package com.dooapp.fxform.adapter; 14 | 15 | import javafx.util.StringConverter; 16 | 17 | /** 18 | * User: Antoine Mischler 19 | * Date: 29/09/12 20 | * Time: 19:03 21 | */ 22 | public class ConverterWrapper implements Adapter { 23 | 24 | private final StringConverter converter; 25 | 26 | public ConverterWrapper(StringConverter converter) { 27 | this.converter = converter; 28 | } 29 | 30 | @Override 31 | public String adaptTo(T from) { 32 | return converter.toString(from); 33 | } 34 | 35 | @Override 36 | public T adaptFrom(String to) { 37 | return (T) converter.fromString(to); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/adapter/DefaultAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, dooApp 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | * Neither the name of dooApp nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | */ 12 | 13 | package com.dooapp.fxform.adapter; 14 | 15 | /** 16 | * Created at 27/09/12 11:08.
17 | * 18 | * @author Antoine Mischler 19 | */ 20 | public class DefaultAdapter implements Adapter { 21 | 22 | public Object adaptTo(Object from) { 23 | return from; 24 | } 25 | 26 | public Object adaptFrom(Object to) { 27 | return to; 28 | } 29 | } -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/adapter/DefaultAdapterMatcher.java: -------------------------------------------------------------------------------- 1 | package com.dooapp.fxform.adapter; 2 | 3 | import com.dooapp.fxform.model.Element; 4 | import com.dooapp.fxform.view.FXFormNode; 5 | 6 | public class DefaultAdapterMatcher implements AdapterMatcher { 7 | 8 | @Override 9 | public boolean matches(Class fromClass, Class toClass, Element element, FXFormNode fxFormNode) { 10 | return fromClass.isAssignableFrom(toClass); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/adapter/FloatToDoubleAdapter.java: -------------------------------------------------------------------------------- 1 | package com.dooapp.fxform.adapter; 2 | 3 | public class FloatToDoubleAdapter implements Adapter { 4 | 5 | @Override 6 | public Double adaptTo(Float from) { 7 | return from.doubleValue(); 8 | } 9 | 10 | @Override 11 | public Float adaptFrom(Double to) { 12 | return to.floatValue(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/adapter/FormAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, dooApp 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | * Neither the name of dooApp nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | */ 12 | 13 | package com.dooapp.fxform.adapter; 14 | 15 | import java.lang.annotation.Inherited; 16 | import java.lang.annotation.Retention; 17 | import java.lang.annotation.RetentionPolicy; 18 | 19 | /** 20 | * Annotation used to specify a specific factory for a field. 21 | *

22 | * User: Antoine Mischler 23 | * Date: 26/11/2013 24 | * Time: 11:03 25 | */ 26 | @Inherited 27 | @Retention(RetentionPolicy.RUNTIME) 28 | public @interface FormAdapter { 29 | 30 | Class value(); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/adapter/IntegerToDoubleAdapter.java: -------------------------------------------------------------------------------- 1 | package com.dooapp.fxform.adapter; 2 | 3 | public class IntegerToDoubleAdapter implements Adapter { 4 | 5 | @Override 6 | public Double adaptTo(Integer from) { 7 | return from.doubleValue(); 8 | } 9 | 10 | @Override 11 | public Integer adaptFrom(Double to) { 12 | return to.intValue(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/annotation/Accessor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, dooApp 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | * Neither the name of dooApp nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | */ 12 | 13 | package com.dooapp.fxform.annotation; 14 | 15 | import java.lang.annotation.*; 16 | 17 | /** 18 | * Annotation used to specify whether the properties in this class should be accessed directly through the field or 19 | * through the property getter. 20 | *

21 | * User: Antoine Mischler 22 | * Date: 16/10/13 23 | * Time: 14:34 24 | */ 25 | @Inherited 26 | @Retention(RetentionPolicy.RUNTIME) 27 | @Target(ElementType.TYPE) 28 | public @interface Accessor { 29 | public enum AccessType {FIELD, METHOD} 30 | 31 | AccessType value() default AccessType.FIELD; 32 | 33 | } 34 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/annotation/FormFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, dooApp 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | * Neither the name of dooApp nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | */ 12 | 13 | package com.dooapp.fxform.annotation; 14 | 15 | import com.dooapp.fxform.view.FXFormNode; 16 | import javafx.util.Callback; 17 | 18 | import java.lang.annotation.*; 19 | 20 | /** 21 | * Annotation used to specify a NodeFactory to use for a specific field or type. 22 | *

23 | * User: Antoine Mischler 24 | * Date: 26/08/11 25 | * Time: 16:32 26 | */ 27 | @Inherited 28 | @Retention(RetentionPolicy.RUNTIME) 29 | @Target({ElementType.FIELD, ElementType.METHOD}) 30 | public @interface FormFactory { 31 | 32 | Class> value(); 33 | 34 | } 35 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/annotation/NonVisual.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, dooApp 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | * Neither the name of dooApp nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | */ 12 | 13 | package com.dooapp.fxform.annotation; 14 | 15 | import java.lang.annotation.*; 16 | 17 | /** 18 | * User: Antoine Mischler 19 | * Date: 02/06/11 20 | * Time: 17:19 21 | *

22 | * Annotation describing members that shouldn't be included in the form. 23 | */ 24 | @Inherited 25 | @Retention(RetentionPolicy.RUNTIME) 26 | @Target({ElementType.FIELD, ElementType.METHOD}) 27 | public @interface NonVisual { 28 | } 29 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/filter/NonVisualFilter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, dooApp 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | * Neither the name of dooApp nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | */ 12 | package com.dooapp.fxform.filter; 13 | 14 | import com.dooapp.fxform.annotation.NonVisual; 15 | import com.dooapp.fxform.model.Element; 16 | 17 | import java.util.ArrayList; 18 | import java.util.List; 19 | 20 | /** 21 | * User: Antoine Mischler 22 | * Date: 01/09/11 23 | * Time: 17:12 24 | */ 25 | public class NonVisualFilter implements ElementListFilter { 26 | 27 | public List filter(List toFilter) { 28 | List filtered = new ArrayList(); 29 | for (Element field : toFilter) { 30 | if (field.getAnnotation(NonVisual.class) == null) { 31 | filtered.add(field); 32 | } 33 | } 34 | return filtered; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/filter/field/ExcludeFieldFilter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, dooApp 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | * Neither the name of dooApp nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | */ 12 | 13 | package com.dooapp.fxform.filter.field; 14 | 15 | import java.lang.reflect.Field; 16 | import java.util.Arrays; 17 | import java.util.List; 18 | 19 | /** 20 | * User: Antoine Mischler 21 | * Date: 16/12/2013 22 | * Time: 11:45 23 | */ 24 | public class ExcludeFieldFilter implements FieldFilter { 25 | 26 | private final List names; 27 | 28 | public ExcludeFieldFilter(String[] names) { 29 | this.names = Arrays.asList(names); 30 | } 31 | 32 | @Override 33 | public boolean accept(Field field) { 34 | return !names.contains(field.getName()); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/filter/field/FieldFilter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, dooApp 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | * Neither the name of dooApp nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | */ 12 | 13 | package com.dooapp.fxform.filter.field; 14 | 15 | import java.lang.reflect.Field; 16 | 17 | /** 18 | * Field filters are low level filters used at the field extraction level. 19 | * If you need high level filters that require to work on the whole list of elements used in the form, 20 | * see {@link com.dooapp.fxform.filter.ElementListFilter}. 21 | *

22 | * User: Antoine Mischler 23 | * Date: 16/12/2013 24 | * Time: 11:38 25 | */ 26 | public interface FieldFilter { 27 | 28 | /** 29 | * This method should return true if the given field is accepted, false if the field should be excluded. 30 | * 31 | * @return 32 | */ 33 | public boolean accept(Field field); 34 | 35 | } 36 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/filter/field/IncludeFieldFilter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, dooApp 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | * Neither the name of dooApp nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | */ 12 | 13 | package com.dooapp.fxform.filter.field; 14 | 15 | import java.lang.reflect.Field; 16 | import java.util.Arrays; 17 | import java.util.List; 18 | 19 | /** 20 | * User: Antoine Mischler 21 | * Date: 16/12/2013 22 | * Time: 11:44 23 | */ 24 | public class IncludeFieldFilter implements FieldFilter { 25 | 26 | private final List names; 27 | 28 | public IncludeFieldFilter(String[] names) { 29 | this.names = Arrays.asList(names); 30 | } 31 | 32 | @Override 33 | public boolean accept(Field field) { 34 | return names.contains(field.getName()); 35 | } 36 | 37 | public List getNames() { 38 | return names; 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/filter/field/NonVisualFieldFilter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, dooApp 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | * Neither the name of dooApp nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | */ 12 | 13 | package com.dooapp.fxform.filter.field; 14 | 15 | import com.dooapp.fxform.annotation.NonVisual; 16 | 17 | import java.lang.reflect.Field; 18 | 19 | /** 20 | * User: Antoine Mischler 21 | * Date: 16/12/2013 22 | * Time: 11:48 23 | */ 24 | public class NonVisualFieldFilter implements FieldFilter { 25 | 26 | @Override 27 | public boolean accept(Field field) { 28 | return field.getAnnotation(NonVisual.class) == null; 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/filter/field/PrivateFinalStaticFilter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, dooApp 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | * Neither the name of dooApp nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | */ 12 | 13 | package com.dooapp.fxform.filter.field; 14 | 15 | import java.lang.reflect.Field; 16 | import java.lang.reflect.Modifier; 17 | 18 | /** 19 | * User: Antoine Mischler 20 | * Date: 16/12/2013 21 | * Time: 14:40 22 | */ 23 | public class PrivateFinalStaticFilter implements FieldFilter { 24 | 25 | @Override 26 | public boolean accept(Field field) { 27 | return !(Modifier.isFinal(field.getModifiers()) && 28 | Modifier.isPrivate(field.getModifiers()) && 29 | Modifier.isStatic(field.getModifiers())); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/filter/field/SyntheticFieldFilter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, dooApp 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | * Neither the name of dooApp nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | */ 12 | 13 | package com.dooapp.fxform.filter.field; 14 | 15 | import java.lang.reflect.Field; 16 | 17 | /** 18 | * User: Antoine Mischler 19 | * Date: 16/12/2013 20 | * Time: 14:40 21 | */ 22 | public class SyntheticFieldFilter implements FieldFilter { 23 | 24 | @Override 25 | public boolean accept(Field field) { 26 | return !field.isSynthetic(); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/handler/AbstractWrappedTypeHandler.java: -------------------------------------------------------------------------------- 1 | package com.dooapp.fxform.handler; 2 | 3 | import com.dooapp.fxform.model.Element; 4 | 5 | import java.lang.reflect.Modifier; 6 | 7 | /** 8 | * A field handler used to match a field which wrapped type is abstract. 9 | * User: Kevin Senechal 10 | * Date: 12/08/2015 11 | * Time: 11:00 12 | */ 13 | public class AbstractWrappedTypeHandler implements ElementHandler { 14 | @Override 15 | public boolean handle(Element element) { 16 | return Modifier.isAbstract(element.getWrappedType().getModifiers()); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/handler/ElementHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, dooApp 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | * Neither the name of dooApp nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | */ 12 | 13 | package com.dooapp.fxform.handler; 14 | 15 | import com.dooapp.fxform.model.Element; 16 | 17 | /** 18 | * Created at 28/09/12 10:10.
19 | * 20 | * @author Antoine Mischler 21 | */ 22 | public interface ElementHandler { 23 | 24 | public boolean handle(T element); 25 | 26 | } 27 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/handler/EnumHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, dooApp 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | * Neither the name of dooApp nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | */ 12 | 13 | package com.dooapp.fxform.handler; 14 | 15 | import com.dooapp.fxform.model.Element; 16 | 17 | /** 18 | * User: Antoine Mischler 19 | * Date: 09/09/11 20 | * Time: 14:50 21 | */ 22 | public class EnumHandler implements ElementHandler { 23 | 24 | public boolean handle(Element element) { 25 | try { 26 | return element.getWrappedType().isEnum(); 27 | } catch (Exception e) { 28 | } 29 | return false; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/handler/InterfaceWrappedTypeHandler.java: -------------------------------------------------------------------------------- 1 | package com.dooapp.fxform.handler; 2 | 3 | import com.dooapp.fxform.model.Element; 4 | 5 | /** 6 | * A field handler used to match a field which wrapped type is an interface. 7 | * User: Kevin Senechal 8 | * Date: 12/08/2015 9 | * Time: 11:00 10 | */ 11 | public class InterfaceWrappedTypeHandler implements ElementHandler { 12 | @Override 13 | public boolean handle(Element element) { 14 | return element.getWrappedType().isInterface(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/handler/NamedFieldHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, dooApp 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | * Neither the name of dooApp nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | */ 12 | package com.dooapp.fxform.handler; 13 | 14 | import com.dooapp.fxform.model.Element; 15 | 16 | /** 17 | * A field handler used to match a field according to his name. 18 | * User: Antoine Mischler 19 | * Date: 25/08/11 20 | * Time: 17:38 21 | */ 22 | public class NamedFieldHandler implements ElementHandler { 23 | 24 | private final String name; 25 | 26 | public NamedFieldHandler(String name) { 27 | this.name = name; 28 | } 29 | 30 | public boolean handle(Element element) { 31 | String fullName = element.getDeclaringClass().getName() + "-" + element.getName(); 32 | return name.equals(fullName) || name.equals(element.getName()); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/handler/TypeFieldHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, dooApp 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | * Neither the name of dooApp nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | */ 12 | 13 | package com.dooapp.fxform.handler; 14 | 15 | import com.dooapp.fxform.model.Element; 16 | 17 | /** 18 | * User: Antoine Mischler 19 | * Date: 16/04/11 20 | * Time: 23:38 21 | *

22 | * Handler matching for a given field type. 23 | */ 24 | public class TypeFieldHandler implements ElementHandler { 25 | 26 | private final Class clazz; 27 | 28 | public TypeFieldHandler(Class clazz) { 29 | this.clazz = clazz; 30 | } 31 | 32 | public boolean handle(Element element) { 33 | return clazz.isAssignableFrom(element.getType()); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/handler/WrappedTypeHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, dooApp 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | * Neither the name of dooApp nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | */ 12 | 13 | package com.dooapp.fxform.handler; 14 | 15 | import com.dooapp.fxform.model.Element; 16 | 17 | /** 18 | * User: Antoine Mischler 19 | * Date: 26/11/2013 20 | * Time: 10:29 21 | */ 22 | public class WrappedTypeHandler implements ElementHandler { 23 | 24 | private final Class wrappedType; 25 | 26 | public WrappedTypeHandler(Class wrappedType) { 27 | this.wrappedType = wrappedType; 28 | } 29 | 30 | @Override 31 | public boolean handle(Element element) { 32 | return wrappedType.isAssignableFrom(element.getWrappedType()); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/model/BufferedElementFactory.java: -------------------------------------------------------------------------------- 1 | package com.dooapp.fxform.model; 2 | 3 | import com.dooapp.fxform.model.impl.BufferedElement; 4 | import com.dooapp.fxform.model.impl.BufferedPropertyElement; 5 | 6 | import java.lang.reflect.Field; 7 | 8 | /** 9 | * An {@link ElementFactory} that creates {@link com.dooapp.fxform.model.impl.BufferedElement BufferedElements}. 10 | * 11 | * @author Stefan Endrullis (endrullis@iat.uni-leipzig.de) 12 | */ 13 | public class BufferedElementFactory implements ElementFactory { 14 | 15 | protected final ElementFactory elementFactory; 16 | protected final boolean bufferUserInput; 17 | protected final boolean bufferBeanChanges; 18 | 19 | public BufferedElementFactory(ElementFactory elementFactory) { 20 | this(elementFactory, true, true); 21 | } 22 | 23 | public BufferedElementFactory(ElementFactory elementFactory, boolean bufferUserInput, boolean bufferBeanChanges) { 24 | this.elementFactory = elementFactory; 25 | this.bufferUserInput = bufferUserInput; 26 | this.bufferBeanChanges = bufferBeanChanges; 27 | } 28 | 29 | @Override 30 | public Element create(Field field) throws FormException { 31 | Element element = elementFactory.create(field); 32 | 33 | if (element instanceof PropertyElement) { 34 | return new BufferedPropertyElement((PropertyElement) element, bufferUserInput, bufferBeanChanges); 35 | } else { 36 | return new BufferedElement(element, bufferBeanChanges); 37 | } 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/model/Category.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, dooApp 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | * Neither the name of dooApp nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | */ 12 | 13 | package com.dooapp.fxform.model; 14 | 15 | import java.lang.annotation.*; 16 | 17 | /** 18 | * Use this annotation to attribute a category to the element build from the target field or method. 19 | *

20 | * User: Antoine Mischler 21 | * Date: 11/12/2013 22 | * Time: 12:57 23 | */ 24 | @Inherited 25 | @Retention(RetentionPolicy.RUNTIME) 26 | @Target({ElementType.FIELD, ElementType.METHOD}) 27 | public @interface Category { 28 | 29 | String value(); 30 | 31 | } 32 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/model/ElementFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, dooApp 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | * Neither the name of dooApp nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | */ 12 | 13 | package com.dooapp.fxform.model; 14 | 15 | import java.lang.reflect.Field; 16 | 17 | /** 18 | * User: Antoine Mischler 19 | * Date: 14/10/12 20 | * Time: 12:04 21 | */ 22 | public interface ElementFactory { 23 | 24 | public Element create(Field field) throws FormException; 25 | 26 | } 27 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/model/ElementProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, dooApp 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | * Neither the name of dooApp nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | */ 12 | 13 | package com.dooapp.fxform.model; 14 | 15 | import javafx.beans.property.ListProperty; 16 | import javafx.beans.property.ObjectProperty; 17 | 18 | /** 19 | * An ElementProvider is used to extract elements from a source bean. An Element is an entry in the form. 20 | *

21 | * User: Antoine Mischler 22 | * Date: 03/12/2013 23 | * Time: 14:50 24 | */ 25 | public interface ElementProvider { 26 | 27 | /** 28 | * Build the list of elements to add into the form for the given source. 29 | * 30 | * @param source 31 | * @param 32 | * @return 33 | */ 34 | public ListProperty getElements(ObjectProperty source); 35 | 36 | } 37 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/model/FormException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, dooApp 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | * Neither the name of dooApp nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | */ 12 | 13 | package com.dooapp.fxform.model; 14 | 15 | /** 16 | * User: Antoine Mischler 17 | * Date: 26/04/11 18 | * Time: 11:32 19 | *

20 | * Root class for exceptions in the form. 21 | */ 22 | public class FormException extends Exception { 23 | 24 | public FormException() { 25 | } 26 | 27 | public FormException(String s) { 28 | super(s); 29 | } 30 | 31 | public FormException(String s, Throwable throwable) { 32 | super(s, throwable); 33 | } 34 | 35 | public FormException(Throwable throwable) { 36 | super(throwable); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/model/PropertyElement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, dooApp 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | * Neither the name of dooApp nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | */ 12 | 13 | package com.dooapp.fxform.model; 14 | 15 | import javafx.beans.property.Property; 16 | import javafx.beans.value.WritableValue; 17 | 18 | import java.lang.reflect.Field; 19 | 20 | /** 21 | * User: Antoine Mischler 22 | * Date: 26/04/11 23 | * Time: 12:11 24 | * An observable and writable form field. 25 | */ 26 | public interface PropertyElement extends Element, Property { 27 | 28 | } 29 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/model/impl/SourceListBinding.java: -------------------------------------------------------------------------------- 1 | package com.dooapp.fxform.model.impl; 2 | 3 | import javafx.beans.binding.ListBinding; 4 | import javafx.collections.ObservableList; 5 | 6 | import java.lang.ref.WeakReference; 7 | 8 | /** 9 | * User: Antoine Mischler 10 | * Date: 16/01/2020 11 | * Time: 11:55 12 | */ 13 | public class SourceListBinding extends ListBinding { 14 | 15 | private final WeakReference element; 16 | 17 | public SourceListBinding(AbstractFieldElement element) { 18 | super.bind(element.sourceProperty()); 19 | this.element = new WeakReference<>(element); 20 | } 21 | 22 | @Override 23 | protected ObservableList computeValue() { 24 | if (element.get() == null || element.get().getSource() == null) { 25 | return null; 26 | } 27 | return (ObservableList) element.get().computeValue(); 28 | } 29 | 30 | @Override 31 | public void dispose() { 32 | super.dispose(); 33 | if (element.get() != null) { 34 | unbind(element.get().sourceProperty()); 35 | } 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/model/impl/SourceMapBinding.java: -------------------------------------------------------------------------------- 1 | package com.dooapp.fxform.model.impl; 2 | 3 | import javafx.beans.binding.MapBinding; 4 | import javafx.collections.ObservableMap; 5 | 6 | import java.lang.ref.WeakReference; 7 | 8 | /** 9 | * User: Antoine Mischler 10 | * Date: 16/01/2020 11 | * Time: 12:29 12 | */ 13 | public class SourceMapBinding extends MapBinding { 14 | 15 | private final WeakReference element; 16 | 17 | public SourceMapBinding(AbstractFieldElement element) { 18 | super.bind(element.sourceProperty()); 19 | this.element = new WeakReference<>(element); 20 | } 21 | 22 | @Override 23 | protected ObservableMap computeValue() { 24 | if (element.get() == null || element.get().getSource() == null) { 25 | return null; 26 | } 27 | return (ObservableMap) element.get().computeValue(); 28 | } 29 | 30 | @Override 31 | public void dispose() { 32 | super.dispose(); 33 | if (element.get() != null) { 34 | unbind(element.get().sourceProperty()); 35 | } 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/model/impl/SourceObjectBinding.java: -------------------------------------------------------------------------------- 1 | package com.dooapp.fxform.model.impl; 2 | 3 | import javafx.beans.binding.ObjectBinding; 4 | import javafx.beans.value.ObservableValue; 5 | 6 | import java.lang.ref.WeakReference; 7 | 8 | /** 9 | * User: Antoine Mischler 10 | * Date: 16/01/2020 11 | * Time: 12:04 12 | */ 13 | public class SourceObjectBinding extends ObjectBinding> { 14 | 15 | private final WeakReference element; 16 | 17 | public SourceObjectBinding(AbstractFieldElement element) { 18 | super.bind(element.sourceProperty()); 19 | this.element = new WeakReference<>(element); 20 | } 21 | 22 | @Override 23 | protected ObservableValue computeValue() { 24 | if (element.get() != null && element.get().getSource() == null) { 25 | return null; 26 | } 27 | return element.get().computeValue(); 28 | } 29 | 30 | @Override 31 | public void dispose() { 32 | super.dispose(); 33 | if (element.get() != null) { 34 | unbind(element.get().sourceProperty()); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/model/impl/java/JavaBeanBooleanPropertyElement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, dooApp 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | * Neither the name of dooApp nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | */ 12 | 13 | package com.dooapp.fxform.model.impl.java; 14 | 15 | import com.dooapp.fxform.model.FormException; 16 | import javafx.beans.property.BooleanProperty; 17 | 18 | import java.lang.reflect.Field; 19 | 20 | /** 21 | * User: Antoine Mischler 22 | * Date: 14/10/12 23 | * Time: 13:00 24 | */ 25 | public class JavaBeanBooleanPropertyElement extends AbstractJavaBeanElement { 26 | 27 | public JavaBeanBooleanPropertyElement(Field field) throws FormException { 28 | super(field); 29 | } 30 | 31 | @Override 32 | public Class getType() { 33 | return BooleanProperty.class; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/model/impl/java/JavaBeanDoublePropertyElement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, dooApp 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | * Neither the name of dooApp nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | */ 12 | 13 | package com.dooapp.fxform.model.impl.java; 14 | 15 | import com.dooapp.fxform.model.FormException; 16 | import javafx.beans.property.DoubleProperty; 17 | 18 | import java.lang.reflect.Field; 19 | 20 | /** 21 | * User: Antoine Mischler 22 | * Date: 14/10/12 23 | * Time: 13:13 24 | */ 25 | public class JavaBeanDoublePropertyElement extends AbstractJavaBeanElement { 26 | 27 | public JavaBeanDoublePropertyElement(Field field) throws FormException { 28 | super(field); 29 | } 30 | 31 | @Override 32 | public Class getType() { 33 | return DoubleProperty.class; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/model/impl/java/JavaBeanFloatPropertyElement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, dooApp 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | * Neither the name of dooApp nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | */ 12 | 13 | package com.dooapp.fxform.model.impl.java; 14 | 15 | import com.dooapp.fxform.model.FormException; 16 | import javafx.beans.property.FloatProperty; 17 | 18 | import java.lang.reflect.Field; 19 | 20 | /** 21 | * User: Antoine Mischler 22 | * Date: 14/10/12 23 | * Time: 13:12 24 | */ 25 | public class JavaBeanFloatPropertyElement extends AbstractJavaBeanElement { 26 | 27 | public JavaBeanFloatPropertyElement(Field field) throws FormException { 28 | super(field); 29 | } 30 | 31 | @Override 32 | public Class getType() { 33 | return FloatProperty.class; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/model/impl/java/JavaBeanIntegerPropertyElement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, dooApp 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | * Neither the name of dooApp nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | */ 12 | 13 | package com.dooapp.fxform.model.impl.java; 14 | 15 | import com.dooapp.fxform.model.FormException; 16 | import javafx.beans.property.IntegerProperty; 17 | 18 | import java.lang.reflect.Field; 19 | 20 | /** 21 | * User: Antoine Mischler 22 | * Date: 14/10/12 23 | * Time: 13:02 24 | */ 25 | public class JavaBeanIntegerPropertyElement extends AbstractJavaBeanElement { 26 | 27 | public JavaBeanIntegerPropertyElement(Field field) throws FormException { 28 | super(field); 29 | } 30 | 31 | @Override 32 | public Class getType() { 33 | return IntegerProperty.class; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/model/impl/java/JavaBeanLongPropertyElement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, dooApp 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | * Neither the name of dooApp nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | */ 12 | 13 | package com.dooapp.fxform.model.impl.java; 14 | 15 | import com.dooapp.fxform.model.FormException; 16 | import javafx.beans.property.LongProperty; 17 | 18 | import java.lang.reflect.Field; 19 | 20 | /** 21 | * User: Antoine Mischler 22 | * Date: 14/10/12 23 | * Time: 13:15 24 | */ 25 | public class JavaBeanLongPropertyElement extends AbstractJavaBeanElement { 26 | 27 | public JavaBeanLongPropertyElement(Field field) throws FormException { 28 | super(field); 29 | } 30 | 31 | @Override 32 | public Class getType() { 33 | return LongProperty.class; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/model/impl/java/JavaBeanStringPropertyElement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, dooApp 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | * Neither the name of dooApp nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | */ 12 | 13 | package com.dooapp.fxform.model.impl.java; 14 | 15 | import com.dooapp.fxform.model.FormException; 16 | import javafx.beans.property.StringProperty; 17 | 18 | import java.lang.reflect.Field; 19 | 20 | /** 21 | * User: Antoine Mischler 22 | * Date: 14/10/12 23 | * Time: 12:40 24 | */ 25 | public class JavaBeanStringPropertyElement extends AbstractJavaBeanElement { 26 | 27 | public JavaBeanStringPropertyElement(Field field) throws FormException { 28 | super(field); 29 | } 30 | 31 | @Override 32 | public Class getType() { 33 | return StringProperty.class; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/reflection/FieldProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, dooApp 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | * Neither the name of dooApp nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | */ 12 | 13 | package com.dooapp.fxform.reflection; 14 | 15 | import java.lang.reflect.Field; 16 | import java.util.List; 17 | 18 | /** 19 | * User: Antoine Mischler 20 | * Date: 09/04/11 21 | * Time: 22:30 22 | */ 23 | public interface FieldProvider { 24 | 25 | public List getProperties(Object source, List fields); 26 | 27 | public List getProperties(Object source); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/resource/ResourceProvider.java: -------------------------------------------------------------------------------- 1 | package com.dooapp.fxform.resource; 2 | 3 | import com.dooapp.fxform.model.Element; 4 | import com.dooapp.fxform.view.NodeType; 5 | import javafx.beans.property.ObjectProperty; 6 | import javafx.beans.property.StringProperty; 7 | 8 | import java.util.ResourceBundle; 9 | 10 | /** 11 | * User: Antoine Mischler 12 | * Date: 03/12/2013 13 | * Time: 11:26 14 | */ 15 | public interface ResourceProvider { 16 | 17 | public StringProperty getString(Element element, NodeType nodeType); 18 | 19 | public ResourceBundle getResourceBundle(); 20 | 21 | public ObjectProperty resourceBundleProperty(); 22 | 23 | public void setResourceBundle(ResourceBundle resourceBundle); 24 | 25 | } 26 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/utils/Disposable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, dooApp 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | * Neither the name of dooApp nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | */ 12 | 13 | package com.dooapp.fxform.utils; 14 | 15 | /** 16 | * Something that can be disposed.
17 | *
18 | * Created at 17/10/11 15:52.
19 | * 20 | * @author Antoine Mischler 21 | */ 22 | public interface Disposable { 23 | 24 | public void dispose(); 25 | 26 | } 27 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/utils/ObjectUtils.java: -------------------------------------------------------------------------------- 1 | package com.dooapp.fxform.utils; 2 | 3 | import java.util.List; 4 | import java.util.Map; 5 | 6 | public class ObjectUtils { 7 | 8 | /** 9 | * Check whether two objects are the same, i.e. they are representing the same model object 10 | * 11 | * By default, we use the equals implementation of the given objects to compare them. 12 | * 13 | * Special cases are applied on List and Map. In there basic equals implementation List and Map are considered equals 14 | * if they have the same content. In our implementation we want List and Map to be considered as different if their 15 | * instances are different whatever their content. 16 | * See {@link java.util.List#equals(Object)} and {@link java.util.Map#equals(Object)} for more details. 17 | * 18 | * @param o1 the first object to compare 19 | * @param o2 the second object to compare 20 | * @return true if o1 and o2 represent the same model object, false otherwise 21 | */ 22 | public static boolean areSame(Object o1, Object o2) { 23 | if (o1 == null && o2 != null) return false; 24 | if (o1 != null && o2 == null) return false; 25 | if (o1 == null && o2 == null) return true; 26 | if (o1 instanceof List && o2 instanceof List) return o1 == o2; 27 | if (o1 instanceof Map && o2 instanceof Map) return o1 == o2; 28 | return o1.equals(o2); 29 | 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/utils/ValueAnnotation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, dooApp 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | * Neither the name of dooApp nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | */ 12 | 13 | package com.dooapp.fxform.utils; 14 | 15 | /** 16 | * User: Antoine Mischler 17 | * Date: 26/11/2013 18 | * Time: 11:24 19 | */ 20 | public @interface ValueAnnotation { 21 | 22 | Class value(); 23 | } 24 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/validation/Warning.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, dooApp 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | * Neither the name of dooApp nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | */ 12 | 13 | package com.dooapp.fxform.validation; 14 | 15 | /** 16 | * Warning validation group. This group can be used to indicate to FXForm 17 | * that the constraint must be treated as a warning. In this case the model 18 | * value is updated even is the constraint is violated by the new input value. 19 | *

20 | * User: Antoine Mischler 21 | * Date: 20/11/2013 22 | * Time: 15:18 23 | */ 24 | public interface Warning { 25 | } 26 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/view/DisposableNode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, dooApp 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | * Neither the name of dooApp nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | */ 12 | 13 | package com.dooapp.fxform.view; 14 | 15 | import com.dooapp.fxform.utils.Disposable; 16 | import javafx.scene.Node; 17 | 18 | /** 19 | * Created at 27/09/12 11:38.
20 | * 21 | * @author Antoine Mischler 22 | */ 23 | public interface DisposableNode extends Disposable { 24 | 25 | /** 26 | * Get the encapsulated node. 27 | * 28 | * @return 29 | */ 30 | public N getNode(); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/view/NodeCreationException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, dooApp 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | * Neither the name of dooApp nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | */ 12 | 13 | package com.dooapp.fxform.view; 14 | 15 | import com.dooapp.fxform.model.FormException; 16 | 17 | /** 18 | * User: Antoine Mischler 19 | * Date: 16/04/11 20 | * Time: 23:46 21 | */ 22 | public class NodeCreationException extends FormException { 23 | 24 | public NodeCreationException() { 25 | } 26 | 27 | public NodeCreationException(String s) { 28 | super(s); 29 | } 30 | 31 | public NodeCreationException(String s, Throwable throwable) { 32 | super(s, throwable); 33 | } 34 | 35 | public NodeCreationException(Throwable throwable) { 36 | super(throwable); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/view/control/map/MapEntryPropertyElement.java: -------------------------------------------------------------------------------- 1 | package com.dooapp.fxform.view.control.map; 2 | 3 | import com.dooapp.fxform.model.PropertyElement; 4 | import javafx.beans.property.MapProperty; 5 | import javafx.beans.property.Property; 6 | import javafx.beans.value.ChangeListener; 7 | import javafx.beans.value.ObservableValue; 8 | 9 | /** 10 | * User: Antoine Mischler 11 | * Date: 24/04/15 12 | * Time: 16:51 13 | */ 14 | public class MapEntryPropertyElement extends MapEntryElement implements PropertyElement { 15 | 16 | private ChangeListener changeListener = (observable1, oldValue, newValue) -> map.put(key, newValue); 17 | 18 | private ObservableValue observable; 19 | 20 | public MapEntryPropertyElement(MapProperty map, K key, Class valueType) { 21 | super(map, key, valueType); 22 | } 23 | 24 | @Override 25 | public void bind(ObservableValue observable) { 26 | if (observable == null) { 27 | this.observable = observable; 28 | observable.addListener(changeListener); 29 | } 30 | } 31 | 32 | @Override 33 | public void unbind() { 34 | if (observable != null) { 35 | observable.removeListener(changeListener); 36 | observable = null; 37 | } 38 | } 39 | 40 | @Override 41 | public boolean isBound() { 42 | return observable != null; 43 | } 44 | 45 | @Override 46 | public void bindBidirectional(Property other) { 47 | throw new UnsupportedOperationException("Not implemented"); 48 | } 49 | 50 | @Override 51 | public void unbindBidirectional(Property other) { 52 | throw new UnsupportedOperationException("Not implemented"); 53 | } 54 | 55 | @Override 56 | public void setValue(V value) { 57 | map.put(key, value); 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/view/factory/DefaultLabelFactoryProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, dooApp 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | * Neither the name of dooApp nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | */ 12 | 13 | package com.dooapp.fxform.view.factory; 14 | 15 | import com.dooapp.fxform.model.Element; 16 | import com.dooapp.fxform.view.FXFormNode; 17 | import com.dooapp.fxform.view.factory.impl.LabelFactory; 18 | import javafx.util.Callback; 19 | 20 | /** 21 | * User: Antoine Mischler 22 | * Date: 21/03/13 23 | * Time: 09:35 24 | */ 25 | public class DefaultLabelFactoryProvider implements FactoryProvider { 26 | 27 | public Callback getFactory(Element element) { 28 | return new LabelFactory(); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/view/factory/DefaultTooltipFactoryProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, dooApp 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | * Neither the name of dooApp nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | */ 12 | 13 | package com.dooapp.fxform.view.factory; 14 | 15 | import com.dooapp.fxform.model.Element; 16 | import com.dooapp.fxform.view.FXFormNode; 17 | import com.dooapp.fxform.view.factory.impl.TextFactory; 18 | import javafx.util.Callback; 19 | 20 | /** 21 | * User: Antoine Mischler 22 | * Date: 21/03/13 23 | * Time: 09:36 24 | */ 25 | public class DefaultTooltipFactoryProvider implements FactoryProvider { 26 | 27 | public Callback getFactory(Element element) { 28 | return new TextFactory(); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/view/factory/DisableFactoryProviderWrapper.java: -------------------------------------------------------------------------------- 1 | package com.dooapp.fxform.view.factory; 2 | 3 | import com.dooapp.fxform.model.Element; 4 | import com.dooapp.fxform.view.FXFormNode; 5 | import javafx.beans.property.BooleanProperty; 6 | import javafx.beans.property.SimpleBooleanProperty; 7 | import javafx.util.Callback; 8 | 9 | /** 10 | * A wrapper around {@link FactoryProvider} that allow to easily enable/disable the state of the provided nodes. 11 | *

12 | * User: Antoine Mischler 13 | * Date: 30/10/2018 14 | * Time: 13:28 15 | */ 16 | public class DisableFactoryProviderWrapper implements FactoryProvider { 17 | 18 | final BooleanProperty disableProperty = new SimpleBooleanProperty(); 19 | 20 | private final FactoryProvider factoryProvider; 21 | 22 | public DisableFactoryProviderWrapper(FactoryProvider factoryProvider) { 23 | this.factoryProvider = factoryProvider; 24 | } 25 | 26 | @Override 27 | public Callback getFactory(Element element) { 28 | Callback result = factoryProvider.getFactory(element); 29 | return param -> { 30 | FXFormNode fxFormNode = result.call(param); 31 | fxFormNode.getNode().disableProperty().bind(disableProperty); 32 | return fxFormNode; 33 | }; 34 | } 35 | 36 | public boolean getDisableProperty() { 37 | return disableProperty.get(); 38 | } 39 | 40 | public BooleanProperty disablePropertyProperty() { 41 | return disableProperty; 42 | } 43 | 44 | public void setDisableProperty(boolean disableProperty) { 45 | this.disableProperty.set(disableProperty); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/view/factory/FactoryProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, dooApp 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | * Neither the name of dooApp nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | */ 12 | 13 | package com.dooapp.fxform.view.factory; 14 | 15 | import com.dooapp.fxform.model.Element; 16 | import com.dooapp.fxform.model.FormException; 17 | import com.dooapp.fxform.view.FXFormNode; 18 | import javafx.util.Callback; 19 | 20 | /** 21 | * Created at 28/09/12 10:45.
22 | * 23 | * @author Antoine Mischler 24 | */ 25 | public interface FactoryProvider { 26 | 27 | public Callback getFactory(Element element); 28 | 29 | } -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/view/factory/impl/AutoHidableLabelFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, dooApp 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | * Neither the name of dooApp nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | */ 12 | 13 | package com.dooapp.fxform.view.factory.impl; 14 | 15 | import com.dooapp.fxform.view.FXFormNode; 16 | import com.dooapp.fxform.view.FXFormNodeWrapper; 17 | import com.dooapp.fxform.view.control.AutoHidableLabel; 18 | import javafx.scene.control.Label; 19 | import javafx.util.Callback; 20 | 21 | /** 22 | * User: Antoine Mischler Date: 26/08/11 Time: 11:50 23 | */ 24 | public class AutoHidableLabelFactory implements Callback { 25 | 26 | public FXFormNode call(Void aVoid) { 27 | final Label label = new AutoHidableLabel(); 28 | label.setWrapText(true); 29 | return new FXFormNodeWrapper(label, label.textProperty()); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/view/factory/impl/CheckboxFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, dooApp 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | * Neither the name of dooApp nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | */ 12 | 13 | package com.dooapp.fxform.view.factory.impl; 14 | 15 | import com.dooapp.fxform.view.FXFormNode; 16 | import com.dooapp.fxform.view.FXFormNodeWrapper; 17 | import javafx.scene.control.CheckBox; 18 | import javafx.util.Callback; 19 | 20 | /** 21 | * User: Antoine Mischler 22 | * Date: 16/04/11 23 | * Time: 23:57 24 | */ 25 | public class CheckboxFactory implements Callback { 26 | 27 | public FXFormNode call(Void aVoid) { 28 | final CheckBox checkBox = new CheckBox(); 29 | return new FXFormNodeWrapper(checkBox, checkBox.selectedProperty()); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/view/factory/impl/ColorPickerFactory.java: -------------------------------------------------------------------------------- 1 | package com.dooapp.fxform.view.factory.impl; 2 | 3 | import com.dooapp.fxform.view.FXFormNode; 4 | import com.dooapp.fxform.view.FXFormNodeWrapper; 5 | import javafx.scene.control.ColorPicker; 6 | import javafx.util.Callback; 7 | 8 | /** 9 | * User: Antoine Mischler 10 | * Date: 26/11/2013 11 | * Time: 10:27 12 | */ 13 | public class ColorPickerFactory implements Callback { 14 | 15 | @Override 16 | public FXFormNode call(Void aVoid) { 17 | ColorPicker colorPicker = new ColorPicker(); 18 | return new FXFormNodeWrapper(colorPicker, colorPicker.valueProperty()); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/view/factory/impl/DatePickerFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, dooApp 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | * Neither the name of dooApp nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | */ 12 | 13 | package com.dooapp.fxform.view.factory.impl; 14 | 15 | import com.dooapp.fxform.view.FXFormNode; 16 | import com.dooapp.fxform.view.FXFormNodeWrapper; 17 | import javafx.scene.control.DatePicker; 18 | import javafx.util.Callback; 19 | 20 | /** 21 | * User: Antoine Mischler 22 | * Date: 26/11/2013 23 | * Time: 10:26 24 | */ 25 | public class DatePickerFactory implements Callback { 26 | 27 | @Override 28 | public FXFormNode call(Void aVoid) { 29 | DatePicker datePicker = new DatePicker(); 30 | return new FXFormNodeWrapper(datePicker, datePicker.valueProperty()); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/view/factory/impl/LabelFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, dooApp 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | * Neither the name of dooApp nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | */ 12 | 13 | package com.dooapp.fxform.view.factory.impl; 14 | 15 | import com.dooapp.fxform.view.FXFormNode; 16 | import com.dooapp.fxform.view.FXFormNodeWrapper; 17 | import javafx.scene.control.Label; 18 | import javafx.util.Callback; 19 | 20 | /** 21 | * User: Antoine Mischler Date: 25/08/11 Time: 18:45 22 | */ 23 | public class LabelFactory implements Callback { 24 | 25 | public FXFormNode call(Void aVoid) { 26 | final Label label = new Label(); 27 | label.setMinWidth(Label.USE_PREF_SIZE); 28 | label.setMaxWidth(Label.USE_PREF_SIZE); 29 | return new FXFormNodeWrapper(label, label.textProperty(), false); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/view/factory/impl/ListChoiceBoxFactory.java: -------------------------------------------------------------------------------- 1 | package com.dooapp.fxform.view.factory.impl; 2 | 3 | import com.dooapp.fxform.AbstractFXForm; 4 | import com.dooapp.fxform.model.Element; 5 | import com.dooapp.fxform.view.FXFormNode; 6 | import javafx.beans.property.ListProperty; 7 | import javafx.util.Callback; 8 | 9 | /** 10 | * User: Antoine Mischler 11 | * Date: 17/07/15 12 | * Time: 17:15 13 | */ 14 | public class ListChoiceBoxFactory implements Callback { 15 | 16 | private final ListProperty choices; 17 | 18 | public ListChoiceBoxFactory(ListProperty choices) { 19 | this.choices = choices; 20 | } 21 | 22 | public FXFormNode call(Void aVoid) { 23 | 24 | return new FXFormChoiceBoxNode() { 25 | @Override 26 | public void init(Element element, AbstractFXForm fxForm) { 27 | choiceBox.itemsProperty().bind(choices); 28 | choiceBox.getSelectionModel().select(element.getValue()); 29 | } 30 | 31 | @Override 32 | public void dispose() { 33 | choiceBox.itemsProperty().unbind(); 34 | super.dispose(); 35 | } 36 | 37 | @Override 38 | public boolean isEditable() { 39 | return true; 40 | } 41 | 42 | }; 43 | 44 | } 45 | 46 | 47 | } 48 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/view/factory/impl/PaginatedTableViewFactory.java: -------------------------------------------------------------------------------- 1 | package com.dooapp.fxform.view.factory.impl; 2 | 3 | import com.dooapp.fxform.AbstractFXForm; 4 | import com.dooapp.fxform.model.Element; 5 | import com.dooapp.fxform.reflection.ReflectionUtils; 6 | import com.dooapp.fxform.view.FXFormNode; 7 | import com.dooapp.fxform.view.FXFormNodeWrapper; 8 | import javafx.scene.control.TableColumn; 9 | import javafx.scene.control.cell.PropertyValueFactory; 10 | import javafx.util.Callback; 11 | 12 | import java.lang.reflect.Field; 13 | import java.util.List; 14 | 15 | /** 16 | * User: Antoine Mischler 17 | * Date: 25/02/2016 18 | * Time: 09:45 19 | */ 20 | public class PaginatedTableViewFactory implements Callback { 21 | 22 | 23 | @Override 24 | public FXFormNode call(Void aVoid) { 25 | 26 | final PaginatedTableView paginatedTableView = new PaginatedTableView(new FXFormTableView()); 27 | 28 | return new FXFormNodeWrapper(paginatedTableView, paginatedTableView.itemsProperty()) { 29 | @Override 30 | public void init(Element element, AbstractFXForm fxForm) { 31 | Class wrappedType = element.getWrappedType(); 32 | List fields = ReflectionUtils.listFields(wrappedType); 33 | for (Field field : fields) { 34 | TableColumn col = new TableColumn(field.getName()); 35 | col.setCellValueFactory(new PropertyValueFactory(field.getName())); 36 | paginatedTableView.getTableView().getColumns().add(col); 37 | } 38 | } 39 | }; 40 | 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/view/factory/impl/PasswordFieldFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, dooApp 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | * Neither the name of dooApp nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | */ 12 | 13 | package com.dooapp.fxform.view.factory.impl; 14 | 15 | import com.dooapp.fxform.view.FXFormNode; 16 | import com.dooapp.fxform.view.FXFormNodeWrapper; 17 | import javafx.scene.control.PasswordField; 18 | import javafx.util.Callback; 19 | 20 | /** 21 | * User: Antoine Mischler 22 | * Date: 21/11/2013 23 | * Time: 11:29 24 | */ 25 | public class PasswordFieldFactory implements Callback { 26 | 27 | @Override 28 | public FXFormNode call(Void aVoid) { 29 | final PasswordField passwordField = new PasswordField(); 30 | return new FXFormNodeWrapper(passwordField, passwordField.textProperty()); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/view/factory/impl/TextAreaFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, dooApp 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | * Neither the name of dooApp nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | */ 12 | 13 | package com.dooapp.fxform.view.factory.impl; 14 | 15 | import com.dooapp.fxform.view.FXFormNode; 16 | import com.dooapp.fxform.view.FXFormNodeWrapper; 17 | import javafx.scene.control.TextArea; 18 | import javafx.util.Callback; 19 | 20 | /** 21 | * User: Antoine Mischler 22 | * Date: 21/11/2013 23 | * Time: 12:05 24 | */ 25 | public class TextAreaFactory implements Callback { 26 | 27 | public FXFormNode call(Void aVoid) { 28 | TextArea textArea = new TextArea(); 29 | textArea.setWrapText(true); 30 | return new FXFormNodeWrapper(textArea, textArea.textProperty()); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/view/factory/impl/TextFactory.java: -------------------------------------------------------------------------------- 1 | package com.dooapp.fxform.view.factory.impl; 2 | 3 | import com.dooapp.fxform.view.FXFormNode; 4 | import com.dooapp.fxform.view.FXFormNodeWrapper; 5 | import javafx.scene.text.Text; 6 | import javafx.scene.text.TextFlow; 7 | import javafx.util.Callback; 8 | 9 | /** 10 | * User: Antoine Mischler 11 | * Date: 25/04/15 12 | * Time: 10:58 13 | */ 14 | public class TextFactory implements Callback { 15 | 16 | public FXFormNode call(Void aVoid) { 17 | final TextFlow textFlow = new TextFlow(); 18 | final Text text = new Text(); 19 | textFlow.getChildren().add(text); 20 | return new FXFormNodeWrapper(textFlow, text.textProperty()); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/view/factory/impl/TextFieldFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, dooApp 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | * Neither the name of dooApp nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | */ 12 | 13 | package com.dooapp.fxform.view.factory.impl; 14 | 15 | import com.dooapp.fxform.view.FXFormNode; 16 | import com.dooapp.fxform.view.FXFormNodeWrapper; 17 | import javafx.scene.control.TextField; 18 | import javafx.util.Callback; 19 | 20 | /** 21 | * User: Antoine Mischler 22 | * Date: 16/04/11 23 | * Time: 23:28 24 | */ 25 | public class TextFieldFactory implements Callback { 26 | 27 | public FXFormNode call(Void aVoid) { 28 | final TextField textField = new TextField(); 29 | return new FXFormNodeWrapper(textField, textField.textProperty()); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/view/property/PropertyProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, dooApp 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | * Neither the name of dooApp nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | */ 12 | 13 | package com.dooapp.fxform.view.property; 14 | 15 | import javafx.beans.property.Property; 16 | import javafx.scene.Node; 17 | 18 | /** 19 | * User: Antoine Mischler 20 | * Date: 30/09/12 21 | * Time: 09:49 22 | */ 23 | public interface PropertyProvider { 24 | 25 | /** 26 | * Provides the default property for this node. This is the property that should be bound to the model. 27 | * 28 | * @param node 29 | * @return 30 | */ 31 | public Property getProperty(N node); 32 | 33 | } 34 | -------------------------------------------------------------------------------- /core/src/main/java/com/dooapp/fxform/view/property/TableViewProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, dooApp 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | * Neither the name of dooApp nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | */ 12 | 13 | package com.dooapp.fxform.view.property; 14 | 15 | import javafx.beans.binding.Bindings; 16 | import javafx.beans.property.SimpleListProperty; 17 | import javafx.collections.FXCollections; 18 | import javafx.scene.control.TableView; 19 | 20 | /** 21 | * User: Antoine Mischler 22 | * Date: 26/11/2013 23 | * Time: 12:34 24 | */ 25 | public class TableViewProperty extends SimpleListProperty { 26 | 27 | public TableViewProperty(TableView tableView) { 28 | super(FXCollections.observableArrayList()); 29 | Bindings.bindContentBidirectional(this, tableView.getItems()); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /core/src/main/resources/com/dooapp/fxform/view/control/warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dooApp/FXForm2/be74e5635800bf23bed0a8790a759ab0ed350fc5/core/src/main/resources/com/dooapp/fxform/view/control/warning.png -------------------------------------------------------------------------------- /core/src/site/site.xml: -------------------------------------------------------------------------------- 1 | 12 | 13 | 16 | 17 |

18 | 19 | 20 | org.apache.maven.skins 21 | maven-fluido-skin 22 | 1.12.0 23 | 24 | 25 | 26 | true 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /core/src/test/java/com/dooapp/fxform/FailOnUncaughtExceptionRule.java: -------------------------------------------------------------------------------- 1 | package com.dooapp.fxform; 2 | 3 | import org.junit.Assert; 4 | import org.junit.rules.TestRule; 5 | import org.junit.runner.Description; 6 | import org.junit.runners.model.Statement; 7 | 8 | /** 9 | * User: Antoine Mischler 10 | * Date: 22/09/2017 11 | * Time: 14:43 12 | */ 13 | public class FailOnUncaughtExceptionRule implements TestRule { 14 | 15 | @Override 16 | public Statement apply(Statement statement, Description description) { 17 | return new Statement() { 18 | @Override 19 | public void evaluate() throws Throwable { 20 | final boolean[] failed = {false}; 21 | final Throwable[] exception = {null}; 22 | final Thread[] threads = {null}; 23 | Thread.UncaughtExceptionHandler original = Thread.getDefaultUncaughtExceptionHandler(); 24 | Thread.setDefaultUncaughtExceptionHandler((t, e) -> { 25 | e.printStackTrace(); 26 | failed[0] = true; 27 | exception[0] = e; 28 | threads[0] = t; 29 | }); 30 | statement.evaluate(); 31 | if (failed[0]) { 32 | Assert.fail("Uncaught exception in " + threads[0].getName()); 33 | } 34 | // restore original uncaught exception handler 35 | Thread.setDefaultUncaughtExceptionHandler(original); 36 | } 37 | }; 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /core/src/test/java/com/dooapp/fxform/TestEnum.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012, dooApp 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | * 7 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | * Neither the name of dooApp nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | */ 12 | 13 | package com.dooapp.fxform; 14 | 15 | import org.junit.Ignore; 16 | 17 | /** 18 | * Model enum used for testing. 19 | *

20 | * User: Antoine Mischler 21 | * Date: 12/09/11 22 | * Time: 17:05 23 | */ 24 | @Ignore 25 | public enum TestEnum { 26 | } 27 | -------------------------------------------------------------------------------- /core/src/test/java/com/dooapp/fxform/issues/Issue103Test.java: -------------------------------------------------------------------------------- 1 | package com.dooapp.fxform.issues; 2 | 3 | import com.dooapp.fxform.FXForm; 4 | import com.dooapp.fxform.FailOnUncaughtExceptionRule; 5 | import com.dooapp.fxform.JavaFXRule; 6 | import com.dooapp.fxform.adapter.Adapter; 7 | import com.dooapp.fxform.adapter.AdapterException; 8 | import com.dooapp.fxform.adapter.FormAdapter; 9 | import com.dooapp.fxform.annotation.FormFactory; 10 | import com.dooapp.fxform.model.FormException; 11 | import com.dooapp.fxform.view.factory.impl.CheckboxFactory; 12 | import javafx.beans.property.ReadOnlyObjectProperty; 13 | import javafx.beans.property.SimpleObjectProperty; 14 | import org.junit.Rule; 15 | import org.junit.Test; 16 | 17 | /** 18 | * User: Antoine Mischler 19 | * Date: 02/06/15 20 | * Time: 17:11 21 | */ 22 | public class Issue103Test { 23 | 24 | @Rule 25 | public JavaFXRule javaFXRule = new JavaFXRule(); 26 | 27 | @Rule 28 | public FailOnUncaughtExceptionRule failOnUncaughtExceptionRule = new FailOnUncaughtExceptionRule(); 29 | 30 | public static class TestAdapter implements Adapter { 31 | 32 | 33 | @Override 34 | public Boolean adaptTo(Double from) throws AdapterException { 35 | return null; 36 | } 37 | 38 | @Override 39 | public Double adaptFrom(Boolean to) throws AdapterException { 40 | return null; 41 | } 42 | 43 | } 44 | 45 | public static class TestBean { 46 | 47 | @FormFactory(CheckboxFactory.class) 48 | @FormAdapter(TestAdapter.class) 49 | public ReadOnlyObjectProperty p = new SimpleObjectProperty(1.0); 50 | 51 | } 52 | 53 | @Test 54 | public void test() throws NoSuchFieldException, FormException { 55 | new FXForm(new TestBean()); 56 | 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /core/src/test/java/com/dooapp/fxform/issues/Issue115Test.java: -------------------------------------------------------------------------------- 1 | package com.dooapp.fxform.issues; 2 | 3 | import com.dooapp.fxform.FXForm; 4 | import javafx.application.Application; 5 | import javafx.beans.property.SimpleStringProperty; 6 | import javafx.beans.property.StringProperty; 7 | import javafx.scene.Scene; 8 | import javafx.scene.control.TitledPane; 9 | import javafx.scene.layout.StackPane; 10 | import javafx.stage.Stage; 11 | 12 | import java.util.ResourceBundle; 13 | 14 | /** 15 | * Test designed to be run manually. 16 | *

17 | * User: Antoine Mischler 18 | * Date: 19/11/15 19 | * Time: 10:01 20 | */ 21 | public class Issue115Test extends Application { 22 | 23 | public static class TestBean { 24 | 25 | private StringProperty myProp = new SimpleStringProperty(); 26 | 27 | } 28 | 29 | public static void main(String... args) { 30 | Application.launch(args); 31 | } 32 | 33 | @Override 34 | public void start(Stage primaryStage) throws Exception { 35 | TitledPane titledPane = new TitledPane(); 36 | FXForm fxForm = new FXForm(); 37 | fxForm.setResourceBundle(ResourceBundle.getBundle("Issue115Test")); 38 | fxForm.setSource(new TestBean()); 39 | titledPane.setContent(fxForm); 40 | Scene scene = new Scene(new StackPane(titledPane)); 41 | primaryStage.setScene(scene); 42 | primaryStage.show(); 43 | } 44 | 45 | 46 | } 47 | -------------------------------------------------------------------------------- /core/src/test/java/com/dooapp/fxform/issues/Issue116Test.java: -------------------------------------------------------------------------------- 1 | package com.dooapp.fxform.issues; 2 | 3 | import com.dooapp.fxform.FXForm; 4 | import com.dooapp.fxform.JavaFXRule; 5 | import com.dooapp.fxform.TestBean; 6 | import com.dooapp.fxform.model.Element; 7 | import com.dooapp.fxform.view.skin.FXMLSkin; 8 | import junit.framework.Assert; 9 | import org.junit.Rule; 10 | import org.junit.Test; 11 | 12 | /** 13 | * User: Antoine Mischler 14 | * Date: 18/12/15 15 | * Time: 16:18 16 | */ 17 | public class Issue116Test { 18 | 19 | @Rule 20 | public JavaFXRule javaFXRule = new JavaFXRule(); 21 | 22 | @Test 23 | public void testIssue116() { 24 | FXForm fxForm = new FXForm(); 25 | fxForm.setSource(new TestBean()); 26 | FXMLSkin fxmlSkin = new FXMLSkin(fxForm, this.getClass().getClassLoader().getResource("issue116.fxml")); 27 | fxForm.setSkin(fxmlSkin); 28 | Element element = fxForm.getFilteredElements(). 29 | stream() 30 | .filter(e -> e.getName().equals("stringProperty")) 31 | .findFirst().get(); 32 | Assert.assertNotNull(fxmlSkin.getEditor(element)); 33 | Assert.assertNotNull(fxmlSkin.getLabel(element)); 34 | Assert.assertNotNull(fxmlSkin.getTooltip(element)); 35 | Assert.assertNotNull(fxmlSkin.getConstraint(element)); 36 | 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /core/src/test/java/com/dooapp/fxform/issues/Issue126Test.java: -------------------------------------------------------------------------------- 1 | package com.dooapp.fxform.issues; 2 | 3 | import com.dooapp.fxform.FXForm; 4 | import com.dooapp.fxform.JavaFXRule; 5 | import javafx.application.Platform; 6 | import javafx.beans.property.SimpleStringProperty; 7 | import javafx.beans.property.StringProperty; 8 | import javafx.scene.control.TextField; 9 | import junit.framework.Assert; 10 | import org.junit.Rule; 11 | import org.junit.Test; 12 | 13 | /** 14 | * User: Antoine Mischler 15 | * Date: 22/06/2016 16 | * Time: 11:58 17 | */ 18 | public class Issue126Test { 19 | 20 | @Rule 21 | public JavaFXRule javaFXRule = new JavaFXRule(); 22 | 23 | class TestBean { 24 | 25 | StringProperty name = new SimpleStringProperty(); 26 | 27 | public String getName() { 28 | return name.get(); 29 | } 30 | 31 | public StringProperty nameProperty() { 32 | return name; 33 | } 34 | 35 | public void setName(String name) { 36 | this.name.set(name); 37 | } 38 | 39 | } 40 | 41 | @Test 42 | public void test() throws InterruptedException { 43 | TestBean testBean = new TestBean(); 44 | // create two forms for the same bean instance 45 | FXForm form1 = new FXForm(testBean); 46 | FXForm form2 = new FXForm(testBean); 47 | int numberOfUpdates = 10; 48 | final int[] updateCount = {0}; 49 | testBean.nameProperty().addListener((observable, oldValue, newValue) -> { 50 | updateCount[0]++; 51 | }); 52 | for (int i = 0; i < numberOfUpdates; i++) { 53 | TextField textField = ((TextField) form1.lookup("#name-form-editor")); 54 | int finalI = i; 55 | Platform.runLater(() -> textField.setText(textField.getText() + finalI)); 56 | } 57 | // wait 1 second to let a chance to unexpected model updates to be executed 58 | Thread.sleep(1000); 59 | Assert.assertEquals(numberOfUpdates, updateCount[0]); 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /core/src/test/java/com/dooapp/fxform/issues/Issue131Test.java: -------------------------------------------------------------------------------- 1 | package com.dooapp.fxform.issues; 2 | 3 | import com.dooapp.fxform.FXForm; 4 | import com.dooapp.fxform.JavaFXRule; 5 | import com.dooapp.fxform.model.FormException; 6 | import com.dooapp.fxform.model.impl.java.JavaBeanIntegerPropertyElement; 7 | import org.junit.Assert; 8 | import org.junit.Rule; 9 | import org.junit.Test; 10 | 11 | /** 12 | * A test for issue #131. 13 | * 14 | * @author Stefan Endrullis 15 | */ 16 | public class Issue131Test { 17 | 18 | @Rule 19 | public JavaFXRule javaFXRule = new JavaFXRule(); 20 | 21 | public static class TestBean { 22 | public Integer age; 23 | 24 | public Integer getAge() { 25 | return age; 26 | } 27 | 28 | public void setAge(Integer age) { 29 | this.age = age; 30 | } 31 | } 32 | 33 | @Test 34 | public void test() { 35 | new FXForm<>(new TestBean()); 36 | } 37 | 38 | @Test 39 | public void testJavaBeanIntegerPropertyElement() throws NoSuchFieldException, FormException { 40 | TestBean testBean = new TestBean(); 41 | JavaBeanIntegerPropertyElement element = new JavaBeanIntegerPropertyElement(TestBean.class.getField("age")); 42 | element.setSource(testBean); 43 | Assert.assertNull(element.getValue()); 44 | testBean.setAge(42); 45 | Assert.assertEquals(42, element.getValue()); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /core/src/test/java/com/dooapp/fxform/issues/Issue135Test.java: -------------------------------------------------------------------------------- 1 | package com.dooapp.fxform.issues; 2 | 3 | import com.dooapp.fxform.FXForm; 4 | import com.dooapp.fxform.JavaFXRule; 5 | import javafx.beans.property.SimpleStringProperty; 6 | import javafx.beans.property.StringProperty; 7 | import org.junit.Assert; 8 | import org.junit.Rule; 9 | import org.junit.Test; 10 | 11 | /** 12 | * User: Antoine Mischler 13 | * Date: 10/04/2017 14 | * Time: 15:09 15 | */ 16 | public class Issue135Test { 17 | 18 | @Rule 19 | public JavaFXRule javaFXRule = new JavaFXRule(); 20 | 21 | class TestBean { 22 | 23 | StringProperty name = new SimpleStringProperty(); 24 | 25 | public String getName() { 26 | return name.get(); 27 | } 28 | 29 | public StringProperty nameProperty() { 30 | return name; 31 | } 32 | 33 | public void setName(String name) { 34 | this.name.set(name); 35 | } 36 | 37 | } 38 | 39 | @Test 40 | public void test() { 41 | TestBean testBean1 = new TestBean(); 42 | TestBean testBean2 = new TestBean(); 43 | testBean1.setName("a"); 44 | testBean2.setName("b"); 45 | FXForm fxForm = new FXForm(); 46 | for (int i = 0; i < 10000; i++) { 47 | fxForm.setSource(i % 2 == 0 ? testBean1 : testBean2); 48 | } 49 | Assert.assertEquals("a", testBean1.getName()); 50 | Assert.assertEquals("b", testBean2.getName()); 51 | } 52 | 53 | } -------------------------------------------------------------------------------- /core/src/test/java/com/dooapp/fxform/issues/Issue144Test.java: -------------------------------------------------------------------------------- 1 | package com.dooapp.fxform.issues; 2 | 3 | import com.dooapp.fxform.FXForm; 4 | import com.dooapp.fxform.JavaFXRule; 5 | import com.dooapp.fxform.view.NodeType; 6 | import javafx.beans.property.SimpleStringProperty; 7 | import javafx.beans.property.StringProperty; 8 | import org.junit.Assert; 9 | import org.junit.Rule; 10 | import org.junit.Test; 11 | 12 | import java.util.ResourceBundle; 13 | 14 | /** 15 | * User: Antoine Mischler 16 | * Date: 15/05/2017 17 | * Time: 17:12 18 | */ 19 | public class Issue144Test { 20 | 21 | @Rule 22 | public JavaFXRule javaFXRule = new JavaFXRule(); 23 | 24 | class TestBean { 25 | 26 | StringProperty name = new SimpleStringProperty(); 27 | 28 | public String getName() { 29 | return name.get(); 30 | } 31 | 32 | public StringProperty nameProperty() { 33 | return name; 34 | } 35 | 36 | public void setName(String name) { 37 | this.name.set(name); 38 | } 39 | 40 | } 41 | 42 | @Test 43 | public void test() { 44 | FXForm fxForm = new FXForm(); 45 | fxForm.setResourceBundle(ResourceBundle.getBundle("Issue144Test")); 46 | fxForm.setSource(new TestBean()); 47 | Assert.assertEquals("Nom", 48 | fxForm.getResourceProvider().getString(fxForm.getElements().get(0), NodeType.LABEL).get()); 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /core/src/test/java/com/dooapp/fxform/issues/Issue156Test.java: -------------------------------------------------------------------------------- 1 | package com.dooapp.fxform.issues; 2 | 3 | import com.dooapp.fxform.FXForm; 4 | import com.dooapp.fxform.JavaFXRule; 5 | import org.junit.Rule; 6 | import org.junit.Test; 7 | 8 | public class Issue156Test { 9 | 10 | @Rule 11 | public JavaFXRule javaFXRule = new JavaFXRule(); 12 | 13 | public class TestBean { 14 | private Object object = new Object(); 15 | 16 | public Object getObject() { 17 | return object; 18 | } 19 | 20 | public void setObject(Object object) { 21 | this.object = object; 22 | } 23 | } 24 | 25 | @Test 26 | public void testIssue156() { 27 | TestBean testBean = new TestBean(); 28 | FXForm form = new FXForm(testBean); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /core/src/test/java/com/dooapp/fxform/issues/Issue161Test.java: -------------------------------------------------------------------------------- 1 | package com.dooapp.fxform.issues; 2 | 3 | import com.dooapp.fxform.AbstractFXForm; 4 | import com.dooapp.fxform.FXForm; 5 | import com.dooapp.fxform.JavaFXRule; 6 | import com.dooapp.fxform.handler.NamedFieldHandler; 7 | import com.dooapp.fxform.model.Element; 8 | import com.dooapp.fxform.view.FXFormNode; 9 | import com.dooapp.fxform.view.FXFormNodeWrapper; 10 | import com.dooapp.fxform.view.factory.DefaultFactoryProvider; 11 | import javafx.beans.property.SimpleStringProperty; 12 | import javafx.beans.property.StringProperty; 13 | import javafx.scene.control.TextField; 14 | import javafx.util.Callback; 15 | import org.junit.Assert; 16 | import org.junit.Rule; 17 | import org.junit.Test; 18 | 19 | public class Issue161Test { 20 | 21 | @Rule 22 | public JavaFXRule javaFXRule = new JavaFXRule(); 23 | 24 | public class TestBean { 25 | private StringProperty text = new SimpleStringProperty(); 26 | 27 | public String getText() { 28 | return text.get(); 29 | } 30 | 31 | public StringProperty textProperty() { 32 | return text; 33 | } 34 | 35 | public void setText(String text) { 36 | this.text.set(text); 37 | } 38 | } 39 | 40 | @Test 41 | public void test() { 42 | TextField textArea = new TextField(); 43 | FXForm form = new FXForm(); 44 | 45 | DefaultFactoryProvider factoryProvider = (DefaultFactoryProvider) form.getEditorFactoryProvider(); 46 | factoryProvider.addFactory(new NamedFieldHandler("text"), new Callback() { 47 | @Override 48 | public FXFormNode call(Void param) { 49 | return new FXFormNodeWrapper(textArea, textArea.textProperty()) { 50 | @Override 51 | public void init(Element element, AbstractFXForm fxForm) { 52 | super.init(element, fxForm); 53 | textArea.setPromptText("DOOAPP"); 54 | } 55 | }; 56 | } 57 | }); 58 | 59 | TestBean testBean = new TestBean(); 60 | form.setSource(testBean); 61 | 62 | Assert.assertEquals("DOOAPP", textArea.getPromptText()); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /core/src/test/java/com/dooapp/fxform/issues/Issue162Test.java: -------------------------------------------------------------------------------- 1 | package com.dooapp.fxform.issues; 2 | 3 | import com.dooapp.fxform.FXForm; 4 | import com.dooapp.fxform.JavaFXRule; 5 | import com.dooapp.fxform.model.Element; 6 | import javafx.beans.property.Property; 7 | import org.hibernate.validator.constraints.Email; 8 | import org.junit.Assert; 9 | import org.junit.Rule; 10 | import org.junit.Test; 11 | 12 | /** 13 | * Thanks to https://github.com/fblan (Blanc Frederic) for providing this test. 14 | * See https://github.com/dooApp/FXForm2/issues/162 15 | *

16 | * User: Antoine Mischler 17 | * Date: 19/01/2018 18 | * Time: 10:38 19 | */ 20 | public class Issue162Test { 21 | 22 | @Rule 23 | public JavaFXRule javaFXRule = new JavaFXRule(); 24 | 25 | public class TestBean { 26 | @Email 27 | //initial value is a valid email 28 | private String text = "test@g"; 29 | 30 | public String getText() { 31 | return text; 32 | } 33 | 34 | public void setText(String s) { 35 | this.text = s; 36 | } 37 | 38 | } 39 | 40 | @Test 41 | public void test() { 42 | TestBean test = new TestBean(); 43 | FXForm form = new FXForm(test); 44 | int nbError = form.getConstraintViolations().size(); 45 | Assert.assertEquals(0, nbError); 46 | Element text = form.getElements().get(0); 47 | Property textEditorProperty = form.getController(text).getEditorController().getNode().getProperty(); 48 | //setting an invalid email, so one constraint violation expected 49 | textEditorProperty.setValue("test@"); 50 | nbError = form.getConstraintViolations().size(); 51 | Assert.assertEquals(1, nbError); 52 | //setting back previous valid email, so no constraint violation expected 53 | textEditorProperty.setValue("test@g"); 54 | nbError = form.getConstraintViolations().size(); 55 | Assert.assertEquals(0, nbError); 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /core/src/test/java/com/dooapp/fxform/issues/Issue197Test.java: -------------------------------------------------------------------------------- 1 | package com.dooapp.fxform.issues; 2 | 3 | import com.dooapp.fxform.FXForm; 4 | import com.dooapp.fxform.JavaFXRule; 5 | import com.dooapp.fxform.filter.ExcludeFilter; 6 | import javafx.beans.property.SimpleStringProperty; 7 | import javafx.beans.property.StringProperty; 8 | import org.junit.Assert; 9 | import org.junit.Rule; 10 | import org.junit.Test; 11 | 12 | public class Issue197Test { 13 | 14 | @Rule 15 | public JavaFXRule javaFXRule = new JavaFXRule(); 16 | 17 | public class Bean { 18 | private StringProperty a = new SimpleStringProperty(); 19 | private StringProperty b = new SimpleStringProperty(); 20 | 21 | public String getA() { return a.get(); } 22 | public StringProperty aProperty() { return a; } 23 | public void setA(String a) { this.a.set(a); } 24 | 25 | public String getB() { return b.get(); } 26 | public StringProperty bProperty() { return b; } 27 | public void setB(String b) { this.b.set(b); } 28 | } 29 | 30 | @Test 31 | public void test() { 32 | Bean bean = new Bean(); 33 | FXForm form = new FXForm<>(); 34 | form.setSource(bean); 35 | Assert.assertEquals(2, form.getFilteredElements().size()); 36 | Assert.assertEquals("a", form.getFilteredElements().get(0).getName()); 37 | Assert.assertEquals("b", form.getFilteredElements().get(1).getName()); 38 | 39 | ExcludeFilter excludeFilter = new ExcludeFilter("a"); 40 | form.getFilters().setAll(excludeFilter); 41 | Assert.assertEquals(1, form.getFilteredElements().size()); 42 | Assert.assertEquals("b", form.getFilteredElements().get(0).getName()); 43 | 44 | excludeFilter = new ExcludeFilter("a", "c"); 45 | form.getFilters().setAll(excludeFilter); 46 | Assert.assertEquals(1, form.getFilteredElements().size()); 47 | Assert.assertEquals("b", form.getFilteredElements().get(0).getName()); 48 | 49 | form.getFilters().clear(); 50 | Assert.assertEquals(2, form.getFilteredElements().size()); 51 | Assert.assertEquals("a", form.getFilteredElements().get(0).getName()); 52 | Assert.assertEquals("b", form.getFilteredElements().get(1).getName()); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /core/src/test/java/com/dooapp/fxform/issues/Issue206Test.java: -------------------------------------------------------------------------------- 1 | package com.dooapp.fxform.issues; 2 | 3 | import com.dooapp.fxform.FXForm; 4 | import com.dooapp.fxform.JavaFXRule; 5 | import com.dooapp.fxform.validation.Warning; 6 | import javafx.beans.property.IntegerProperty; 7 | import javafx.beans.property.SimpleIntegerProperty; 8 | import javafx.scene.control.Label; 9 | import org.hamcrest.core.IsNot; 10 | import org.junit.Rule; 11 | import org.junit.Test; 12 | 13 | import javax.validation.constraints.Max; 14 | 15 | import static org.hamcrest.core.IsCollectionContaining.hasItems; 16 | import static org.junit.Assert.assertThat; 17 | 18 | public class Issue206Test { 19 | 20 | @Rule 21 | public JavaFXRule javaFXRule = new JavaFXRule(); 22 | 23 | public class Bean { 24 | 25 | private IntegerProperty year = new SimpleIntegerProperty(); 26 | 27 | @Max(value = 2025, groups = Warning.class) 28 | public int getYear() { 29 | return year.get(); 30 | } 31 | 32 | public IntegerProperty yearProperty() { 33 | return year; 34 | } 35 | 36 | public void setYear(int year) { 37 | this.year.set(year); 38 | } 39 | } 40 | 41 | @Test 42 | public void testThatWarningStyleClassIsWellAddedAtFormInitialization() { 43 | FXForm form = new FXForm<>(); 44 | 45 | Bean bean = new Bean(); 46 | bean.setYear(2030); 47 | form.setSource(bean); 48 | 49 | Label yearLabel = (Label) form.lookup("#year-form-label"); 50 | assertThat(yearLabel.getStyleClass(), hasItems("form-label-warning")); 51 | 52 | bean.setYear(2010); 53 | assertThat(yearLabel.getStyleClass(), IsNot.not(hasItems("form-label-warning"))); 54 | 55 | bean.setYear(2030); 56 | assertThat(yearLabel.getStyleClass(), hasItems("form-label-warning")); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /core/src/test/java/com/dooapp/fxform/issues/Issue207Test.java: -------------------------------------------------------------------------------- 1 | package com.dooapp.fxform.issues; 2 | 3 | import com.dooapp.fxform.FXForm; 4 | import com.dooapp.fxform.JavaFXRule; 5 | import javafx.beans.property.IntegerProperty; 6 | import javafx.beans.property.SimpleIntegerProperty; 7 | import javafx.scene.control.Label; 8 | import javafx.scene.control.TextField; 9 | import org.hamcrest.core.IsNot; 10 | import org.junit.Rule; 11 | import org.junit.Test; 12 | 13 | import static org.junit.Assert.assertThat; 14 | import static org.hamcrest.core.IsCollectionContaining.hasItems; 15 | public class Issue207Test { 16 | 17 | @Rule 18 | public JavaFXRule javaFXRule = new JavaFXRule(); 19 | 20 | public class Bean { 21 | 22 | private IntegerProperty year = new SimpleIntegerProperty(); 23 | 24 | public int getYear() { 25 | return year.get(); 26 | } 27 | 28 | public IntegerProperty yearProperty() { 29 | return year; 30 | } 31 | 32 | public void setYear(int year) { 33 | this.year.set(year); 34 | } 35 | } 36 | 37 | @Test 38 | public void testThatElementBecomeInvalidWhenInputCannotBeAdapted() { 39 | Bean bean = new Bean(); 40 | FXForm form = new FXForm<>(); 41 | form.setSource(bean); 42 | 43 | Label yearLabel = (Label) form.lookup("#year-form-label"); 44 | assertThat(yearLabel.getStyleClass(), IsNot.not(hasItems("form-label-invalid"))); 45 | 46 | TextField yearEditor = (TextField) form.lookup("#year-form-editor"); 47 | yearEditor.setText("azerty"); 48 | 49 | assertThat(yearLabel.getStyleClass(), hasItems("form-label-invalid")); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /core/src/test/java/com/dooapp/fxform/issues/Issue23Test.java: -------------------------------------------------------------------------------- 1 | package com.dooapp.fxform.issues; 2 | 3 | import com.dooapp.fxform.FXForm; 4 | import com.dooapp.fxform.JavaFXRule; 5 | import junit.framework.Assert; 6 | import org.junit.Rule; 7 | import org.junit.Test; 8 | 9 | /** 10 | * Created at 26/06/13 17:49.
11 | * 12 | * @author Antoine Mischler 13 | */ 14 | public class Issue23Test { 15 | 16 | @Rule 17 | public JavaFXRule javaFXRule = new JavaFXRule(); 18 | 19 | public static class Bean { 20 | 21 | private String test = "test"; 22 | 23 | public String getTest() { 24 | return test; 25 | } 26 | 27 | public void setTest(String test) { 28 | this.test = test; 29 | } 30 | } 31 | 32 | @Test 33 | public void testIssue23() { 34 | Bean bean = new Bean(); 35 | FXForm fxForm = new FXForm(); 36 | fxForm.setSource(bean); 37 | Assert.assertNotNull(bean.getTest()); 38 | } 39 | 40 | } -------------------------------------------------------------------------------- /core/src/test/java/com/dooapp/fxform/issues/Issue25Test.java: -------------------------------------------------------------------------------- 1 | package com.dooapp.fxform.issues; 2 | 3 | import com.dooapp.fxform.FXForm; 4 | import com.dooapp.fxform.JavaFXRule; 5 | import javafx.beans.property.ObjectProperty; 6 | import javafx.beans.property.SimpleObjectProperty; 7 | import org.junit.Assert; 8 | import org.junit.Rule; 9 | import org.junit.Test; 10 | 11 | /** 12 | * Created at 26/06/13 17:33.
13 | * 14 | * @author Antoine Mischler 15 | */ 16 | public class Issue25Test { 17 | 18 | @Rule 19 | public JavaFXRule javaFXRule = new JavaFXRule(); 20 | 21 | public static class Content { 22 | 23 | } 24 | 25 | public static class Bean { 26 | 27 | private final ObjectProperty content = new SimpleObjectProperty(); 28 | 29 | public Content getContent() { 30 | return content.get(); 31 | } 32 | 33 | public ObjectProperty contentProperty() { 34 | return content; 35 | } 36 | 37 | public void setContent(Content content) { 38 | this.content.set(content); 39 | } 40 | } 41 | 42 | @Test 43 | public void testIssue25() { 44 | FXForm fxForm = new FXForm(); 45 | Bean bean = new Bean(); 46 | bean.setContent(new Content()); 47 | fxForm.setSource(bean); 48 | Assert.assertTrue(bean.getContent() instanceof Content); 49 | } 50 | 51 | } -------------------------------------------------------------------------------- /core/src/test/java/com/dooapp/fxform/issues/Issue34Test.java: -------------------------------------------------------------------------------- 1 | package com.dooapp.fxform.issues; 2 | 3 | import com.dooapp.fxform.reflection.ReflectionUtils; 4 | import javafx.beans.property.ObjectProperty; 5 | import javafx.beans.property.SimpleObjectProperty; 6 | import junit.framework.Assert; 7 | import org.junit.Test; 8 | 9 | /** 10 | * User: Antoine Mischler 11 | * Date: 05/11/2013 12 | * Time: 11:42 13 | */ 14 | public class Issue34Test { 15 | 16 | private static class UpperBoundClass { 17 | 18 | } 19 | 20 | private static class Clazz extends UpperBoundClass { 21 | 22 | } 23 | 24 | private static class MyBean { 25 | 26 | private final ObjectProperty t = new SimpleObjectProperty(); 27 | 28 | } 29 | 30 | private static class SubBean extends MyBean { 31 | 32 | } 33 | 34 | @Test 35 | public void testUndeclared() throws NoSuchFieldException { 36 | MyBean myBean = new MyBean(); 37 | Assert.assertEquals(UpperBoundClass.class, ReflectionUtils.getObjectPropertyGeneric(myBean, myBean.getClass().getDeclaredField("t"))); 38 | } 39 | 40 | @Test 41 | public void testSubBean() throws NoSuchFieldException { 42 | SubBean myBean = new SubBean(); 43 | Assert.assertEquals(Clazz.class, ReflectionUtils.getObjectPropertyGeneric(myBean, myBean.getClass().getSuperclass().getDeclaredField("t"))); 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /core/src/test/java/com/dooapp/fxform/issues/Issue95Test.java: -------------------------------------------------------------------------------- 1 | package com.dooapp.fxform.issues; 2 | 3 | import com.dooapp.fxform.annotation.Accessor; 4 | import com.dooapp.fxform.model.FormException; 5 | import com.dooapp.fxform.model.PropertyElementFactory; 6 | import com.dooapp.fxform.model.impl.PropertyMethodElement; 7 | import com.dooapp.fxform.model.impl.ReadOnlyPropertyMethodElement; 8 | import javafx.beans.property.DoubleProperty; 9 | import javafx.beans.property.ReadOnlyDoubleProperty; 10 | import javafx.beans.property.SimpleDoubleProperty; 11 | import junit.framework.Assert; 12 | import org.junit.Test; 13 | 14 | import java.lang.reflect.Field; 15 | 16 | /** 17 | * User: Antoine Mischler 18 | * Date: 16/01/15 19 | * Time: 10:03 20 | */ 21 | public class Issue95Test { 22 | 23 | @Accessor(Accessor.AccessType.METHOD) 24 | private static class TestBean { 25 | 26 | public DoubleProperty doubleProperty = new SimpleDoubleProperty(); 27 | 28 | public DoubleProperty readOnlyDoubleProperty = new SimpleDoubleProperty(); 29 | 30 | public double getDoubleProperty() { 31 | return doubleProperty.get(); 32 | } 33 | 34 | public DoubleProperty doublePropertyProperty() { 35 | return doubleProperty; 36 | } 37 | 38 | public double getReadOnlyDoubleProperty() { 39 | return readOnlyDoubleProperty.get(); 40 | } 41 | 42 | public ReadOnlyDoubleProperty readOnlyDoublePropertyProperty() { 43 | return readOnlyDoubleProperty; 44 | } 45 | 46 | } 47 | 48 | @Test 49 | public void testThatElementIsReadonly() throws NoSuchFieldException, FormException { 50 | PropertyElementFactory propertyElementFactory = new PropertyElementFactory(); 51 | Field doublePropertyField = TestBean.class.getField("doubleProperty"); 52 | Field readOnlyDoublePropertyField = TestBean.class.getField("readOnlyDoubleProperty"); 53 | Assert.assertEquals(PropertyMethodElement.class, propertyElementFactory.create(doublePropertyField).getClass()); 54 | Assert.assertEquals(ReadOnlyPropertyMethodElement.class, propertyElementFactory.create(readOnlyDoublePropertyField).getClass()); 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /core/src/test/java/com/dooapp/fxform/issues/Issue96Test.java: -------------------------------------------------------------------------------- 1 | package com.dooapp.fxform.issues; 2 | 3 | import com.dooapp.fxform.FXForm; 4 | import com.dooapp.fxform.JavaFXRule; 5 | import junit.framework.Assert; 6 | import org.hibernate.validator.constraints.Length; 7 | import org.junit.Rule; 8 | import org.junit.Test; 9 | 10 | import javax.validation.constraints.NotNull; 11 | 12 | /** 13 | * User: Antoine Mischler 14 | * Date: 24/02/15 15 | * Time: 09:50 16 | */ 17 | public class Issue96Test { 18 | 19 | @Rule 20 | public JavaFXRule javaFXRule = new JavaFXRule(); 21 | 22 | public class LoginData { 23 | @NotNull 24 | @Length(min = 1, max = 8) 25 | private String name; 26 | 27 | @NotNull 28 | @Length(min = 1, max = 8) 29 | private String password; 30 | 31 | public String getName() { 32 | return name; 33 | } 34 | 35 | public void setName(String name) { 36 | this.name = name; 37 | } 38 | 39 | public String getPassword() { 40 | return password; 41 | } 42 | 43 | public void setPassword(String password) { 44 | this.password = password; 45 | } 46 | 47 | } 48 | 49 | @Test 50 | public void test() { 51 | FXForm fxForm = new FXForm(new LoginData()); 52 | Assert.assertEquals(2, fxForm.getConstraintViolations().size()); 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /core/src/test/java/com/dooapp/fxform/issues/Issue97Test.java: -------------------------------------------------------------------------------- 1 | package com.dooapp.fxform.issues; 2 | 3 | import com.dooapp.fxform.FXForm; 4 | import com.dooapp.fxform.JavaFXRule; 5 | import com.dooapp.fxform.builder.FXFormBuilder; 6 | import com.dooapp.fxform.filter.ExcludeFilter; 7 | import javafx.beans.property.SimpleStringProperty; 8 | import javafx.beans.property.StringProperty; 9 | import org.junit.Rule; 10 | import org.junit.Test; 11 | 12 | /** 13 | * User: Antoine Mischler 14 | * Date: 24/02/15 15 | * Time: 09:22 16 | */ 17 | public class Issue97Test { 18 | 19 | @Rule 20 | public JavaFXRule javaFXRule = new JavaFXRule(); 21 | 22 | public static class MyBean { 23 | 24 | StringProperty a = new SimpleStringProperty(); 25 | 26 | StringProperty b = new SimpleStringProperty(); 27 | 28 | public String getA() { 29 | return a.get(); 30 | } 31 | 32 | public StringProperty aProperty() { 33 | return a; 34 | } 35 | 36 | public void setA(String a) { 37 | this.a.set(a); 38 | } 39 | 40 | public String getB() { 41 | return b.get(); 42 | } 43 | 44 | public StringProperty bProperty() { 45 | return b; 46 | } 47 | 48 | public void setB(String b) { 49 | this.b.set(b); 50 | } 51 | } 52 | 53 | @Test 54 | public void test() { 55 | MyBean testedBean = new MyBean(); 56 | FXForm fxForm = new FXFormBuilder().build(); 57 | fxForm.getFilters().add(new ExcludeFilter("b")); 58 | fxForm.setSource(testedBean); 59 | fxForm.getClassLevelValidator().validate(); 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /core/src/test/java/com/dooapp/fxform/issues/issue142/Issue142Bean.java: -------------------------------------------------------------------------------- 1 | package com.dooapp.fxform.issues.issue142; 2 | 3 | import javafx.beans.property.ListProperty; 4 | import javafx.beans.property.SimpleListProperty; 5 | import javafx.collections.FXCollections; 6 | import javafx.collections.ListChangeListener; 7 | import javafx.collections.ObservableList; 8 | 9 | public class Issue142Bean { 10 | ListProperty values = new SimpleListProperty<>(FXCollections.observableArrayList()); 11 | 12 | public Issue142Bean() { 13 | values.addListener(new ListChangeListener() { 14 | @Override 15 | public void onChanged(Change c) { 16 | while (c.next()) { 17 | 18 | } 19 | } 20 | }); 21 | } 22 | 23 | public ObservableList getValues() { 24 | return values.get(); 25 | } 26 | 27 | public ListProperty valuesProperty() { 28 | return values; 29 | } 30 | 31 | public void setValues(ObservableList values) { 32 | this.values.set(values); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /core/src/test/java/com/dooapp/fxform/issues/issue142/Issue142CustomControl.java: -------------------------------------------------------------------------------- 1 | package com.dooapp.fxform.issues.issue142; 2 | 3 | import javafx.beans.property.ListProperty; 4 | import javafx.beans.property.SimpleListProperty; 5 | import javafx.collections.ObservableList; 6 | import javafx.scene.control.Control; 7 | 8 | /** 9 | * Created by KEVIN on 09/05/2017. 10 | */ 11 | public class Issue142CustomControl extends Control { 12 | 13 | private ListProperty values = new SimpleListProperty<>(); 14 | 15 | public Issue142CustomControl() { 16 | 17 | } 18 | 19 | public ObservableList getValues() { 20 | return values.get(); 21 | } 22 | 23 | public ListProperty valuesProperty() { 24 | return values; 25 | } 26 | 27 | public void setValues(ObservableList values) { 28 | this.values.set(values); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /core/src/test/java/com/dooapp/fxform/issues/issue154/Issue154ControlList.java: -------------------------------------------------------------------------------- 1 | package com.dooapp.fxform.issues.issue154; 2 | 3 | import javafx.beans.property.ListProperty; 4 | import javafx.beans.property.SimpleListProperty; 5 | import javafx.collections.FXCollections; 6 | import javafx.collections.ObservableList; 7 | import javafx.scene.control.Control; 8 | 9 | public class Issue154ControlList extends Control { 10 | private ListProperty items = new SimpleListProperty(FXCollections.observableArrayList()); 11 | 12 | public ObservableList getItems() { 13 | return items.get(); 14 | } 15 | 16 | public ListProperty itemsProperty() { 17 | return items; 18 | } 19 | 20 | public void setItems(ObservableList items) { 21 | this.items.set(items); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /core/src/test/java/com/dooapp/fxform/issues/issue154/Issue154ControlMap.java: -------------------------------------------------------------------------------- 1 | package com.dooapp.fxform.issues.issue154; 2 | 3 | import javafx.beans.property.MapProperty; 4 | import javafx.beans.property.SimpleMapProperty; 5 | import javafx.collections.FXCollections; 6 | import javafx.collections.ObservableMap; 7 | import javafx.scene.control.Control; 8 | 9 | public class Issue154ControlMap extends Control { 10 | private MapProperty mapItems = new SimpleMapProperty<>(FXCollections.observableHashMap()); 11 | 12 | public ObservableMap getMapItems() { 13 | return mapItems.get(); 14 | } 15 | 16 | public MapProperty mapItemsProperty() { 17 | return mapItems; 18 | } 19 | 20 | public void setMapItems(ObservableMap mapItems) { 21 | this.mapItems.set(mapItems); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /core/src/test/java/com/dooapp/fxform/reflection/classcast/ClassCastTest.java: -------------------------------------------------------------------------------- 1 | package com.dooapp.fxform.reflection.classcast; 2 | 3 | import com.dooapp.fxform.FXForm; 4 | import com.dooapp.fxform.JavaFXRule; 5 | import com.dooapp.fxform.filter.IncludeFilter; 6 | import org.junit.Rule; 7 | import org.junit.Test; 8 | 9 | /** 10 | * This class test if the ClassCastException is not reproduced. 11 | * The classCast come when you add this to the Device class "extends SuperDevice>" 12 | *
13 | * Created at 13/12/13 17:01.
14 | * 15 | * @author Bastien 16 | */ 17 | public class ClassCastTest { 18 | 19 | @Rule 20 | public JavaFXRule javaFXRule = new JavaFXRule(); 21 | 22 | @Test 23 | public void classCastTest() { 24 | FXForm fxForm = new FXForm(); 25 | fxForm.addFilters(new IncludeFilter("model")); 26 | Device device = new Device(); 27 | device.setModel(new DeviceModel()); 28 | fxForm.setSource(device); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /core/src/test/java/com/dooapp/fxform/reflection/classcast/Device.java: -------------------------------------------------------------------------------- 1 | package com.dooapp.fxform.reflection.classcast; 2 | 3 | import com.dooapp.fxform.annotation.Accessor; 4 | import javafx.beans.property.ObjectProperty; 5 | import javafx.beans.property.SimpleObjectProperty; 6 | 7 | /** 8 | * A Device use for testing. 9 | *
10 | * Created at 13/12/13 16:58.
11 | * 12 | * @author Bastien 13 | */ 14 | @Accessor(Accessor.AccessType.METHOD) 15 | public class Device extends SuperDevice> { 16 | 17 | private ObjectProperty model; 18 | 19 | public ObjectProperty modelProperty() { 20 | if (this.model == null) { 21 | this.model = createModelProperty(); 22 | } 23 | return this.model; 24 | } 25 | 26 | protected ObjectProperty createModelProperty() { 27 | return new SimpleObjectProperty(); 28 | } 29 | 30 | public MODEL getModel() { 31 | return modelProperty().get(); 32 | } 33 | 34 | public void setModel(MODEL myModel) { 35 | this.modelProperty().set(myModel); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /core/src/test/java/com/dooapp/fxform/reflection/classcast/DeviceModel.java: -------------------------------------------------------------------------------- 1 | package com.dooapp.fxform.reflection.classcast; 2 | 3 | /** 4 | * A device model use for testing. 5 | *
6 | * Created at 13/12/13 16:59.
7 | * 8 | * @author Bastien 9 | */ 10 | public class DeviceModel { 11 | 12 | } 13 | -------------------------------------------------------------------------------- /core/src/test/java/com/dooapp/fxform/reflection/classcast/SuperDevice.java: -------------------------------------------------------------------------------- 1 | package com.dooapp.fxform.reflection.classcast; 2 | 3 | /** 4 | * the SuperDevice use for testing. 5 | *
6 | * Created at 13/12/13 17:28.
7 | * 8 | * @author Bastien 9 | */ 10 | public class SuperDevice { 11 | 12 | 13 | } 14 | -------------------------------------------------------------------------------- /core/src/test/java/com/dooapp/fxform/utils/ObjectUtilsTest.java: -------------------------------------------------------------------------------- 1 | package com.dooapp.fxform.utils; 2 | 3 | 4 | import javafx.collections.FXCollections; 5 | import org.junit.Assert; 6 | import org.junit.Test; 7 | import org.junit.runner.RunWith; 8 | import org.junit.runners.Parameterized; 9 | 10 | import java.util.Arrays; 11 | import java.util.Collection; 12 | import java.util.HashMap; 13 | import java.util.Map; 14 | 15 | @RunWith(value = Parameterized.class) 16 | public class ObjectUtilsTest { 17 | 18 | private Object o1; 19 | private Object o2; 20 | private boolean areSame; 21 | 22 | public ObjectUtilsTest(Object o1, Object o2, boolean areSame) { 23 | this.o1 = o1; 24 | this.o2 = o2; 25 | this.areSame = areSame; 26 | } 27 | 28 | @Test 29 | public void testAreSameMethod() { 30 | Assert.assertEquals(areSame, ObjectUtils.areSame(o1, o2)); 31 | } 32 | 33 | @Parameterized.Parameters 34 | public static Collection data() { 35 | Object[] test1 = {10d, 15d, false}; 36 | Object[] test2 = {10d, 10d, true}; 37 | Object[] test3 = {new Double(10), new Double(10), true}; 38 | Object[] test4 = {new Object(), new Object(), false}; 39 | Object[] test5 = {FXCollections.observableHashMap(), FXCollections.observableHashMap(), false}; 40 | 41 | Map map = new HashMap<>(); 42 | map.put("Jack", 22d); 43 | Object[] test6 = {FXCollections.observableHashMap(), FXCollections.observableMap(map), false}; 44 | 45 | Object[] test7 = {FXCollections.observableArrayList(), FXCollections.observableArrayList(), false}; 46 | Object[] test8 = {FXCollections.observableArrayList(), FXCollections.observableArrayList(22, 50), false}; 47 | Object[] test9 = {null, new Object(), false}; 48 | Object[] test10 = {new Object(), null, false}; 49 | Object[] test11 = {null, null, true}; 50 | Object[][] data = new Object[][]{test1, test2, test3, test4, test5, test6, test7, test8, test9, test10, test11}; 51 | return Arrays.asList(data); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /core/src/test/resources/Issue115Test.properties: -------------------------------------------------------------------------------- 1 | myProp-tooltip=This is a long long long long long long long long long long long long long long tooltip -------------------------------------------------------------------------------- /core/src/test/resources/Issue144Test.properties: -------------------------------------------------------------------------------- 1 | name-label=Nom -------------------------------------------------------------------------------- /core/src/test/resources/Issue56Test.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2013, dooApp 3 | # All rights reserved. 4 | # 5 | # Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | # 7 | # Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | # Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | # Neither the name of dooApp nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | # 12 | 13 | MyBean-property1-label=Property1 label 14 | MyBean-property1-tooltip=Property1 tooltip 15 | property1-label=Should not be used 16 | property1-tooltip=Should not be used 17 | property2-label=Property2 label 18 | property2-tooltip=Property2 tooltip 19 | -------------------------------------------------------------------------------- /core/src/test/resources/Issue56Test2.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2013, dooApp 3 | # All rights reserved. 4 | # 5 | # Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | # 7 | # Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | # Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | # Neither the name of dooApp nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | # 12 | 13 | 14 | MyBean-property1-label=Property1 label2 15 | MyBean-property1-tooltip=Property1 tooltip2 16 | property1-label=Should not be used 17 | property1-tooltip=Should not be used 18 | property3-label=Property3 label2 19 | property3-tooltip=Property3 tooltip2 -------------------------------------------------------------------------------- /core/src/test/resources/issue116.fxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 24 | 25 | -------------------------------------------------------------------------------- /core/src/test/resources/issues/issue142/issue142.fxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /core/src/test/resources/issues/issue154/issue154.fxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /core/src/test/resources/issues/issue170/issue170.fxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 11 | 12 | 13 | 14 | 15 | 16 |