├── .gitignore
├── .travis.yml
├── LICENSE
├── README.md
├── addServer.py
├── deploy_release.sh
├── examples
├── README.md
├── books-example
│ ├── README.md
│ ├── pom.xml
│ ├── screenshot.png
│ └── src
│ │ ├── main
│ │ ├── java
│ │ │ └── de
│ │ │ │ └── saxsys
│ │ │ │ └── mvvmfx
│ │ │ │ └── examples
│ │ │ │ └── books
│ │ │ │ ├── App.java
│ │ │ │ ├── BookListItemView.fxml
│ │ │ │ ├── BookListItemView.java
│ │ │ │ ├── BookListItemViewModel.java
│ │ │ │ ├── MainView.fxml
│ │ │ │ ├── MainView.java
│ │ │ │ ├── MainViewModel.java
│ │ │ │ ├── backend
│ │ │ │ ├── Book.java
│ │ │ │ ├── Error.java
│ │ │ │ ├── HalUtil.java
│ │ │ │ ├── LibraryService.java
│ │ │ │ ├── LibraryServiceImpl.java
│ │ │ │ └── LibraryServiceMockImpl.java
│ │ │ │ └── style.css
│ │ └── resources
│ │ │ └── logback.xml
│ │ └── test
│ │ └── java
│ │ └── de
│ │ └── saxsys
│ │ └── mvvmfx
│ │ └── examples
│ │ └── books
│ │ ├── BooksExampleIT.java
│ │ ├── MainViewModelTest.java
│ │ └── backend
│ │ └── LibraryServiceMockTest.java
├── contacts-example
│ ├── README.md
│ ├── about.png
│ ├── address_form.png
│ ├── app.png
│ ├── contact_form.png
│ ├── pom.xml
│ └── src
│ │ ├── main
│ │ ├── java
│ │ │ └── de
│ │ │ │ └── saxsys
│ │ │ │ └── mvvmfx
│ │ │ │ └── examples
│ │ │ │ └── contacts
│ │ │ │ ├── App.java
│ │ │ │ ├── config
│ │ │ │ └── ResourceProvider.java
│ │ │ │ ├── events
│ │ │ │ ├── ContactsUpdatedEvent.java
│ │ │ │ ├── TriggerShutdownEvent.java
│ │ │ │ └── package-info.java
│ │ │ │ ├── model
│ │ │ │ ├── Address.java
│ │ │ │ ├── Contact.java
│ │ │ │ ├── ContactFactory.java
│ │ │ │ ├── Countries.java
│ │ │ │ ├── Country.java
│ │ │ │ ├── Identity.java
│ │ │ │ ├── InmemoryRepository.java
│ │ │ │ ├── Repository.java
│ │ │ │ ├── Subdivision.java
│ │ │ │ └── countries
│ │ │ │ │ ├── CountrySelector.java
│ │ │ │ │ ├── DataFxCountrySelector.java
│ │ │ │ │ ├── DomCountrySelector.java
│ │ │ │ │ ├── ISO3166_2_CountryEntity.java
│ │ │ │ │ ├── ISO3166_2_Entries.java
│ │ │ │ │ ├── ISO3166_2_EntryEntity.java
│ │ │ │ │ ├── ISO3166_2_SubsetEntity.java
│ │ │ │ │ └── JAXBCountrySelector.java
│ │ │ │ ├── ui
│ │ │ │ ├── about
│ │ │ │ │ ├── AboutAuthorView.fxml
│ │ │ │ │ ├── AboutAuthorView.java
│ │ │ │ │ ├── AboutAuthorViewModel.java
│ │ │ │ │ ├── AboutView.fxml
│ │ │ │ │ ├── AboutView.java
│ │ │ │ │ ├── AboutViewModel.java
│ │ │ │ │ └── profile_manuel.png
│ │ │ │ ├── addcontact
│ │ │ │ │ ├── AddContactDialogView.fxml
│ │ │ │ │ ├── AddContactDialogView.java
│ │ │ │ │ └── AddContactDialogViewModel.java
│ │ │ │ ├── addressform
│ │ │ │ │ ├── AddressFormView.fxml
│ │ │ │ │ ├── AddressFormView.java
│ │ │ │ │ └── AddressFormViewModel.java
│ │ │ │ ├── contactdialog
│ │ │ │ │ ├── ContactDialogView.fxml
│ │ │ │ │ ├── ContactDialogView.java
│ │ │ │ │ └── ContactDialogViewModel.java
│ │ │ │ ├── contactform
│ │ │ │ │ ├── ContactFormView.fxml
│ │ │ │ │ ├── ContactFormView.java
│ │ │ │ │ └── ContactFormViewModel.java
│ │ │ │ ├── detail
│ │ │ │ │ ├── DetailView.fxml
│ │ │ │ │ ├── DetailView.java
│ │ │ │ │ └── DetailViewModel.java
│ │ │ │ ├── editcontact
│ │ │ │ │ ├── EditContactDialogView.fxml
│ │ │ │ │ ├── EditContactDialogView.java
│ │ │ │ │ └── EditContactDialogViewModel.java
│ │ │ │ ├── main
│ │ │ │ │ ├── MainView.fxml
│ │ │ │ │ ├── MainView.java
│ │ │ │ │ └── MainViewModel.java
│ │ │ │ ├── master
│ │ │ │ │ ├── MasterTableViewModel.java
│ │ │ │ │ ├── MasterView.fxml
│ │ │ │ │ ├── MasterView.java
│ │ │ │ │ └── MasterViewModel.java
│ │ │ │ ├── menu
│ │ │ │ │ ├── MenuView.fxml
│ │ │ │ │ ├── MenuView.java
│ │ │ │ │ └── MenuViewModel.java
│ │ │ │ ├── scopes
│ │ │ │ │ ├── ContactDialogScope.java
│ │ │ │ │ └── MasterDetailScope.java
│ │ │ │ ├── toolbar
│ │ │ │ │ ├── ToolbarView.fxml
│ │ │ │ │ ├── ToolbarView.java
│ │ │ │ │ └── ToolbarViewModel.java
│ │ │ │ └── validators
│ │ │ │ │ ├── BirthdayValidator.java
│ │ │ │ │ ├── EmailValidator.java
│ │ │ │ │ └── PhoneValidator.java
│ │ │ │ └── util
│ │ │ │ ├── CentralClock.java
│ │ │ │ └── DialogHelper.java
│ │ └── resources
│ │ │ ├── META-INF
│ │ │ └── beans.xml
│ │ │ ├── contacts.css
│ │ │ ├── countries
│ │ │ ├── iso_3166.xml
│ │ │ ├── iso_3166_2.xml
│ │ │ └── readme.md
│ │ │ ├── default_de.properties
│ │ │ ├── default_en.properties
│ │ │ ├── logback.xml
│ │ │ ├── menu_de.properties
│ │ │ └── menu_en.properties
│ │ └── test
│ │ ├── java
│ │ └── de
│ │ │ └── saxsys
│ │ │ └── mvvmfx
│ │ │ └── examples
│ │ │ └── contacts
│ │ │ ├── AppTestFxIT.java
│ │ │ ├── model
│ │ │ ├── countries
│ │ │ │ ├── CountrySelectorInterfaceTest.java
│ │ │ │ ├── DataFxCountrySelectorIntegrationTest.java
│ │ │ │ ├── DomCountrySelectorIntegrationTest.java
│ │ │ │ └── JAXBCountrySelectorIntegrationTest.java
│ │ │ └── validation
│ │ │ │ ├── BirthdayValidatorTest.java
│ │ │ │ ├── EmailAddressValidatorTest.java
│ │ │ │ └── PhoneNumberValidatorTest.java
│ │ │ └── ui
│ │ │ ├── about
│ │ │ └── AboutViewModelTest.java
│ │ │ ├── addressform
│ │ │ └── AddressFormViewModelTest.java
│ │ │ ├── contactdialog
│ │ │ ├── ContactDialogViewModelTest.java
│ │ │ └── ContactFormViewModelTest.java
│ │ │ ├── detail
│ │ │ └── DetailViewModelTest.java
│ │ │ ├── editcontact
│ │ │ └── EditContactDialogViewModelTest.java
│ │ │ └── master
│ │ │ ├── MasterTableViewModelTest.java
│ │ │ └── MasterViewModelTest.java
│ │ └── resources
│ │ └── countries
│ │ ├── iso_3166.xml
│ │ └── iso_3166_2.xml
├── jigsaw-example
│ ├── README.md
│ ├── app
│ │ ├── pom.xml
│ │ └── src
│ │ │ └── main
│ │ │ ├── java
│ │ │ ├── de
│ │ │ │ └── saxsys
│ │ │ │ │ └── mvvmfx
│ │ │ │ │ └── examples
│ │ │ │ │ └── jigsaw
│ │ │ │ │ └── app
│ │ │ │ │ ├── AppView.java
│ │ │ │ │ ├── AppViewModel.java
│ │ │ │ │ └── Main.java
│ │ │ └── module-info.java
│ │ │ └── resources
│ │ │ ├── app_de_DE.properties
│ │ │ ├── app_en.properties
│ │ │ └── de
│ │ │ └── saxsys
│ │ │ └── mvvmfx
│ │ │ └── examples
│ │ │ └── jigsaw
│ │ │ └── app
│ │ │ └── AppView.fxml
│ ├── circle
│ │ ├── pom.xml
│ │ └── src
│ │ │ └── main
│ │ │ ├── java
│ │ │ ├── de
│ │ │ │ └── saxsys
│ │ │ │ │ └── mvvmfx
│ │ │ │ │ └── examples
│ │ │ │ │ └── jigsaw
│ │ │ │ │ └── circle
│ │ │ │ │ ├── CircleView.java
│ │ │ │ │ └── CircleViewModel.java
│ │ │ └── module-info.java
│ │ │ └── resources
│ │ │ ├── circle_de.properties
│ │ │ ├── circle_en.properties
│ │ │ └── de
│ │ │ └── saxsys
│ │ │ └── mvvmfx
│ │ │ └── examples
│ │ │ └── jigsaw
│ │ │ └── circle
│ │ │ ├── CircleView.css
│ │ │ └── CircleView.fxml
│ ├── pom.xml
│ └── rectangle
│ │ ├── pom.xml
│ │ └── src
│ │ └── main
│ │ ├── java
│ │ ├── de
│ │ │ └── saxsys
│ │ │ │ └── mvvmfx
│ │ │ │ └── examples
│ │ │ │ └── jigsaw
│ │ │ │ └── rectangle
│ │ │ │ ├── RectangleView.java
│ │ │ │ └── RectangleViewModel.java
│ │ └── module-info.java
│ │ └── resources
│ │ ├── de
│ │ └── saxsys
│ │ │ └── mvvmfx
│ │ │ └── examples
│ │ │ └── jigsaw
│ │ │ └── rectangle
│ │ │ ├── Rectangle.css
│ │ │ └── RectangleView.fxml
│ │ ├── rectangle_de.properties
│ │ └── rectangle_en.properties
├── mini-examples
│ ├── async-todoapp-futures
│ │ ├── pom.xml
│ │ └── src
│ │ │ └── main
│ │ │ ├── java
│ │ │ └── de
│ │ │ │ └── saxsys
│ │ │ │ └── mvvmfx
│ │ │ │ └── examples
│ │ │ │ └── async_todoapp_futures
│ │ │ │ ├── App.java
│ │ │ │ ├── model
│ │ │ │ ├── TodoItem.java
│ │ │ │ ├── TodoItemService.java
│ │ │ │ └── TodoItemServiceImpl.java
│ │ │ │ └── ui
│ │ │ │ ├── ControlsView.java
│ │ │ │ ├── ControlsViewModel.java
│ │ │ │ ├── ItemListView.java
│ │ │ │ ├── ItemListViewModel.java
│ │ │ │ ├── ListItem.java
│ │ │ │ ├── MainView.java
│ │ │ │ ├── MainViewModel.java
│ │ │ │ └── TodoScope.java
│ │ │ └── resources
│ │ │ └── de
│ │ │ └── saxsys
│ │ │ └── mvvmfx
│ │ │ └── examples
│ │ │ └── async_todoapp_futures
│ │ │ └── ui
│ │ │ ├── ControlsView.fxml
│ │ │ ├── ItemList.fxml
│ │ │ └── MainView.fxml
│ ├── fx-root-example
│ │ ├── README.md
│ │ ├── pom.xml
│ │ └── src
│ │ │ ├── main
│ │ │ ├── java
│ │ │ │ └── de
│ │ │ │ │ └── saxsys
│ │ │ │ │ └── mvvmfx
│ │ │ │ │ └── examples
│ │ │ │ │ └── fx_root_example
│ │ │ │ │ ├── LabeledTextField.java
│ │ │ │ │ ├── LabeledTextFieldViewModel.java
│ │ │ │ │ └── Starter.java
│ │ │ └── resources
│ │ │ │ └── de
│ │ │ │ └── saxsys
│ │ │ │ └── mvvmfx
│ │ │ │ └── examples
│ │ │ │ └── fx_root_example
│ │ │ │ └── LabeledTextField.fxml
│ │ │ └── test
│ │ │ └── java
│ │ │ └── de
│ │ │ └── saxsys
│ │ │ └── mvvmfx
│ │ │ └── examples
│ │ │ └── fx_root_example
│ │ │ ├── IntegrationTestWithTestFX.java
│ │ │ └── LabeledTextFieldTest.java
│ ├── helloworld-custom-fxml-path
│ │ ├── README.md
│ │ ├── pom.xml
│ │ └── src
│ │ │ └── main
│ │ │ ├── java
│ │ │ └── de
│ │ │ │ └── saxsys
│ │ │ │ └── mvvmfx
│ │ │ │ └── examples
│ │ │ │ └── helloworld
│ │ │ │ ├── HelloView.java
│ │ │ │ ├── HelloViewModel.java
│ │ │ │ └── Starter.java
│ │ │ └── resources
│ │ │ └── some
│ │ │ └── other
│ │ │ └── path
│ │ │ └── HalloWelt.fxml
│ ├── helloworld-spring-boot
│ │ ├── README.md
│ │ ├── pom.xml
│ │ └── src
│ │ │ └── main
│ │ │ └── java
│ │ │ └── de
│ │ │ └── saxsys
│ │ │ └── mvvmfx
│ │ │ └── examples
│ │ │ └── helloworld
│ │ │ ├── App.java
│ │ │ ├── service
│ │ │ ├── GreetingService.java
│ │ │ └── GreetingServiceImpl.java
│ │ │ └── view
│ │ │ ├── HelloView.fxml
│ │ │ ├── HelloView.java
│ │ │ └── HelloViewModel.java
│ ├── helloworld-without-fxml
│ │ ├── pom.xml
│ │ └── src
│ │ │ └── main
│ │ │ └── java
│ │ │ └── de
│ │ │ └── saxsys
│ │ │ └── mvvmfx
│ │ │ └── examples
│ │ │ └── helloworld
│ │ │ ├── HelloWorldView.java
│ │ │ ├── HelloWorldViewModel.java
│ │ │ └── Starter.java
│ ├── helloworld
│ │ ├── README.md
│ │ ├── pom.xml
│ │ └── src
│ │ │ └── main
│ │ │ ├── java
│ │ │ └── de
│ │ │ │ └── saxsys
│ │ │ │ └── mvvmfx
│ │ │ │ └── examples
│ │ │ │ └── helloworld
│ │ │ │ ├── HelloWorldView.java
│ │ │ │ ├── HelloWorldViewModel.java
│ │ │ │ └── Starter.java
│ │ │ └── resources
│ │ │ └── de
│ │ │ └── saxsys
│ │ │ └── mvvmfx
│ │ │ └── examples
│ │ │ └── helloworld
│ │ │ └── HelloWorldView.fxml
│ ├── pom.xml
│ ├── scopes-example
│ │ ├── pom.xml
│ │ └── src
│ │ │ └── main
│ │ │ └── java
│ │ │ └── de
│ │ │ └── saxsys
│ │ │ └── mvvmfx
│ │ │ └── examples
│ │ │ └── scopesexample
│ │ │ ├── App.java
│ │ │ ├── model
│ │ │ ├── Document.java
│ │ │ ├── DocumentRepository.java
│ │ │ └── Entity.java
│ │ │ └── ui
│ │ │ ├── MainView.fxml
│ │ │ ├── MainView.java
│ │ │ ├── MainViewModel.java
│ │ │ ├── documentdetails
│ │ │ ├── DetailsScope.java
│ │ │ ├── DocumentDetailsView.fxml
│ │ │ ├── DocumentDetailsView.java
│ │ │ ├── DocumentDetailsViewModel.java
│ │ │ └── descriptionedit
│ │ │ │ ├── DescriptionEditView.fxml
│ │ │ │ ├── DescriptionEditView.java
│ │ │ │ └── DescriptionEditViewModel.java
│ │ │ └── overview
│ │ │ ├── OverviewScope.java
│ │ │ ├── OverviewView.fxml
│ │ │ ├── OverviewView.java
│ │ │ ├── OverviewViewModel.java
│ │ │ ├── detail
│ │ │ ├── OverviewDetailView.fxml
│ │ │ ├── OverviewDetailView.java
│ │ │ └── OverviewDetailViewModel.java
│ │ │ └── master
│ │ │ ├── OverviewMasterView.fxml
│ │ │ ├── OverviewMasterView.java
│ │ │ └── OverviewMasterViewModel.java
│ ├── synchronizefx-example
│ │ ├── README.md
│ │ ├── pom.xml
│ │ └── src
│ │ │ └── main
│ │ │ ├── java
│ │ │ └── de
│ │ │ │ └── saxsys
│ │ │ │ └── mvvmfx
│ │ │ │ └── examples
│ │ │ │ └── synchronize
│ │ │ │ ├── ClientApp.java
│ │ │ │ ├── ServerApp.java
│ │ │ │ ├── SliderView.java
│ │ │ │ └── SliderViewModel.java
│ │ │ └── resources
│ │ │ └── de
│ │ │ └── saxsys
│ │ │ └── mvvmfx
│ │ │ └── examples
│ │ │ └── synchronize
│ │ │ └── SliderView.fxml
│ └── welcome-example
│ │ ├── README.md
│ │ ├── pom.xml
│ │ └── src
│ │ ├── main
│ │ ├── java
│ │ │ └── de
│ │ │ │ └── saxsys
│ │ │ │ └── mvvmfx
│ │ │ │ └── examples
│ │ │ │ └── welcome
│ │ │ │ ├── CdiStarter.java
│ │ │ │ ├── GuiceStarter.java
│ │ │ │ ├── model
│ │ │ │ ├── Gender.java
│ │ │ │ ├── Person.java
│ │ │ │ └── Repository.java
│ │ │ │ ├── view
│ │ │ │ ├── maincontainer
│ │ │ │ │ └── MainContainerView.java
│ │ │ │ ├── personlogin
│ │ │ │ │ └── PersonLoginView.java
│ │ │ │ └── personwelcome
│ │ │ │ │ └── PersonWelcomeView.java
│ │ │ │ └── viewmodel
│ │ │ │ ├── maincontainer
│ │ │ │ └── MainContainerViewModel.java
│ │ │ │ ├── personlogin
│ │ │ │ ├── PersonLoginViewModel.java
│ │ │ │ └── PersonLoginViewModelNotifications.java
│ │ │ │ └── personwelcome
│ │ │ │ └── PersonWelcomeViewModel.java
│ │ └── resources
│ │ │ ├── META-INF
│ │ │ └── beans.xml
│ │ │ └── de
│ │ │ └── saxsys
│ │ │ └── mvvmfx
│ │ │ └── examples
│ │ │ └── welcome
│ │ │ └── view
│ │ │ ├── maincontainer
│ │ │ └── MainContainerView.fxml
│ │ │ ├── personlogin
│ │ │ └── PersonLoginView.fxml
│ │ │ └── personwelcome
│ │ │ └── PersonWelcomeView.fxml
│ │ └── test
│ │ └── java
│ │ └── de
│ │ └── saxsys
│ │ └── mvvmfx
│ │ └── viewmodel
│ │ ├── personlogin
│ │ └── PersonLoginViewModelTest.java
│ │ └── personwelcome
│ │ └── PersonWelcomeViewModelTest.java
├── pom.xml
└── todomvc-example
│ ├── README.md
│ ├── pom.xml
│ ├── screenshot.png
│ └── src
│ └── main
│ └── java
│ └── de
│ └── saxsys
│ └── mvvmfx
│ └── examples
│ └── todomvc
│ ├── App.java
│ ├── model
│ ├── TodoItem.java
│ └── TodoItemStore.java
│ └── ui
│ ├── FilterHelper.java
│ ├── MainView.fxml
│ ├── MainView.java
│ ├── MainViewModel.java
│ ├── additems
│ ├── AddItemsView.fxml
│ ├── AddItemsView.java
│ ├── AddItemsViewModel.java
│ └── additems.css
│ ├── controls
│ ├── ControlsView.fxml
│ ├── ControlsView.java
│ └── ControlsViewModel.java
│ ├── item
│ ├── ItemOverviewView.fxml
│ ├── ItemOverviewView.java
│ ├── ItemOverviewViewModel.java
│ ├── ItemView.fxml
│ ├── ItemView.java
│ ├── ItemViewModel.java
│ └── itemview.css
│ └── main.css
├── mvvmfx-archetype
├── README.md
├── pom.xml
└── src
│ └── main
│ └── resources
│ ├── META-INF
│ └── maven
│ │ └── archetype-metadata.xml
│ └── archetype-resources
│ ├── pom.xml
│ └── src
│ └── main
│ ├── java
│ ├── HelloWorldView.java
│ ├── HelloWorldViewModel.java
│ └── Starter.java
│ └── resources
│ └── HelloWorldView.fxml
├── mvvmfx-cdi
├── README.md
├── pom.xml
└── src
│ ├── main
│ ├── java
│ │ └── de
│ │ │ └── saxsys
│ │ │ └── mvvmfx
│ │ │ └── cdi
│ │ │ ├── MvvmfxCdiApplication.java
│ │ │ └── internal
│ │ │ └── MvvmfxProducer.java
│ └── resources
│ │ └── META-INF
│ │ └── beans.xml
│ └── test
│ ├── java
│ └── de
│ │ └── saxsys
│ │ └── mvvmfx
│ │ └── cdi
│ │ └── it
│ │ ├── IntegrationTest.java
│ │ ├── MyApp.java
│ │ ├── MyService.java
│ │ ├── MyView.java
│ │ └── MyViewModel.java
│ └── resources
│ ├── META-INF
│ └── beans.xml
│ └── de
│ └── saxsys
│ └── mvvmfx
│ └── cdi
│ └── it
│ └── MyView.fxml
├── mvvmfx-easydi
├── README.md
├── pom.xml
└── src
│ └── main
│ └── java
│ └── de
│ └── saxsys
│ └── mvvmfx
│ └── easydi
│ └── MvvmfxEasyDIApplication.java
├── mvvmfx-guice
├── README.md
├── pom.xml
└── src
│ ├── main
│ └── java
│ │ └── de
│ │ └── saxsys
│ │ └── mvvmfx
│ │ └── guice
│ │ ├── MvvmfxGuiceApplication.java
│ │ └── internal
│ │ ├── GuiceInjector.java
│ │ └── MvvmfxModule.java
│ └── test
│ ├── java
│ └── de
│ │ └── saxsys
│ │ └── mvvmfx
│ │ └── guice
│ │ ├── DuplicateInjectionBugTest.java
│ │ ├── interceptiontest
│ │ ├── InterceptedView.java
│ │ ├── InterceptedViewModel.java
│ │ ├── InterceptorModule.java
│ │ ├── InterceptorTest.java
│ │ ├── InterceptorTestApp.java
│ │ └── TestInterceptor.java
│ │ └── it
│ │ ├── IntegrationTest.java
│ │ ├── MyApp.java
│ │ ├── MyModule.java
│ │ ├── MyService.java
│ │ ├── MyServiceImpl.java
│ │ ├── MyView.java
│ │ └── MyViewModel.java
│ └── resources
│ └── de
│ └── saxsys
│ └── mvvmfx
│ └── guice
│ ├── interceptiontest
│ └── InterceptedView.fxml
│ └── it
│ └── MyView.fxml
├── mvvmfx-spring-boot
├── README.md
├── pom.xml
└── src
│ ├── main
│ └── java
│ │ └── de
│ │ └── saxsys
│ │ └── mvvmfx
│ │ └── spring
│ │ └── MvvmfxSpringApplication.java
│ └── test
│ ├── java
│ └── de
│ │ └── saxsys
│ │ └── mvvmfx
│ │ └── spring
│ │ ├── IntegrationTest.java
│ │ ├── MyApp.java
│ │ ├── MyService.java
│ │ ├── MyView.java
│ │ └── MyViewModel.java
│ └── resources
│ └── de
│ └── saxsys
│ └── mvvmfx
│ └── spring
│ └── MyView.fxml
├── mvvmfx-testing-utils
├── README.md
├── pom.xml
└── src
│ ├── main
│ └── java
│ │ └── de
│ │ └── saxsys
│ │ └── mvvmfx
│ │ └── testingutils
│ │ ├── ExceptionUtils.java
│ │ ├── FxTestingUtils.java
│ │ ├── GCVerifier.java
│ │ ├── JfxToolkitExtension.java
│ │ └── jfxrunner
│ │ ├── JfxRunner.java
│ │ └── TestInJfxThread.java
│ └── test
│ └── java
│ └── de
│ └── saxsys
│ └── mvvmfx
│ └── testingutils
│ ├── GCVerifierTest.java
│ ├── Junit5Test.java
│ └── jfxrunner
│ ├── AnotherJfxRunnerTest.java
│ ├── JfxRunnerTest.java
│ └── TestFxTest.java
├── mvvmfx-utils
├── README.md
├── pom.xml
└── src
│ ├── main
│ └── java
│ │ └── de
│ │ └── saxsys
│ │ └── mvvmfx
│ │ └── utils
│ │ ├── listener
│ │ ├── ICleanable.java
│ │ ├── ListenerManager.java
│ │ └── package-info.java
│ │ └── sizebinding
│ │ ├── SizeBindingsBuilder.java
│ │ ├── internal
│ │ ├── BindHeightBuilderStepImpl.java
│ │ ├── BindSizeBuilderStepImpl.java
│ │ ├── BindWidthBuilderStepImpl.java
│ │ ├── UnbindHeightBuilderStepImpl.java
│ │ ├── UnbindSizeBuilderStepImpl.java
│ │ ├── UnbindWidthBuilderStepImpl.java
│ │ └── package-info.java
│ │ └── package-info.java
│ └── test
│ └── java
│ └── de
│ └── saxsys
│ └── mvvmfx
│ └── utils
│ ├── listener
│ └── ListenerManagerTest.java
│ └── sizebinding
│ ├── BindSizeToControlTest.java
│ ├── BindSizeToImageViewTest.java
│ ├── BindSizeToRectangleTest.java
│ ├── BindSizeToRegionTest.java
│ ├── SizeBindingsBuilderTestBase.java
│ ├── UnbindHeightTest.java
│ ├── UnbindSizeTest.java
│ └── UnbindWidthTest.java
├── mvvmfx-validation
├── README.md
├── pom.xml
└── src
│ ├── main
│ └── java
│ │ └── de
│ │ └── saxsys
│ │ └── mvvmfx
│ │ └── utils
│ │ └── validation
│ │ ├── CompositeValidationStatus.java
│ │ ├── CompositeValidator.java
│ │ ├── FunctionBasedValidator.java
│ │ ├── ObservableRuleBasedValidator.java
│ │ ├── ObservableRules.java
│ │ ├── Severity.java
│ │ ├── ValidationMessage.java
│ │ ├── ValidationStatus.java
│ │ ├── Validator.java
│ │ └── visualization
│ │ ├── ControlsFxVisualizer.java
│ │ ├── ValidationVisualizer.java
│ │ └── ValidationVisualizerBase.java
│ └── test
│ ├── java
│ └── de
│ │ └── saxsys
│ │ └── mvvmfx
│ │ └── utils
│ │ └── validation
│ │ ├── CompositeValidatorTest.java
│ │ ├── CustomValidationMessageTest.java
│ │ ├── FunctionBasedValidatorTest.java
│ │ ├── HighestMessageBugTest.java
│ │ ├── ObservableRulesTest.java
│ │ ├── ObservableRulesValidatorTest.java
│ │ ├── TestApp.java
│ │ ├── ValidationMessageTest.java
│ │ ├── ValidationStatusTest.java
│ │ ├── crossfieldexample
│ │ ├── CrossFieldExampleApp.java
│ │ ├── RegisterFormView.java
│ │ └── RegisterFormViewModel.java
│ │ └── cssvisualizer
│ │ ├── CssVisualizer.java
│ │ ├── CssVisualizerExampleApp.java
│ │ ├── CssVisualizerView.java
│ │ ├── CssVisualizerViewModel.java
│ │ └── package-info.java
│ └── resources
│ └── de
│ └── saxsys
│ └── mvvmfx
│ └── utils
│ └── validation
│ └── cssvisualizer
│ ├── CssVisualizerView.fxml
│ └── style.css
├── mvvmfx
├── README.md
├── pom.xml
└── src
│ ├── main
│ └── java
│ │ └── de
│ │ └── saxsys
│ │ └── mvvmfx
│ │ ├── Context.java
│ │ ├── FluentViewLoader.java
│ │ ├── FxmlPath.java
│ │ ├── FxmlView.java
│ │ ├── Initialize.java
│ │ ├── InjectContext.java
│ │ ├── InjectResourceBundle.java
│ │ ├── InjectScope.java
│ │ ├── InjectViewModel.java
│ │ ├── JavaView.java
│ │ ├── MvvmFX.java
│ │ ├── SceneLifecycle.java
│ │ ├── Scope.java
│ │ ├── ScopeProvider.java
│ │ ├── ViewModel.java
│ │ ├── ViewTuple.java
│ │ ├── internal
│ │ ├── ContextImpl.java
│ │ ├── MvvmfxApplication.java
│ │ ├── SideEffect.java
│ │ ├── SideEffectWithException.java
│ │ ├── WeakValueHashMap.java
│ │ ├── package-info.java
│ │ └── viewloader
│ │ │ ├── DependencyInjector.java
│ │ │ ├── FxmlViewLoader.java
│ │ │ ├── GlobalBuilderFactory.java
│ │ │ ├── JavaViewLoader.java
│ │ │ ├── PreventGarbageCollectionStore.java
│ │ │ ├── ReflectionUtils.java
│ │ │ ├── ResourceBundleInjector.java
│ │ │ ├── ResourceBundleManager.java
│ │ │ ├── View.java
│ │ │ ├── ViewLoaderReflectionUtils.java
│ │ │ ├── ViewLoaderScopeUtils.java
│ │ │ └── package-info.java
│ │ ├── package-info.java
│ │ └── utils
│ │ ├── commands
│ │ ├── Action.java
│ │ ├── Command.java
│ │ ├── CommandBase.java
│ │ ├── CompositeCommand.java
│ │ └── DelegateCommand.java
│ │ ├── itemlist
│ │ ├── ItemList.java
│ │ ├── ListTransformation.java
│ │ ├── ModelToStringFunction.java
│ │ ├── SelectableItemList.java
│ │ ├── SelectableStringList.java
│ │ └── package-info.java
│ │ ├── mapping
│ │ ├── BeanListPropertyField.java
│ │ ├── BeanMapPropertyField.java
│ │ ├── BeanPropertyField.java
│ │ ├── BeanSetPropertyField.java
│ │ ├── FxListPropertyField.java
│ │ ├── FxMapPropertyField.java
│ │ ├── FxPropertyField.java
│ │ ├── FxSetPropertyField.java
│ │ ├── ImmutableBeanPropertyField.java
│ │ ├── ImmutableListPropertyField.java
│ │ ├── ImmutableMapPropertyField.java
│ │ ├── ImmutablePropertyField.java
│ │ ├── ImmutableSetPropertyField.java
│ │ ├── ModelWrapper.java
│ │ ├── PropertyField.java
│ │ └── accessorfunctions
│ │ │ ├── BooleanGetter.java
│ │ │ ├── BooleanImmutableSetter.java
│ │ │ ├── BooleanPropertyAccessor.java
│ │ │ ├── BooleanSetter.java
│ │ │ ├── DoubleGetter.java
│ │ │ ├── DoubleImmutableSetter.java
│ │ │ ├── DoublePropertyAccessor.java
│ │ │ ├── DoubleSetter.java
│ │ │ ├── FloatGetter.java
│ │ │ ├── FloatImmutableSetter.java
│ │ │ ├── FloatPropertyAccessor.java
│ │ │ ├── FloatSetter.java
│ │ │ ├── IntGetter.java
│ │ │ ├── IntImmutableSetter.java
│ │ │ ├── IntPropertyAccessor.java
│ │ │ ├── IntSetter.java
│ │ │ ├── ListGetter.java
│ │ │ ├── ListImmutableSetter.java
│ │ │ ├── ListPropertyAccessor.java
│ │ │ ├── ListSetter.java
│ │ │ ├── LongGetter.java
│ │ │ ├── LongImmutableSetter.java
│ │ │ ├── LongPropertyAccessor.java
│ │ │ ├── LongSetter.java
│ │ │ ├── MapGetter.java
│ │ │ ├── MapImmutableSetter.java
│ │ │ ├── MapPropertyAccessor.java
│ │ │ ├── MapSetter.java
│ │ │ ├── ObjectGetter.java
│ │ │ ├── ObjectImmutableSetter.java
│ │ │ ├── ObjectPropertyAccessor.java
│ │ │ ├── ObjectSetter.java
│ │ │ ├── SetGetter.java
│ │ │ ├── SetImmutableSetter.java
│ │ │ ├── SetPropertyAccessor.java
│ │ │ ├── SetSetter.java
│ │ │ ├── StringGetter.java
│ │ │ ├── StringImmutableSetter.java
│ │ │ ├── StringPropertyAccessor.java
│ │ │ ├── StringSetter.java
│ │ │ └── package-info.java
│ │ ├── notifications
│ │ ├── DefaultNotificationCenter.java
│ │ ├── NotificationCenter.java
│ │ ├── NotificationCenterFactory.java
│ │ ├── NotificationObserver.java
│ │ ├── NotificationTestHelper.java
│ │ ├── ThreadlessNotificationTestHelper.java
│ │ ├── WeakNotificationObserver.java
│ │ └── package-info.java
│ │ ├── package-info.java
│ │ └── viewlist
│ │ ├── CachedViewModelCellFactory.java
│ │ ├── ViewListCell.java
│ │ ├── ViewListCellFactory.java
│ │ ├── ViewTupleMapper.java
│ │ └── package-info.java
│ └── test
│ ├── java
│ ├── FxmlViewInDefaultPackage.java
│ ├── FxmlViewinDefaultPackageTest.java
│ └── de
│ │ └── saxsys
│ │ └── mvvmfx
│ │ ├── internal
│ │ └── viewloader
│ │ │ ├── DependencyInjectorTest.java
│ │ │ ├── FluentViewLoader_API_Test.java
│ │ │ ├── FluentViewLoader_FxmlView_Test.java
│ │ │ ├── FluentViewLoader_JavaView_Test.java
│ │ │ ├── FluentViewLoader_ResourceBundle_Test.java
│ │ │ ├── MockableViewLoaderTest.java
│ │ │ ├── ResourceBundleAssert.java
│ │ │ ├── ResourceBundleInjectorTest.java
│ │ │ ├── ResourceBundleManagerTest.java
│ │ │ ├── ViewLoaderReflectionUtilsTest.java
│ │ │ ├── builderfactory
│ │ │ ├── BuilderFactoryTest.java
│ │ │ ├── BuilderFactoryTestView.java
│ │ │ ├── BuilderFactoryTestViewModel.java
│ │ │ └── CustomTextField.java
│ │ │ ├── example
│ │ │ ├── InvalidFxmlTestView.java
│ │ │ ├── TestFxmlPathView.java
│ │ │ ├── TestFxmlView.java
│ │ │ ├── TestFxmlViewFxRoot.java
│ │ │ ├── TestFxmlViewModelAsController.java
│ │ │ ├── TestFxmlViewModelAsControllerChild.java
│ │ │ ├── TestFxmlViewModelAsControllerChildViewModel.java
│ │ │ ├── TestFxmlViewModelAsControllerParent.java
│ │ │ ├── TestFxmlViewModelAsControllerParentViewModel.java
│ │ │ ├── TestFxmlViewModelAsControllerViewModel.java
│ │ │ ├── TestFxmlViewModelAsControllerWithCustomPathView.java
│ │ │ ├── TestFxmlViewModelAsControllerWithCustomPathViewModel.java
│ │ │ ├── TestFxmlViewMultipleViewModels.java
│ │ │ ├── TestFxmlViewOnlyViewModelResourceBundle.java
│ │ │ ├── TestFxmlViewOnlyViewResourceBundle.java
│ │ │ ├── TestFxmlViewResourceBundle.java
│ │ │ ├── TestFxmlViewResourceBundleWithoutController.java
│ │ │ ├── TestFxmlViewWithActionMethod.java
│ │ │ ├── TestFxmlViewWithMissingController.java
│ │ │ ├── TestFxmlViewWithViewModelWithAnnotatedInitialize.java
│ │ │ ├── TestFxmlViewWithViewModelWithMultipleInitializeAnnotations.java
│ │ │ ├── TestFxmlViewWithViewModelWithMultipleInitializeMethods.java
│ │ │ ├── TestFxmlViewWithViewModelWithNonValidInitializeMethodViewWithArguments.java
│ │ │ ├── TestFxmlViewWithViewModelWithNonValidInitializeMethodViewWithBadReturnType.java
│ │ │ ├── TestFxmlViewWithWrongAnnotationUsage.java
│ │ │ ├── TestFxmlViewWithWrongController.java
│ │ │ ├── TestFxmlViewWithWrongInjectedViewModel.java
│ │ │ ├── TestFxmlViewWithoutViewModelField.java
│ │ │ ├── TestFxmlViewWithoutViewModelType.java
│ │ │ ├── TestFxmlViewWithoutViewModelTypeButWithInjection.java
│ │ │ ├── TestFxmlViewWithoutViewModelTypeButWithInjection2.java
│ │ │ ├── TestJavaView.java
│ │ │ ├── TestScope1.java
│ │ │ ├── TestScope2.java
│ │ │ ├── TestViewA.java
│ │ │ ├── TestViewB.java
│ │ │ ├── TestViewModel.java
│ │ │ ├── TestViewModelA.java
│ │ │ ├── TestViewModelB.java
│ │ │ ├── TestViewModelWithAnnotatedInitialize.java
│ │ │ ├── TestViewModelWithDoubleInjection.java
│ │ │ ├── TestViewModelWithMultipleInitializeAnnotations.java
│ │ │ ├── TestViewModelWithMultipleInitializeMethodsViewModel.java
│ │ │ ├── TestViewModelWithNonValidInitializeMethodWithArguments.java
│ │ │ ├── TestViewModelWithNonValidInitializeMethodWithBadReturnType.java
│ │ │ └── TestViewModelWithResourceBundle.java
│ │ │ └── lifecycle
│ │ │ ├── LifecycleTest.java
│ │ │ ├── example_basic
│ │ │ ├── LifecycleTestRootView.java
│ │ │ ├── LifecycleTestRootViewModel.java
│ │ │ ├── LifecycleTestSub1View.java
│ │ │ ├── LifecycleTestSub1ViewModel.java
│ │ │ ├── LifecycleTestSub2View.java
│ │ │ └── LifecycleTestSub2ViewModel.java
│ │ │ ├── example_gc
│ │ │ ├── LifecycleGCTestRootView.java
│ │ │ ├── LifecycleGCTestRootViewModel.java
│ │ │ ├── LifecycleGCTestSub1View.java
│ │ │ ├── LifecycleGCTestSub1ViewModel.java
│ │ │ ├── LifecycleGCTestSub2View.java
│ │ │ ├── LifecycleGCTestSub2ViewModel.java
│ │ │ └── package-info.java
│ │ │ ├── example_notification
│ │ │ ├── LifecycleNotificationView.java
│ │ │ ├── LifecycleNotificationViewModel.java
│ │ │ └── package-info.java
│ │ │ └── example_notification_without_lifecycle
│ │ │ ├── NotificationWithoutLifecycleView.java
│ │ │ ├── NotificationWithoutLifecycleViewModel.java
│ │ │ └── package-info.java
│ │ ├── resourcebundle
│ │ ├── global
│ │ │ ├── GlobalResourceBundleTest.java
│ │ │ ├── TestView.java
│ │ │ └── TestViewModel.java
│ │ └── included
│ │ │ ├── IncludedView.java
│ │ │ ├── IncludedViewModel.java
│ │ │ ├── IncludedViewsTest.java
│ │ │ ├── RootView.java
│ │ │ └── RootViewModel.java
│ │ ├── scopes
│ │ ├── context
│ │ │ ├── ContextTest.java
│ │ │ ├── TestScope.java
│ │ │ └── views
│ │ │ │ ├── ScopedFxmlView.java
│ │ │ │ └── ScopedFxmlViewModel.java
│ │ ├── example1
│ │ │ ├── Example1Scope1.java
│ │ │ ├── Example1Scope2.java
│ │ │ ├── Example1Scope3.java
│ │ │ ├── Example1ScopesTest.java
│ │ │ └── views
│ │ │ │ ├── ScopedFxmlViewA.java
│ │ │ │ ├── ScopedFxmlViewB.java
│ │ │ │ ├── ScopedFxmlViewC.java
│ │ │ │ ├── ScopedFxmlViewD.java
│ │ │ │ ├── ScopedFxmlViewE.java
│ │ │ │ ├── ScopedFxmlViewF.java
│ │ │ │ ├── ScopedFxmlViewG.java
│ │ │ │ ├── ScopedJavaViewA.java
│ │ │ │ ├── ScopedJavaViewB.java
│ │ │ │ ├── ScopedViewModelA.java
│ │ │ │ ├── ScopedViewModelB.java
│ │ │ │ ├── ScopedViewModelC.java
│ │ │ │ ├── ScopedViewModelD.java
│ │ │ │ ├── ScopedViewModelE.java
│ │ │ │ ├── ScopedViewModelF.java
│ │ │ │ ├── ScopedViewModelG.java
│ │ │ │ └── ScopesFxmlParentView.java
│ │ ├── example2
│ │ │ ├── Example2Scope1.java
│ │ │ ├── Example2ScopesTest.java
│ │ │ └── views
│ │ │ │ ├── ScopedViewA.java
│ │ │ │ ├── ScopedViewB.java
│ │ │ │ ├── ScopedViewC.java
│ │ │ │ ├── ScopedViewModelA.java
│ │ │ │ ├── ScopedViewModelB.java
│ │ │ │ └── ScopedViewModelC.java
│ │ ├── example3
│ │ │ ├── Example3Scope.java
│ │ │ ├── Example3Test.java
│ │ │ └── views
│ │ │ │ ├── MainView.java
│ │ │ │ ├── MainViewModel.java
│ │ │ │ ├── content
│ │ │ │ ├── ContentView.java
│ │ │ │ └── ContentViewModel.java
│ │ │ │ └── menu
│ │ │ │ ├── MenuView.java
│ │ │ │ └── MenuViewModel.java
│ │ ├── example4
│ │ │ └── views
│ │ │ │ ├── ChildView.java
│ │ │ │ ├── ChildViewModel.java
│ │ │ │ ├── DialogScope.java
│ │ │ │ ├── DialogView.java
│ │ │ │ ├── DialogViewModel.java
│ │ │ │ ├── Example4Test.java
│ │ │ │ ├── ParentView.java
│ │ │ │ └── ParentViewModel.java
│ │ ├── example5
│ │ │ ├── Example5Scope.java
│ │ │ ├── Example5Test.java
│ │ │ ├── MyView.java
│ │ │ └── MyViewModel.java
│ │ ├── example6
│ │ │ ├── Example5App.java
│ │ │ ├── ParentView.java
│ │ │ ├── ParentViewModel.java
│ │ │ ├── TabScope.java
│ │ │ ├── TabView.java
│ │ │ └── TabViewModel.java
│ │ ├── injectionorder
│ │ │ ├── InjectionOrderTest.java
│ │ │ ├── TestScope.java
│ │ │ ├── TestView.java
│ │ │ └── TestViewModel.java
│ │ └── scope_in_view
│ │ │ ├── RootView.java
│ │ │ ├── RootViewModel.java
│ │ │ ├── ScopeInViewTest.java
│ │ │ ├── ScopeInViewTestView.java
│ │ │ ├── ScopeInViewTestViewModel.java
│ │ │ └── TestScope.java
│ │ └── utils
│ │ ├── commands
│ │ ├── CommandsWithoutUiThreadTest.java
│ │ ├── CompositeCommandTest.java
│ │ ├── DelegateCommandTest.java
│ │ └── testapp
│ │ │ ├── App.java
│ │ │ ├── MainView.java
│ │ │ ├── MainViewModel.java
│ │ │ ├── Service.java
│ │ │ ├── SubView.java
│ │ │ └── SubViewModel.java
│ │ ├── itemlist
│ │ ├── ItemListTest.java
│ │ ├── ListTransformationTest.java
│ │ ├── Person.java
│ │ └── SelectableItemListTest.java
│ │ ├── mapping
│ │ ├── ExampleModel.java
│ │ ├── FieldMethodOverloadingTest.java
│ │ ├── ModelWrapperTest.java
│ │ ├── Person.java
│ │ ├── PersonFX.java
│ │ └── PersonImmutable.java
│ │ └── notifications
│ │ ├── ClearNotificationCenterTest.java
│ │ ├── ConcurrentModificationBugTest.java
│ │ ├── DefaultNotificationCenterTest.java
│ │ ├── MemoryLeakGlobalTest.java
│ │ ├── NotificationTestHelperTest.java
│ │ ├── ResetNotificationCenterTest.java
│ │ ├── ThreadlessNotificationTestHelperTest.java
│ │ └── viewmodel
│ │ ├── MemoryLeakOnViewModelTest.java
│ │ ├── MemoryLeakView.java
│ │ ├── MemoryLeakViewModel.java
│ │ ├── ViewModelTest.java
│ │ ├── ViewModelWithoutUiThreadTest.java
│ │ └── WeakNotificationsTest.java
│ └── resources
│ ├── FxmlViewInDefaultPackage.fxml
│ └── de
│ └── saxsys
│ └── mvvmfx
│ ├── internal
│ └── viewloader
│ │ ├── builderfactory
│ │ └── BuilderFactoryTestView.fxml
│ │ ├── example
│ │ ├── TestFxmlImplicitInitView.fxml
│ │ ├── TestFxmlView.fxml
│ │ ├── TestFxmlViewFxRoot.fxml
│ │ ├── TestFxmlViewModelAsController.fxml
│ │ ├── TestFxmlViewModelAsControllerChild.fxml
│ │ ├── TestFxmlViewModelAsControllerParent.fxml
│ │ ├── TestFxmlViewModelAsControllerWithCustomPath.fxml
│ │ ├── TestFxmlViewMultipleViewModels.fxml
│ │ ├── TestFxmlViewOnlyViewModelResourceBundle.fxml
│ │ ├── TestFxmlViewOnlyViewResourceBundle.fxml
│ │ ├── TestFxmlViewResourceBundle.fxml
│ │ ├── TestFxmlViewResourceBundleWithoutController.fxml
│ │ ├── TestFxmlViewWithActionMethod.fxml
│ │ ├── TestFxmlViewWithCustomPath.fxml
│ │ ├── TestFxmlViewWithMissingController.fxml
│ │ ├── TestFxmlViewWithViewModelWithAnnotatedInitialize.fxml
│ │ ├── TestFxmlViewWithViewModelWithMultipleInitializeAnnotations.fxml
│ │ ├── TestFxmlViewWithViewModelWithMultipleInitializeMethods.fxml
│ │ ├── TestFxmlViewWithViewModelWithNonValidInitializeMethodViewWithArguments.fxml
│ │ ├── TestFxmlViewWithViewModelWithNonValidInitializeMethodViewWithBadReturnType.fxml
│ │ ├── TestFxmlViewWithWrongAnnotationUsage.fxml
│ │ ├── TestFxmlViewWithWrongController.fxml
│ │ ├── TestFxmlViewWithWrongInjectedViewModel.fxml
│ │ ├── TestFxmlViewWithoutController.fxml
│ │ ├── TestFxmlViewWithoutViewModelField.fxml
│ │ ├── TestFxmlViewWithoutViewModelType.fxml
│ │ ├── TestFxmlViewWithoutViewModelTypeButWithInjection.fxml
│ │ ├── TestFxmlViewWithoutViewModelTypeButWithInjection2.fxml
│ │ ├── TestViewA.fxml
│ │ ├── TestViewB.fxml
│ │ ├── testResourceBundle.properties
│ │ └── wrong.fxml
│ │ └── lifecycle
│ │ ├── example_basic
│ │ ├── LifecycleTestRootView.fxml
│ │ ├── LifecycleTestSub1View.fxml
│ │ └── LifecycleTestSub2View.fxml
│ │ ├── example_gc
│ │ ├── LifecycleGCTestRootView.fxml
│ │ ├── LifecycleGCTestSub1View.fxml
│ │ └── LifecycleGCTestSub2View.fxml
│ │ ├── example_notification
│ │ └── LifecycleNotificationView.fxml
│ │ └── example_notification_without_lifecycle
│ │ └── NotificationWithoutLifecycleView.fxml
│ ├── resourcebundle
│ ├── global
│ │ ├── TestView.fxml
│ │ ├── global.properties
│ │ ├── other.properties
│ │ └── third.properties
│ └── included
│ │ ├── IncludedView.fxml
│ │ ├── RootView.fxml
│ │ ├── included.properties
│ │ └── root.properties
│ ├── scopes
│ ├── context
│ │ └── views
│ │ │ └── ScopedFxmlView.fxml
│ ├── example1
│ │ └── views
│ │ │ ├── ScopedFxmlViewA.fxml
│ │ │ ├── ScopedFxmlViewB.fxml
│ │ │ ├── ScopedFxmlViewC.fxml
│ │ │ ├── ScopedFxmlViewD.fxml
│ │ │ ├── ScopedFxmlViewE.fxml
│ │ │ ├── ScopedFxmlViewF.fxml
│ │ │ ├── ScopedFxmlViewG.fxml
│ │ │ └── ScopesFxmlParentView.fxml
│ ├── example2
│ │ └── views
│ │ │ ├── ScopedViewA.fxml
│ │ │ ├── ScopedViewB.fxml
│ │ │ └── ScopedViewC.fxml
│ ├── example3
│ │ └── views
│ │ │ ├── MainView.fxml
│ │ │ ├── content
│ │ │ └── ContentView.fxml
│ │ │ └── menu
│ │ │ └── MenuView.fxml
│ ├── example4
│ │ └── views
│ │ │ ├── ChildView.fxml
│ │ │ ├── DialogView.fxml
│ │ │ └── ParentView.fxml
│ ├── example5
│ │ └── MyView.fxml
│ ├── example6
│ │ ├── ParentView.fxml
│ │ └── TabView.fxml
│ ├── injectionorder
│ │ └── TestView.fxml
│ └── scope_in_view
│ │ ├── RootView.fxml
│ │ └── ScopeInViewTestView.fxml
│ └── utils
│ └── validation
│ └── crossfieldexample
│ └── RegisterFormView.fxml
├── mvvmfx_formatter.xml
├── pom.xml
└── travis_snapshot_release.sh
/.gitignore:
--------------------------------------------------------------------------------
1 | *.class
2 | target
3 | *.bak
4 |
5 | # eclipse #
6 | *.prefs
7 | .classpath
8 | .project
9 | .metadata
10 |
11 | # Package Files #
12 | *.jar
13 | *.war
14 | *.ear
15 | *.sha1
16 | *.sha1
17 | *.repositories
18 |
19 |
20 | # intelliJ #
21 | .idea
22 | *.iml
23 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: java
2 | dist: trusty
3 |
4 | sudo: false
5 |
6 | jdk:
7 | - oraclejdk8
8 |
9 | install: true
10 |
11 | addons:
12 | apt:
13 | packages:
14 | - oracle-java8-installer
15 |
16 | before_install:
17 | - export DISPLAY=:99.0
18 | - sh -e /etc/init.d/xvfb start
19 | - java -version
20 |
21 | env:
22 | global:
23 | - secure: f4P8Bw0z427Domw/AhnOKRFOYTXkUnPr1QO/M033FferhDivssUgcX8Rmutxy3AwKV1uYoSyJDW8Hzaj6bbJ7wbh9Yetbfo6IP8vw0gfJEvndSjpmu/x9R/0Os3jbSy4Irq5+gZZzN+ba7fySMNkBD2NoAHb/xp8RskJXPOgqas=
24 | - secure: Bm0zIwBo4saIBlfr9YDvNqd8UN50FeT2hZyum3RFDmJqaXiUqwxw7sCz/lRjUwTfQrvGJXQ1I8le7zE4OVQdvpn4/LwwTJIjLY2jZNjzs4mZhkHzsM5IcGcL3lukR6soVYrGloQwmw63Okw2kZxces+1fveisPIKDlVaU1RTtMQ=
25 |
26 | after_success:
27 | - chmod ugo+x travis_snapshot_release.sh
28 | - ./travis_snapshot_release.sh
29 |
--------------------------------------------------------------------------------
/examples/books-example/screenshot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sialcasa/mvvmFX/f195849ca98020ad74056991f147a05db9ce555a/examples/books-example/screenshot.png
--------------------------------------------------------------------------------
/examples/books-example/src/main/java/de/saxsys/mvvmfx/examples/books/BookListItemView.fxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/examples/books-example/src/main/java/de/saxsys/mvvmfx/examples/books/BookListItemView.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.examples.books;
2 |
3 | import de.saxsys.mvvmfx.FxmlView;
4 | import de.saxsys.mvvmfx.InjectViewModel;
5 | import javafx.fxml.FXML;
6 | import javafx.scene.control.Label;
7 |
8 | public class BookListItemView implements FxmlView {
9 | @FXML
10 | public Label titleLabel;
11 | @FXML
12 | public Label authorLabel;
13 |
14 | @InjectViewModel
15 | private BookListItemViewModel viewModel;
16 |
17 | public void initialize() {
18 | titleLabel.textProperty().bind(viewModel.titleProperty());
19 | authorLabel.textProperty().bind(viewModel.authorProperty());
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/examples/books-example/src/main/java/de/saxsys/mvvmfx/examples/books/backend/Book.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.examples.books.backend;
2 |
3 |
4 | public class Book {
5 |
6 | private final String href;
7 | private final String title;
8 | private String author;
9 | private String desc;
10 |
11 | public Book(String href, String title, String author, String desc) {
12 | this.href = href;
13 | this.title = title;
14 | this.author = author;
15 | this.desc = desc;
16 | }
17 |
18 | public String getHref() {
19 | return href;
20 | }
21 |
22 | public String getTitle() {
23 | return title;
24 | }
25 |
26 | public String getAuthor() {
27 | return author;
28 | }
29 |
30 | public void setAuthor(String author) {
31 | this.author = author;
32 | }
33 |
34 | public String getDesc() {
35 | return desc;
36 | }
37 |
38 | public void setDesc(String desc) {
39 | this.desc = desc;
40 | }
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/examples/books-example/src/main/java/de/saxsys/mvvmfx/examples/books/backend/Error.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.examples.books.backend;
2 |
3 | public class Error {
4 |
5 | private final String message;
6 |
7 | private final String details;
8 |
9 | public static Error error(String message, String details) {
10 | return new Error(message, details);
11 | }
12 |
13 | private Error(String message, String details) {
14 | this.message = message;
15 | this.details = details;
16 | }
17 |
18 | public String getMessage() {
19 | return message;
20 | }
21 |
22 | public String getDetails() {
23 | return details;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/examples/books-example/src/main/java/de/saxsys/mvvmfx/examples/books/backend/HalUtil.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.examples.books.backend;
2 |
3 | public class HalUtil {
4 |
5 | public static String replaceParam(String href, String param) {
6 | return href.replaceFirst("\\{.+\\}", param);
7 | }
8 |
9 | public static Integer toInt(Object value) {
10 | if (value.getClass().isAssignableFrom(String.class)) {
11 | String valueStr = (String) value;
12 | return Integer.valueOf(valueStr);
13 | }
14 | return null;
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/examples/books-example/src/main/java/de/saxsys/mvvmfx/examples/books/backend/LibraryService.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.examples.books.backend;
2 |
3 | import java.util.List;
4 | import java.util.function.Consumer;
5 |
6 | public interface LibraryService {
7 | List search(String query, Consumer errorCallback);
8 |
9 | Book showDetails(Book book, Consumer errorCallback);
10 | }
11 |
--------------------------------------------------------------------------------
/examples/books-example/src/main/java/de/saxsys/mvvmfx/examples/books/style.css:
--------------------------------------------------------------------------------
1 | .container {
2 |
3 | }
4 |
5 | .label
6 | {
7 | -fx-text-fill: black;
8 | }
9 |
10 | .title1{
11 | -fx-font-size:50;
12 | }
13 |
14 | .title2{
15 | -fx-font-size:40;
16 | -fx-text-fill: gray;
17 | }
18 |
19 | .errorLabel{
20 | -fx-font-size:20;
21 | -fx-text-fill: red;
22 | }
23 |
24 | .split-pane *.split-pane-divider {
25 | -fx-padding: 0 1 0 1;
26 | }
27 |
--------------------------------------------------------------------------------
/examples/books-example/src/main/resources/logback.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | %d{"HH:mm:ss,SSS"} %-5level [%-35logger{35}] %msg%n
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/examples/contacts-example/about.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sialcasa/mvvmFX/f195849ca98020ad74056991f147a05db9ce555a/examples/contacts-example/about.png
--------------------------------------------------------------------------------
/examples/contacts-example/address_form.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sialcasa/mvvmFX/f195849ca98020ad74056991f147a05db9ce555a/examples/contacts-example/address_form.png
--------------------------------------------------------------------------------
/examples/contacts-example/app.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sialcasa/mvvmFX/f195849ca98020ad74056991f147a05db9ce555a/examples/contacts-example/app.png
--------------------------------------------------------------------------------
/examples/contacts-example/contact_form.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sialcasa/mvvmFX/f195849ca98020ad74056991f147a05db9ce555a/examples/contacts-example/contact_form.png
--------------------------------------------------------------------------------
/examples/contacts-example/src/main/java/de/saxsys/mvvmfx/examples/contacts/config/ResourceProvider.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.examples.contacts.config;
2 |
3 | import javax.enterprise.inject.Produces;
4 | import javax.inject.Singleton;
5 | import java.util.ResourceBundle;
6 |
7 | /**
8 | * A singleton CDI provider that is used to load the resource bundle and provide
9 | * it for the CDI injection.
10 | */
11 | @Singleton
12 | public class ResourceProvider {
13 |
14 | /*
15 | * Due to the @Produces annotation this resource bundle can be injected in all views.
16 | */
17 | @Produces
18 | private ResourceBundle defaultResourceBundle = ResourceBundle.getBundle("default");
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/examples/contacts-example/src/main/java/de/saxsys/mvvmfx/examples/contacts/events/ContactsUpdatedEvent.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.examples.contacts.events;
2 |
3 | /**
4 | * CDI event class that is used to indicate that a contact was
5 | * updated/added/removed.
6 | */
7 | public class ContactsUpdatedEvent {
8 |
9 | }
10 |
--------------------------------------------------------------------------------
/examples/contacts-example/src/main/java/de/saxsys/mvvmfx/examples/contacts/events/TriggerShutdownEvent.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.examples.contacts.events;
2 |
3 | /**
4 | * Event class to trigger the shutdown of the application.
5 | */
6 | public class TriggerShutdownEvent {
7 |
8 | }
9 |
--------------------------------------------------------------------------------
/examples/contacts-example/src/main/java/de/saxsys/mvvmfx/examples/contacts/events/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * This package contains CDI event classes.
3 | */
4 | package de.saxsys.mvvmfx.examples.contacts.events;
5 |
--------------------------------------------------------------------------------
/examples/contacts-example/src/main/java/de/saxsys/mvvmfx/examples/contacts/model/Countries.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.examples.contacts.model;
2 |
3 | import javax.xml.bind.annotation.XmlAccessType;
4 | import javax.xml.bind.annotation.XmlAccessorType;
5 | import javax.xml.bind.annotation.XmlElement;
6 | import javax.xml.bind.annotation.XmlRootElement;
7 | import java.util.ArrayList;
8 |
9 | @XmlRootElement(name = "iso_3166_entries")
10 | @XmlAccessorType(XmlAccessType.FIELD)
11 | public class Countries {
12 |
13 | @XmlElement(name = "iso_3166_entry")
14 | private ArrayList countries;
15 |
16 | public ArrayList getCountries() {
17 | return countries;
18 | }
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/examples/contacts-example/src/main/java/de/saxsys/mvvmfx/examples/contacts/model/Repository.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.examples.contacts.model;
2 |
3 | import java.util.Optional;
4 | import java.util.Set;
5 |
6 | public interface Repository {
7 |
8 | Set findAll();
9 |
10 | Optional findById(String id);
11 |
12 | void save(Contact contact);
13 |
14 | void delete(Contact contact);
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/examples/contacts-example/src/main/java/de/saxsys/mvvmfx/examples/contacts/model/countries/ISO3166_2_Entries.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.examples.contacts.model.countries;
2 |
3 | import javax.xml.bind.annotation.XmlAccessType;
4 | import javax.xml.bind.annotation.XmlAccessorType;
5 | import javax.xml.bind.annotation.XmlElement;
6 | import javax.xml.bind.annotation.XmlRootElement;
7 | import java.util.ArrayList;
8 |
9 | @XmlRootElement(name = "iso_3166_2_entries")
10 | @XmlAccessorType(XmlAccessType.FIELD)
11 | public class ISO3166_2_Entries {
12 |
13 | @XmlElement(name = "iso_3166_country")
14 | public ArrayList countryEntities;
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/examples/contacts-example/src/main/java/de/saxsys/mvvmfx/examples/contacts/model/countries/ISO3166_2_EntryEntity.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.examples.contacts.model.countries;
2 |
3 | import javax.xml.bind.annotation.XmlAccessType;
4 | import javax.xml.bind.annotation.XmlAccessorType;
5 | import javax.xml.bind.annotation.XmlAttribute;
6 | import javax.xml.bind.annotation.XmlRootElement;
7 |
8 | /**
9 | * XML entity class. These classes represent the structure of the XML files
10 | * to be loaded.
11 | */
12 | @XmlRootElement(name = "iso_3166_subset")
13 | @XmlAccessorType(XmlAccessType.FIELD) class ISO3166_2_EntryEntity {
14 |
15 | @XmlAttribute(name = "code")
16 | public String code;
17 | @XmlAttribute(name = "name")
18 | public String name;
19 | }
20 |
--------------------------------------------------------------------------------
/examples/contacts-example/src/main/java/de/saxsys/mvvmfx/examples/contacts/model/countries/ISO3166_2_SubsetEntity.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.examples.contacts.model.countries;
2 |
3 | import javax.xml.bind.annotation.XmlAccessType;
4 | import javax.xml.bind.annotation.XmlAccessorType;
5 | import javax.xml.bind.annotation.XmlAttribute;
6 | import javax.xml.bind.annotation.XmlElement;
7 | import javax.xml.bind.annotation.XmlRootElement;
8 | import java.util.List;
9 |
10 | /**
11 | * XML entity class. These classes represent the structure of the XML files
12 | * to be loaded.
13 | */
14 | @XmlRootElement(name = "iso_3166_subset")
15 | @XmlAccessorType(XmlAccessType.FIELD) class ISO3166_2_SubsetEntity {
16 |
17 | @XmlElement(name = "iso_3166_2_entry")
18 | public List entryList;
19 |
20 | @XmlAttribute(name = "type")
21 | public String subdivisionType;
22 | }
23 |
--------------------------------------------------------------------------------
/examples/contacts-example/src/main/java/de/saxsys/mvvmfx/examples/contacts/ui/about/AboutAuthorView.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.examples.contacts.ui.about;
2 |
3 | import javax.inject.Singleton;
4 |
5 | import de.saxsys.mvvmfx.FxmlView;
6 | import de.saxsys.mvvmfx.InjectViewModel;
7 | import javafx.fxml.FXML;
8 |
9 | @Singleton
10 | public class AboutAuthorView implements FxmlView {
11 |
12 | @InjectViewModel
13 | private AboutAuthorViewModel viewModel;
14 |
15 | @FXML
16 | public void openBlog() {
17 | viewModel.openBlog();
18 | }
19 |
20 | @FXML
21 | public void openTwitter() {
22 | viewModel.openTwitter();
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/examples/contacts-example/src/main/java/de/saxsys/mvvmfx/examples/contacts/ui/about/AboutAuthorViewModel.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.examples.contacts.ui.about;
2 |
3 | import javax.inject.Inject;
4 |
5 | import de.saxsys.mvvmfx.ViewModel;
6 | import javafx.application.HostServices;
7 |
8 | public class AboutAuthorViewModel implements ViewModel {
9 |
10 | @Inject
11 | private HostServices hostServices;
12 |
13 | public void openBlog() {
14 | hostServices.showDocument("http://www.lestard.eu");
15 | }
16 |
17 | public void openTwitter() {
18 | hostServices.showDocument("https://twitter.com/manuel_mauky");
19 | }
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/examples/contacts-example/src/main/java/de/saxsys/mvvmfx/examples/contacts/ui/about/profile_manuel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sialcasa/mvvmFX/f195849ca98020ad74056991f147a05db9ce555a/examples/contacts-example/src/main/java/de/saxsys/mvvmfx/examples/contacts/ui/about/profile_manuel.png
--------------------------------------------------------------------------------
/examples/contacts-example/src/main/java/de/saxsys/mvvmfx/examples/contacts/ui/addcontact/AddContactDialogView.fxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/examples/contacts-example/src/main/java/de/saxsys/mvvmfx/examples/contacts/ui/addcontact/AddContactDialogView.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.examples.contacts.ui.addcontact;
2 |
3 | import de.saxsys.mvvmfx.FxmlView;
4 | import de.saxsys.mvvmfx.InjectViewModel;
5 | import javafx.stage.Stage;
6 |
7 | public class AddContactDialogView implements FxmlView {
8 |
9 | @InjectViewModel
10 | private AddContactDialogViewModel viewModel;
11 |
12 | private Stage showDialog;
13 |
14 | public void initialize() {
15 | viewModel.subscribe(AddContactDialogViewModel.CLOSE_DIALOG_NOTIFICATION, (key, payload) -> {
16 | showDialog.close();
17 | });
18 | }
19 |
20 | public void setDisplayingStage(Stage showDialog) {
21 | this.showDialog = showDialog;
22 | }
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/examples/contacts-example/src/main/java/de/saxsys/mvvmfx/examples/contacts/ui/editcontact/EditContactDialogView.fxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/examples/contacts-example/src/main/java/de/saxsys/mvvmfx/examples/contacts/ui/main/MainView.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.examples.contacts.ui.main;
2 |
3 | import de.saxsys.mvvmfx.FxmlView;
4 | import de.saxsys.mvvmfx.InjectViewModel;
5 |
6 | public class MainView implements FxmlView {
7 |
8 | @InjectViewModel
9 | private MainViewModel viewModel;
10 | }
11 |
--------------------------------------------------------------------------------
/examples/contacts-example/src/main/java/de/saxsys/mvvmfx/examples/contacts/ui/main/MainViewModel.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.examples.contacts.ui.main;
2 |
3 | import de.saxsys.mvvmfx.ScopeProvider;
4 | import de.saxsys.mvvmfx.ViewModel;
5 | import de.saxsys.mvvmfx.examples.contacts.ui.scopes.MasterDetailScope;
6 |
7 | @ScopeProvider(MasterDetailScope.class)
8 | public class MainViewModel implements ViewModel {
9 |
10 | }
11 |
--------------------------------------------------------------------------------
/examples/contacts-example/src/main/java/de/saxsys/mvvmfx/examples/contacts/ui/master/MasterView.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.examples.contacts.ui.master;
2 |
3 | import de.saxsys.mvvmfx.FxmlView;
4 | import de.saxsys.mvvmfx.InjectViewModel;
5 | import javafx.fxml.FXML;
6 | import javafx.scene.control.TableView;
7 |
8 | public class MasterView implements FxmlView {
9 |
10 | @FXML
11 | private TableView contactTable;
12 |
13 | @InjectViewModel
14 | private MasterViewModel viewModel;
15 |
16 | public void initialize() {
17 | contactTable.setItems(viewModel.getContactList());
18 |
19 | viewModel.selectedTableRowProperty().bind(contactTable.getSelectionModel().selectedItemProperty());
20 |
21 | // When the selectedTableRowProperty changes in the viewModel we need to update the table
22 | viewModel.setOnSelect(vm -> contactTable.getSelectionModel().select(vm));
23 | }
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/examples/contacts-example/src/main/java/de/saxsys/mvvmfx/examples/contacts/ui/scopes/MasterDetailScope.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.examples.contacts.ui.scopes;
2 |
3 | import de.saxsys.mvvmfx.Scope;
4 | import de.saxsys.mvvmfx.examples.contacts.model.Contact;
5 | import javafx.beans.property.ObjectProperty;
6 | import javafx.beans.property.SimpleObjectProperty;
7 |
8 | public class MasterDetailScope implements Scope {
9 |
10 | private final ObjectProperty selectedContact = new SimpleObjectProperty<>(this, "selectedContact");
11 |
12 | public ObjectProperty selectedContactProperty() {
13 | return this.selectedContact;
14 | }
15 |
16 | public final Contact getSelectedContact() {
17 | return this.selectedContactProperty().get();
18 | }
19 |
20 | public final void setSelectedContact(final Contact selectedContact) {
21 | this.selectedContactProperty().set(selectedContact);
22 | }
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/examples/contacts-example/src/main/java/de/saxsys/mvvmfx/examples/contacts/ui/toolbar/ToolbarViewModel.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.examples.contacts.ui.toolbar;
2 |
3 | import de.saxsys.mvvmfx.Scope;
4 | import de.saxsys.mvvmfx.ViewModel;
5 | import de.saxsys.mvvmfx.examples.contacts.ui.scopes.ContactDialogScope;
6 |
7 | import javax.enterprise.inject.Instance;
8 | import javax.inject.Inject;
9 | import java.util.Collections;
10 | import java.util.List;
11 |
12 | public class ToolbarViewModel implements ViewModel {
13 |
14 | @Inject
15 | private Instance scopeInstance;
16 |
17 | public List getScopesForAddDialog() {
18 | return Collections.singletonList(scopeInstance.get());
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/examples/contacts-example/src/main/java/de/saxsys/mvvmfx/examples/contacts/ui/validators/BirthdayValidator.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.examples.contacts.ui.validators;
2 |
3 | import de.saxsys.mvvmfx.examples.contacts.util.CentralClock;
4 | import de.saxsys.mvvmfx.utils.validation.FunctionBasedValidator;
5 | import de.saxsys.mvvmfx.utils.validation.ValidationMessage;
6 | import javafx.beans.value.ObservableValue;
7 |
8 | import java.time.LocalDate;
9 | import java.util.function.Predicate;
10 |
11 | /**
12 | * @author manuel.mauky
13 | */
14 | public class BirthdayValidator extends FunctionBasedValidator {
15 |
16 | private static final Predicate birthdayPredicate = date
17 | -> date == null || date.isBefore(LocalDate.now(CentralClock.getClock()));
18 |
19 | public BirthdayValidator(ObservableValue date) {
20 | super(date, birthdayPredicate, ValidationMessage.error("Birthday can't be set in the future"));
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/examples/contacts-example/src/main/resources/META-INF/beans.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
--------------------------------------------------------------------------------
/examples/contacts-example/src/main/resources/contacts.css:
--------------------------------------------------------------------------------
1 | .invisible-pagination-control .pagination-control {
2 | visibility: hidden;
3 | }
4 | .hyperlink:visited {
5 | -fx-text-fill: -fx-text-base-color;
6 | }
7 |
8 | .hyperlink {
9 | -fx-text-fill: -fx-text-base-color;
10 | }
11 |
12 | .hyperlink:focused {
13 | -fx-border-width: 0px;
14 | }
15 | .hyperlink:hover {
16 | -fx-underline: true;
17 | }
18 | .hyperlink:show-mnemonics > .mnemonic-underline {
19 | -fx-stroke: transparent;
20 | }
--------------------------------------------------------------------------------
/examples/contacts-example/src/main/resources/countries/readme.md:
--------------------------------------------------------------------------------
1 | This directory contains XML files with information about existing countries (ISO 3166) and there subdivisions (ISO 3166-2).
2 |
3 | These files are taken from [https://github.com/oodavid/iso-3166-2](https://github.com/oodavid/iso-3166-2).
4 |
--------------------------------------------------------------------------------
/examples/contacts-example/src/main/resources/default_de.properties:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sialcasa/mvvmFX/f195849ca98020ad74056991f147a05db9ce555a/examples/contacts-example/src/main/resources/default_de.properties
--------------------------------------------------------------------------------
/examples/contacts-example/src/main/resources/logback.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/examples/contacts-example/src/main/resources/menu_de.properties:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sialcasa/mvvmFX/f195849ca98020ad74056991f147a05db9ce555a/examples/contacts-example/src/main/resources/menu_de.properties
--------------------------------------------------------------------------------
/examples/contacts-example/src/main/resources/menu_en.properties:
--------------------------------------------------------------------------------
1 |
2 | menu.file=File
3 | menu.file.close=Close
4 | menu.edit=Edit
5 | menu.edit.removecontact=Remove contact
6 | menu.help=Help
7 | menu.help.about=About
--------------------------------------------------------------------------------
/examples/contacts-example/src/test/java/de/saxsys/mvvmfx/examples/contacts/model/countries/DomCountrySelectorIntegrationTest.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.examples.contacts.model.countries;
2 |
3 | import de.saxsys.mvvmfx.testingutils.JfxToolkitExtension;
4 | import org.junit.jupiter.api.BeforeEach;
5 | import org.junit.jupiter.api.extension.ExtendWith;
6 |
7 | @ExtendWith(JfxToolkitExtension.class)
8 | public class DomCountrySelectorIntegrationTest implements CountrySelectorInterfaceTest {
9 |
10 | private CountrySelector countrySelector;
11 |
12 | @BeforeEach
13 | public void setup(){
14 | countrySelector = new DomCountrySelector();
15 | }
16 |
17 |
18 | @Override public CountrySelector getCountrySelector() {
19 | return countrySelector;
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/examples/contacts-example/src/test/java/de/saxsys/mvvmfx/examples/contacts/model/countries/JAXBCountrySelectorIntegrationTest.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.examples.contacts.model.countries;
2 |
3 | import de.saxsys.mvvmfx.testingutils.JfxToolkitExtension;
4 | import org.junit.jupiter.api.BeforeEach;
5 | import org.junit.jupiter.api.extension.ExtendWith;
6 |
7 | @ExtendWith(JfxToolkitExtension.class)
8 | public class JAXBCountrySelectorIntegrationTest implements CountrySelectorInterfaceTest {
9 |
10 | private CountrySelector countrySelector;
11 |
12 | @BeforeEach
13 | public void setup() {
14 | countrySelector = new JAXBCountrySelector();
15 | }
16 |
17 | @Override public CountrySelector getCountrySelector() {
18 | return countrySelector;
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/examples/jigsaw-example/app/src/main/java/de/saxsys/mvvmfx/examples/jigsaw/app/AppViewModel.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.examples.jigsaw.app;
2 |
3 | import de.saxsys.mvvmfx.ViewModel;
4 |
5 | public class AppViewModel implements ViewModel {}
6 |
--------------------------------------------------------------------------------
/examples/jigsaw-example/app/src/main/java/module-info.java:
--------------------------------------------------------------------------------
1 |
2 | module de.saxsys.mvvmfx.examples.jigsaw.app{
3 |
4 | requires de.saxsys.mvvmfx.examples.jigsaw.circle;
5 | requires de.saxsys.mvvmfx.examples.jigsaw.rectangle;
6 | requires javafx.base;
7 | requires javafx.fxml;
8 | requires javafx.controls;
9 | requires javafx.graphics;
10 | requires de.saxsys.mvvmfx;
11 |
12 | exports de.saxsys.mvvmfx.examples.jigsaw.app to javafx.graphics;
13 |
14 | opens de.saxsys.mvvmfx.examples.jigsaw.app to de.saxsys.mvvmfx, javafx.fxml;
15 | }
--------------------------------------------------------------------------------
/examples/jigsaw-example/app/src/main/resources/app_de_DE.properties:
--------------------------------------------------------------------------------
1 | app.stage.title=Jigsaw Testanwendung
--------------------------------------------------------------------------------
/examples/jigsaw-example/app/src/main/resources/app_en.properties:
--------------------------------------------------------------------------------
1 | app.stage.title=Jigsaw test application
--------------------------------------------------------------------------------
/examples/jigsaw-example/app/src/main/resources/de/saxsys/mvvmfx/examples/jigsaw/app/AppView.fxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
11 |
12 |
--------------------------------------------------------------------------------
/examples/jigsaw-example/circle/src/main/java/module-info.java:
--------------------------------------------------------------------------------
1 |
2 | module de.saxsys.mvvmfx.examples.jigsaw.circle {
3 |
4 | requires javafx.base;
5 | requires javafx.fxml;
6 | requires javafx.controls;
7 | requires javafx.graphics;
8 | requires de.saxsys.mvvmfx;
9 |
10 | exports de.saxsys.mvvmfx.examples.jigsaw.circle;
11 |
12 | opens de.saxsys.mvvmfx.examples.jigsaw.circle to de.saxsys.mvvmfx, javafx.fxml;
13 | }
--------------------------------------------------------------------------------
/examples/jigsaw-example/circle/src/main/resources/circle_de.properties:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sialcasa/mvvmFX/f195849ca98020ad74056991f147a05db9ce555a/examples/jigsaw-example/circle/src/main/resources/circle_de.properties
--------------------------------------------------------------------------------
/examples/jigsaw-example/circle/src/main/resources/circle_en.properties:
--------------------------------------------------------------------------------
1 | circle.label.circlearea=Circle area:\
2 |
3 | circle.label.radius=Radius
4 | circle.label.title=Calculate a circular area
--------------------------------------------------------------------------------
/examples/jigsaw-example/circle/src/main/resources/de/saxsys/mvvmfx/examples/jigsaw/circle/CircleView.css:
--------------------------------------------------------------------------------
1 | #circleMainBox{
2 | -fx-alignment: center;
3 | -fx-spacing: 10;
4 | }
5 |
6 | #radiusBox{
7 | -fx-padding: 0 0 0 20;
8 | -fx-spacing: 70;
9 | }
10 |
11 | #resultBox{
12 | -fx-padding: 0 0 0 20;
13 | -fx-spacing: 40;
14 | }
15 |
16 | #title{
17 | -fx-font-weight: bold;
18 | -fx-font-size: 24;
19 | }
20 |
21 | #radiusLabel, #resultLabel, #circleAreaLabel{
22 | -fx-minWidth: 300;
23 | -fx-font-size: 16;
24 | }
25 |
26 |
--------------------------------------------------------------------------------
/examples/jigsaw-example/rectangle/src/main/java/module-info.java:
--------------------------------------------------------------------------------
1 |
2 | module de.saxsys.mvvmfx.examples.jigsaw.rectangle {
3 |
4 | requires javafx.base;
5 | requires javafx.fxml;
6 | requires javafx.controls;
7 | requires javafx.graphics;
8 | requires de.saxsys.mvvmfx;
9 |
10 | exports de.saxsys.mvvmfx.examples.jigsaw.rectangle;
11 |
12 | opens de.saxsys.mvvmfx.examples.jigsaw.rectangle to de.saxsys.mvvmfx, javafx.fxml;
13 | }
--------------------------------------------------------------------------------
/examples/jigsaw-example/rectangle/src/main/resources/de/saxsys/mvvmfx/examples/jigsaw/rectangle/Rectangle.css:
--------------------------------------------------------------------------------
1 | #rectangleMainBox{
2 | -fx-alignment: center;
3 | -fx-spacing: 10;
4 | }
5 |
6 | #firstSideBox, #secondSideBox{
7 | -fx-padding: 0 0 0 20;
8 | -fx-spacing: 70;
9 | }
10 |
11 | #resultBox{
12 | -fx-padding: 0 0 0 20;
13 | -fx-spacing: 10;
14 | }
15 |
16 | #title{
17 | -fx-font-weight: bold;
18 | -fx-font-size: 24;
19 | }
20 |
21 | #firstSideLabel, #secondSideLabel, #resultLabel, #rectangularAreaLabel{
22 | -fx-minWidth: 300;
23 | -fx-font-size: 16;
24 | }
--------------------------------------------------------------------------------
/examples/jigsaw-example/rectangle/src/main/resources/rectangle_de.properties:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sialcasa/mvvmFX/f195849ca98020ad74056991f147a05db9ce555a/examples/jigsaw-example/rectangle/src/main/resources/rectangle_de.properties
--------------------------------------------------------------------------------
/examples/jigsaw-example/rectangle/src/main/resources/rectangle_en.properties:
--------------------------------------------------------------------------------
1 | rectangle.label.firstside=Side 1
2 | rectangle.label.rectangulararea=Rectangular area:
3 | rectangle.label.secondside=Side 2
4 | rectangle.label.title=Calculate a rectangular area
--------------------------------------------------------------------------------
/examples/mini-examples/async-todoapp-futures/src/main/java/de/saxsys/mvvmfx/examples/async_todoapp_futures/model/TodoItemService.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.examples.async_todoapp_futures.model;
2 |
3 |
4 | import javax.inject.Singleton;
5 | import java.util.List;
6 |
7 | @Singleton
8 | public interface TodoItemService {
9 |
10 | void createItem(TodoItem item);
11 |
12 | void deleteItem(TodoItem item);
13 |
14 | TodoItem getItemById(String id);
15 |
16 | List getAllItems();
17 |
18 | }
--------------------------------------------------------------------------------
/examples/mini-examples/async-todoapp-futures/src/main/java/de/saxsys/mvvmfx/examples/async_todoapp_futures/ui/MainView.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.examples.async_todoapp_futures.ui;
2 |
3 | import de.saxsys.mvvmfx.FxmlView;
4 | import de.saxsys.mvvmfx.InjectViewModel;
5 | import javafx.fxml.FXML;
6 | import javafx.scene.control.Label;
7 |
8 | public class MainView implements FxmlView {
9 |
10 | @FXML
11 | public Label errorLabel;
12 |
13 | @InjectViewModel
14 | private MainViewModel viewModel;
15 |
16 | public void initialize() {
17 | errorLabel.textProperty().bind(viewModel.errorTextProperty());
18 |
19 | errorLabel.visibleProperty().bind(viewModel.errorVisibleProperty());
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/examples/mini-examples/async-todoapp-futures/src/main/resources/de/saxsys/mvvmfx/examples/async_todoapp_futures/ui/ControlsView.fxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/examples/mini-examples/async-todoapp-futures/src/main/resources/de/saxsys/mvvmfx/examples/async_todoapp_futures/ui/ItemList.fxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/examples/mini-examples/async-todoapp-futures/src/main/resources/de/saxsys/mvvmfx/examples/async_todoapp_futures/ui/MainView.fxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
14 |
15 |
--------------------------------------------------------------------------------
/examples/mini-examples/fx-root-example/README.md:
--------------------------------------------------------------------------------
1 | # MvvmFX fx:root example
2 |
3 | This example shows how you can create a custom component with the [fx:root](http://docs.oracle.com/javafx/2/fxml_get_started/custom_control.htm) element that uses mvvmFX.
4 |
5 | The example control consists of a Label, a TextField and a Button. When the button is pressed the text entered in the textField will be set as new label text. The button is disabled when the textField is empty. Of cause this isn't realy useful in practice but it's a good example of how to encapsulate the view logic of the control into the viewModel.
--------------------------------------------------------------------------------
/examples/mini-examples/fx-root-example/src/main/java/de/saxsys/mvvmfx/examples/fx_root_example/Starter.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.examples.fx_root_example;
2 |
3 | import javafx.application.Application;
4 | import javafx.scene.Scene;
5 | import javafx.scene.layout.VBox;
6 | import javafx.stage.Stage;
7 |
8 |
9 | public class Starter extends Application {
10 |
11 |
12 | public static void main(String... args) {
13 | Application.launch(args);
14 | }
15 |
16 |
17 | @Override
18 | public void start(Stage stage) throws Exception {
19 | stage.setTitle("fx:root example application");
20 |
21 | VBox root = new VBox();
22 |
23 | LabeledTextField textField = new LabeledTextField();
24 |
25 | root.getChildren().add(textField);
26 |
27 | stage.setScene(new Scene(root, 300, 50));
28 | stage.show();
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/examples/mini-examples/fx-root-example/src/main/resources/de/saxsys/mvvmfx/examples/fx_root_example/LabeledTextField.fxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/examples/mini-examples/helloworld-custom-fxml-path/README.md:
--------------------------------------------------------------------------------
1 | # MvvmFX HelloWorld with custom FXML path
2 |
3 | This module is an example of a simple HelloWorld app that shows
4 | how to develop a View with a CodeBehind class that has another location then
5 | the FXML file. Normally both files should have the same name to be found by mvvmFX
6 | by following a set of [naming conventions](https://github.com/sialcasa/mvvmFX/wiki/Naming-Conventions).
7 |
8 | However, it is also possible to use the `@FxmlPath` annotation
9 | to define a custom path for the FXML file. See [the Wiki](https://github.com/sialcasa/mvvmFX/wiki/Deviating-FXML-location)
10 | for a detailed description.
--------------------------------------------------------------------------------
/examples/mini-examples/helloworld-custom-fxml-path/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | mini-examples
7 | de.saxsys.mvvmfx
8 | 1.9.0-SNAPSHOT
9 |
10 | 4.0.0
11 |
12 | helloworld-custom-fxml-path
13 | HelloWorld with custom FXML path
14 |
15 |
16 |
17 | de.saxsys
18 | mvvmfx
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/examples/mini-examples/helloworld-custom-fxml-path/src/main/java/de/saxsys/mvvmfx/examples/helloworld/HelloView.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.examples.helloworld;
2 |
3 | import de.saxsys.mvvmfx.FxmlPath;
4 | import de.saxsys.mvvmfx.FxmlView;
5 | import de.saxsys.mvvmfx.InjectViewModel;
6 | import javafx.fxml.FXML;
7 | import javafx.scene.control.Label;
8 |
9 | @FxmlPath("/some/other/path/HalloWelt.fxml")
10 | public class HelloView implements FxmlView {
11 | @FXML
12 | public Label helloLabel;
13 |
14 | @InjectViewModel
15 | private HelloViewModel viewModel;
16 |
17 | public void initialize() {
18 | helloLabel.textProperty().bind(viewModel.helloMessage());
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/examples/mini-examples/helloworld-custom-fxml-path/src/main/java/de/saxsys/mvvmfx/examples/helloworld/HelloViewModel.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.examples.helloworld;
2 |
3 | import de.saxsys.mvvmfx.ViewModel;
4 | import javafx.beans.property.SimpleStringProperty;
5 | import javafx.beans.property.StringProperty;
6 |
7 | public class HelloViewModel implements ViewModel {
8 |
9 | private final StringProperty helloMessage = new SimpleStringProperty("Hello World");
10 |
11 | public StringProperty helloMessage() {
12 | return helloMessage;
13 | }
14 |
15 | public String getHelloMessage() {
16 | return helloMessage.get();
17 | }
18 |
19 | public void setHelloMessage(String message) {
20 | helloMessage.set(message);
21 | }
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/examples/mini-examples/helloworld-custom-fxml-path/src/main/java/de/saxsys/mvvmfx/examples/helloworld/Starter.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.examples.helloworld;
2 |
3 | import de.saxsys.mvvmfx.FluentViewLoader;
4 | import de.saxsys.mvvmfx.ViewTuple;
5 | import javafx.application.Application;
6 | import javafx.scene.Parent;
7 | import javafx.scene.Scene;
8 | import javafx.stage.Stage;
9 |
10 | public class Starter extends Application {
11 |
12 | public static void main(String... args) {
13 | Application.launch(args);
14 | }
15 |
16 | @Override
17 | public void start(Stage stage) throws Exception {
18 | stage.setTitle("Hello World Application");
19 |
20 | final ViewTuple viewTuple = FluentViewLoader
21 | .fxmlView(HelloView.class)
22 | .load();
23 |
24 | final Parent root = viewTuple.getView();
25 | stage.setScene(new Scene(root));
26 | stage.show();
27 | }
28 |
29 | }
30 |
31 |
--------------------------------------------------------------------------------
/examples/mini-examples/helloworld-custom-fxml-path/src/main/resources/some/other/path/HalloWelt.fxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/examples/mini-examples/helloworld-spring-boot/README.md:
--------------------------------------------------------------------------------
1 | # mvvmFX Spring-Boot example
2 |
3 | This example shows how to use mvvmFX with Spring Boot.
--------------------------------------------------------------------------------
/examples/mini-examples/helloworld-spring-boot/src/main/java/de/saxsys/mvvmfx/examples/helloworld/service/GreetingService.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.examples.helloworld.service;
2 |
3 | public interface GreetingService {
4 |
5 | String greet(String name);
6 |
7 | }
8 |
--------------------------------------------------------------------------------
/examples/mini-examples/helloworld-spring-boot/src/main/java/de/saxsys/mvvmfx/examples/helloworld/service/GreetingServiceImpl.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.examples.helloworld.service;
2 |
3 | import org.springframework.stereotype.Service;
4 |
5 | @Service
6 | public class GreetingServiceImpl implements GreetingService {
7 | @Override
8 | public String greet(String name) {
9 | return "Hello " + name + ". How are you?";
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/examples/mini-examples/helloworld-spring-boot/src/main/java/de/saxsys/mvvmfx/examples/helloworld/view/HelloView.fxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
12 |
13 |
14 |
15 |
16 | 10
17 |
18 |
19 |
20 | 10
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/examples/mini-examples/helloworld-spring-boot/src/main/java/de/saxsys/mvvmfx/examples/helloworld/view/HelloView.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.examples.helloworld.view;
2 |
3 | import de.saxsys.mvvmfx.FxmlView;
4 | import de.saxsys.mvvmfx.InjectViewModel;
5 | import javafx.fxml.FXML;
6 | import javafx.scene.control.Label;
7 | import javafx.scene.control.TextField;
8 | import org.springframework.stereotype.Component;
9 |
10 | @Component
11 | public class HelloView implements FxmlView {
12 |
13 | @FXML
14 | private Label message;
15 |
16 | @FXML
17 | private TextField name;
18 |
19 | @InjectViewModel
20 | private HelloViewModel viewModel;
21 |
22 | public void initialize() {
23 | viewModel.nameProperty().bindBidirectional(name.textProperty());
24 |
25 | message.textProperty().bind(viewModel.messageProperty());
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/examples/mini-examples/helloworld-without-fxml/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | mini-examples
7 | de.saxsys.mvvmfx
8 | 1.9.0-SNAPSHOT
9 |
10 | 4.0.0
11 |
12 | helloworld-without-fxml
13 | HelloWorld Example without FXML
14 |
15 |
16 |
17 | de.saxsys
18 | mvvmfx
19 |
20 |
21 |
--------------------------------------------------------------------------------
/examples/mini-examples/helloworld-without-fxml/src/main/java/de/saxsys/mvvmfx/examples/helloworld/HelloWorldViewModel.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.examples.helloworld;
2 |
3 | import javafx.beans.property.SimpleStringProperty;
4 | import javafx.beans.property.StringProperty;
5 |
6 | import de.saxsys.mvvmfx.ViewModel;
7 |
8 | public class HelloWorldViewModel implements ViewModel {
9 |
10 | private final StringProperty helloMessage = new SimpleStringProperty("Hello World");
11 |
12 | public StringProperty helloMessage() {
13 | return helloMessage;
14 | }
15 |
16 | public String getHelloMessage() {
17 | return helloMessage.get();
18 | }
19 |
20 | public void setHelloMessage(String message) {
21 | helloMessage.set(message);
22 | }
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/examples/mini-examples/helloworld-without-fxml/src/main/java/de/saxsys/mvvmfx/examples/helloworld/Starter.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.examples.helloworld;
2 |
3 | import de.saxsys.mvvmfx.FluentViewLoader;
4 | import javafx.application.Application;
5 | import javafx.scene.Parent;
6 | import javafx.scene.Scene;
7 | import javafx.stage.Stage;
8 |
9 | import de.saxsys.mvvmfx.ViewTuple;
10 |
11 | public class Starter extends Application {
12 |
13 | public static void main(String... args) {
14 | Application.launch(args);
15 | }
16 |
17 | @Override
18 | public void start(Stage stage) throws Exception {
19 | stage.setTitle("Hello World Application");
20 |
21 | final ViewTuple viewTuple = FluentViewLoader.javaView(HelloWorldView.class).load();
22 |
23 | final Parent root = viewTuple.getView();
24 | stage.setScene(new Scene(root));
25 | stage.show();
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/examples/mini-examples/helloworld/README.md:
--------------------------------------------------------------------------------
1 | # MvvmFX HelloWorld
2 |
3 | This Module is an example of a simple HelloWorld application developed with mvvmFX.
4 | This example is described in detail in the [Getting-Started](/../../wiki/Getting-Started-HelloWorld-(english)) section in the wiki.
5 |
--------------------------------------------------------------------------------
/examples/mini-examples/helloworld/pom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | mini-examples
7 | de.saxsys.mvvmfx
8 | 1.9.0-SNAPSHOT
9 |
10 | 4.0.0
11 |
12 | helloworld
13 | HelloWorld Example
14 |
15 |
16 |
17 | de.saxsys
18 | mvvmfx
19 |
20 |
21 |
--------------------------------------------------------------------------------
/examples/mini-examples/helloworld/src/main/java/de/saxsys/mvvmfx/examples/helloworld/HelloWorldView.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.examples.helloworld;
2 |
3 | import java.net.URL;
4 | import java.util.ResourceBundle;
5 | import javafx.fxml.FXML;
6 | import javafx.fxml.Initializable;
7 | import javafx.scene.control.Label;
8 |
9 | import de.saxsys.mvvmfx.FxmlView;
10 | import de.saxsys.mvvmfx.InjectViewModel;
11 |
12 | public class HelloWorldView implements FxmlView, Initializable {
13 |
14 | @FXML
15 | private Label helloLabel;
16 |
17 | @InjectViewModel
18 | private HelloWorldViewModel viewModel;
19 |
20 | @Override
21 | public void initialize(URL url, ResourceBundle resourceBundle) {
22 | helloLabel.textProperty().bind(viewModel.helloMessage());
23 | }
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/examples/mini-examples/helloworld/src/main/java/de/saxsys/mvvmfx/examples/helloworld/HelloWorldViewModel.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.examples.helloworld;
2 |
3 | import javafx.beans.property.SimpleStringProperty;
4 | import javafx.beans.property.StringProperty;
5 |
6 | import de.saxsys.mvvmfx.ViewModel;
7 |
8 | public class HelloWorldViewModel implements ViewModel {
9 |
10 | private final StringProperty helloMessage = new SimpleStringProperty("Hello World");
11 |
12 | public StringProperty helloMessage() {
13 | return helloMessage;
14 | }
15 |
16 | public String getHelloMessage() {
17 | return helloMessage.get();
18 | }
19 |
20 | public void setHelloMessage(String message) {
21 | helloMessage.set(message);
22 | }
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/examples/mini-examples/helloworld/src/main/java/de/saxsys/mvvmfx/examples/helloworld/Starter.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.examples.helloworld;
2 |
3 | import de.saxsys.mvvmfx.FluentViewLoader;
4 | import javafx.application.Application;
5 | import javafx.scene.Parent;
6 | import javafx.scene.Scene;
7 | import javafx.stage.Stage;
8 |
9 | import de.saxsys.mvvmfx.ViewTuple;
10 |
11 | public class Starter extends Application {
12 |
13 | public static void main(String... args) {
14 | Application.launch(args);
15 | }
16 |
17 | @Override
18 | public void start(Stage stage) throws Exception {
19 | stage.setTitle("Hello World Application");
20 |
21 | final ViewTuple viewTuple = FluentViewLoader.fxmlView(HelloWorldView.class).load();
22 |
23 | final Parent root = viewTuple.getView();
24 | stage.setScene(new Scene(root));
25 | stage.show();
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/examples/mini-examples/helloworld/src/main/resources/de/saxsys/mvvmfx/examples/helloworld/HelloWorldView.fxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/examples/mini-examples/scopes-example/src/main/java/de/saxsys/mvvmfx/examples/scopesexample/model/Document.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.examples.scopesexample.model;
2 |
3 | public class Document extends Entity {
4 |
5 | private String title;
6 |
7 | private String description;
8 |
9 | public Document(String title) {
10 | this.title = title;
11 | }
12 |
13 | public Document() {
14 | }
15 |
16 | public String getTitle() {
17 | return title;
18 | }
19 |
20 | public void setTitle(String title) {
21 | this.title = title;
22 | }
23 |
24 | public String getDescription() {
25 | return description;
26 | }
27 |
28 | public void setDescription(String description) {
29 | this.description = description;
30 | }
31 |
32 | @Override
33 | public String toString() {
34 | return title;
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/examples/mini-examples/scopes-example/src/main/java/de/saxsys/mvvmfx/examples/scopesexample/model/DocumentRepository.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.examples.scopesexample.model;
2 |
3 | import javax.inject.Singleton;
4 | import java.util.*;
5 |
6 | @Singleton
7 | public class DocumentRepository {
8 |
9 |
10 | private Map entities = new HashMap<>();
11 |
12 |
13 | public Optional findById(String id) {
14 | return Optional.ofNullable(entities.get(id));
15 | }
16 |
17 | public Collection findAll() {
18 | return entities.values();
19 | }
20 |
21 | public void persist(Document document) {
22 | entities.put(document.getId(), document);
23 | }
24 |
25 | public void remove(Document document) {
26 | remove(document.getId());
27 | }
28 |
29 | public void remove(String id) {
30 | entities.remove(id);
31 | }
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/examples/mini-examples/scopes-example/src/main/java/de/saxsys/mvvmfx/examples/scopesexample/model/Entity.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.examples.scopesexample.model;
2 |
3 | import java.util.UUID;
4 |
5 | public abstract class Entity {
6 |
7 | private final String id;
8 |
9 | public Entity() {
10 | id = UUID.randomUUID().toString();
11 | }
12 |
13 | public String getId() {
14 | return id;
15 | }
16 |
17 | @Override
18 | public boolean equals(Object o) {
19 | if (this == o) return true;
20 | if (o == null || getClass() != o.getClass()) return false;
21 |
22 | Entity entity = (Entity) o;
23 |
24 | return id != null ? id.equals(entity.id) : entity.id == null;
25 |
26 | }
27 |
28 | @Override
29 | public int hashCode() {
30 | return id != null ? id.hashCode() : 0;
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/examples/mini-examples/scopes-example/src/main/java/de/saxsys/mvvmfx/examples/scopesexample/ui/documentdetails/DetailsScope.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.examples.scopesexample.ui.documentdetails;
2 |
3 | import de.saxsys.mvvmfx.Scope;
4 | import de.saxsys.mvvmfx.examples.scopesexample.model.Document;
5 | import javafx.beans.property.ObjectProperty;
6 | import javafx.beans.property.SimpleObjectProperty;
7 |
8 | public class DetailsScope implements Scope {
9 |
10 | public static final String UPDATE = "DetailsScope.UPDATE";
11 |
12 |
13 | private ObjectProperty document = new SimpleObjectProperty<>();
14 |
15 | public ObjectProperty documentProperty() {
16 | return document;
17 | }
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/examples/mini-examples/scopes-example/src/main/java/de/saxsys/mvvmfx/examples/scopesexample/ui/documentdetails/descriptionedit/DescriptionEditView.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.examples.scopesexample.ui.documentdetails.descriptionedit;
2 |
3 | import de.saxsys.mvvmfx.FxmlView;
4 | import de.saxsys.mvvmfx.InjectViewModel;
5 | import javafx.fxml.FXML;
6 | import javafx.scene.control.TextArea;
7 |
8 | public class DescriptionEditView implements FxmlView {
9 |
10 | @FXML
11 | public TextArea description;
12 |
13 | @InjectViewModel
14 | private DescriptionEditViewModel viewModel;
15 |
16 |
17 | public void initialize() {
18 | description.textProperty().bindBidirectional(viewModel.descriptionProperty());
19 | }
20 |
21 |
22 | public void save() {
23 | viewModel.save();
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/examples/mini-examples/scopes-example/src/main/java/de/saxsys/mvvmfx/examples/scopesexample/ui/overview/OverviewScope.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.examples.scopesexample.ui.overview;
2 |
3 | import de.saxsys.mvvmfx.Scope;
4 | import de.saxsys.mvvmfx.examples.scopesexample.model.Document;
5 | import javafx.beans.property.ObjectProperty;
6 | import javafx.beans.property.SimpleObjectProperty;
7 |
8 | public class OverviewScope implements Scope {
9 |
10 | public static final String UPDATE = "OverviewScope.update";
11 |
12 | private ObjectProperty selectedDocument = new SimpleObjectProperty<>();
13 |
14 | public ObjectProperty selectedDocumentProperty() {
15 | return selectedDocument;
16 | }
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/examples/mini-examples/scopes-example/src/main/java/de/saxsys/mvvmfx/examples/scopesexample/ui/overview/OverviewView.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.examples.scopesexample.ui.overview;
2 |
3 | import de.saxsys.mvvmfx.FxmlView;
4 |
5 | public class OverviewView implements FxmlView {
6 |
7 | }
8 |
--------------------------------------------------------------------------------
/examples/mini-examples/scopes-example/src/main/java/de/saxsys/mvvmfx/examples/scopesexample/ui/overview/OverviewViewModel.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.examples.scopesexample.ui.overview;
2 |
3 | import de.saxsys.mvvmfx.ViewModel;
4 |
5 |
6 | public class OverviewViewModel implements ViewModel {
7 |
8 | }
9 |
--------------------------------------------------------------------------------
/examples/mini-examples/scopes-example/src/main/java/de/saxsys/mvvmfx/examples/scopesexample/ui/overview/master/OverviewMasterView.fxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/examples/mini-examples/synchronizefx-example/src/main/java/de/saxsys/mvvmfx/examples/synchronize/SliderView.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.examples.synchronize;
2 |
3 | import javafx.fxml.FXML;
4 | import javafx.scene.control.Label;
5 | import javafx.scene.control.Slider;
6 |
7 | import de.saxsys.mvvmfx.FxmlView;
8 | import de.saxsys.mvvmfx.InjectViewModel;
9 |
10 | public class SliderView implements FxmlView {
11 |
12 |
13 | @FXML
14 | private Label myLabel;
15 |
16 | @FXML
17 | private Slider mySlider;
18 |
19 | @InjectViewModel
20 | private SliderViewModel viewModel;
21 |
22 |
23 | public void initialize() {
24 | mySlider.valueProperty().bindBidirectional(viewModel.sliderValueProperty());
25 |
26 | myLabel.textProperty().bind(viewModel.labelTextProperty());
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/examples/mini-examples/welcome-example/README.md:
--------------------------------------------------------------------------------
1 | mvvmfx welcome example
2 | ======================
3 |
4 | This example is slightly more complex example then the other mini-examples.
5 | It shows a login dialog where users get a welcome message after they where logged in.
6 |
7 | The example shows many interesting parts of the mvvmFX framework:
8 |
9 | ## Dependency-Injection
10 |
11 | The code in the application uses the `@Inject` annotation and there are App classes for both **CDI/Weld** and **Guice**.
12 | It demonstrates that it's possible to use the same code base for both dependency injection frameworks while only using
13 | different starter classes for each framework.
14 |
15 | ## Commands
16 |
17 | The example uses our [Commands](https://github.com/sialcasa/mvvmFX/wiki/Commands) feature for handling of actions.
18 |
19 |
--------------------------------------------------------------------------------
/examples/mini-examples/welcome-example/src/main/java/de/saxsys/mvvmfx/examples/welcome/model/Gender.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.examples.welcome.model;
2 |
3 | /**
4 | * Enum of possible gender information. If a person doesn't like to provide a
5 | * gender, the value {@link #NOT_SPECIFIED} can be used.
6 | */
7 | public enum Gender {
8 |
9 | MALE,
10 | FEMALE,
11 | NOT_SPECIFIED
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/examples/mini-examples/welcome-example/src/main/java/de/saxsys/mvvmfx/examples/welcome/viewmodel/maincontainer/MainContainerViewModel.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.examples.welcome.viewmodel.maincontainer;
2 |
3 | import javafx.beans.property.ListProperty;
4 | import javafx.beans.property.SimpleListProperty;
5 | import javafx.collections.FXCollections;
6 |
7 | import de.saxsys.mvvmfx.ViewModel;
8 |
9 | public class MainContainerViewModel implements ViewModel {
10 |
11 | private ListProperty displayedPersons = new SimpleListProperty<>(
12 | FXCollections.observableArrayList());
13 |
14 | public MainContainerViewModel() {
15 |
16 | }
17 |
18 | public ListProperty displayedPersonsProperty() {
19 | return displayedPersons;
20 | }
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/examples/mini-examples/welcome-example/src/main/java/de/saxsys/mvvmfx/examples/welcome/viewmodel/personlogin/PersonLoginViewModelNotifications.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.examples.welcome.viewmodel.personlogin;
2 |
3 | public enum PersonLoginViewModelNotifications {
4 |
5 | OK("Das Einloggen war erfolgreich");
6 |
7 | private String message;
8 |
9 | PersonLoginViewModelNotifications(String message) {
10 | this.message = message;
11 | }
12 |
13 | public String getMessage() {
14 | return message;
15 | }
16 |
17 | public String getId() {
18 | return toString();
19 | }
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/examples/todomvc-example/README.md:
--------------------------------------------------------------------------------
1 | # MvvmFX TodoMVC Example
2 |
3 | This example is influenced by the popular [TodoMVC.com](http://todomvc.com/) example.
4 | *TodoMVC* is a project that is used to compare different JavaScript/HTML5 libraries.
5 | All example apps on the website implement the same requirements.
6 | This makes comparing the different libraries and frameworks easier.
7 | While the original TodoMVC is targeted for JavaScript and web frameworks we have
8 | implemented a JavaFX variant using mvvmFX.
9 |
10 |
11 | 
12 |
--------------------------------------------------------------------------------
/examples/todomvc-example/screenshot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sialcasa/mvvmFX/f195849ca98020ad74056991f147a05db9ce555a/examples/todomvc-example/screenshot.png
--------------------------------------------------------------------------------
/examples/todomvc-example/src/main/java/de/saxsys/mvvmfx/examples/todomvc/App.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.examples.todomvc;
2 |
3 | import javafx.application.Application;
4 | import javafx.scene.Parent;
5 | import javafx.scene.Scene;
6 | import javafx.stage.Stage;
7 |
8 | import de.saxsys.mvvmfx.FluentViewLoader;
9 | import de.saxsys.mvvmfx.examples.todomvc.ui.MainView;
10 |
11 | /**
12 | * @author manuel.mauky
13 | */
14 | public class App extends Application {
15 |
16 | public static void main(String... args) {
17 | launch(args);
18 | }
19 |
20 | @Override
21 | public void start(Stage stage) throws Exception {
22 | stage.setTitle("TodoMVVM");
23 |
24 | final Parent parent = FluentViewLoader.fxmlView(MainView.class).load().getView();
25 |
26 | stage.setScene(new Scene(parent));
27 | stage.show();
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/examples/todomvc-example/src/main/java/de/saxsys/mvvmfx/examples/todomvc/model/TodoItemStore.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.examples.todomvc.model;
2 |
3 | import javafx.collections.FXCollections;
4 | import javafx.collections.ObservableList;
5 |
6 | /**
7 | * @author manuel.mauky
8 | */
9 | public class TodoItemStore {
10 |
11 | private static final TodoItemStore SINGLETON = new TodoItemStore();
12 |
13 | private final ObservableList items = FXCollections.observableArrayList();
14 |
15 | private TodoItemStore() {
16 | }
17 |
18 | public static TodoItemStore getInstance() {
19 | return SINGLETON;
20 | }
21 |
22 | public ObservableList getItems() {
23 | return items;
24 | }
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/examples/todomvc-example/src/main/java/de/saxsys/mvvmfx/examples/todomvc/ui/MainView.fxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/examples/todomvc-example/src/main/java/de/saxsys/mvvmfx/examples/todomvc/ui/MainView.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.examples.todomvc.ui;
2 |
3 | import de.saxsys.mvvmfx.FxmlView;
4 |
5 | /**
6 | * @author manuel.mauky
7 | */
8 | public class MainView implements FxmlView {
9 |
10 | }
11 |
--------------------------------------------------------------------------------
/examples/todomvc-example/src/main/java/de/saxsys/mvvmfx/examples/todomvc/ui/MainViewModel.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.examples.todomvc.ui;
2 |
3 | import de.saxsys.mvvmfx.ViewModel;
4 |
5 | /**
6 | * @author manuel.mauky
7 | */
8 | public class MainViewModel implements ViewModel {
9 |
10 | }
11 |
--------------------------------------------------------------------------------
/examples/todomvc-example/src/main/java/de/saxsys/mvvmfx/examples/todomvc/ui/additems/AddItemsView.fxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/examples/todomvc-example/src/main/java/de/saxsys/mvvmfx/examples/todomvc/ui/additems/additems.css:
--------------------------------------------------------------------------------
1 |
2 | .add_item_root {
3 | -fx-padding: 1em;
4 | }
5 |
6 | .check-box {
7 | -fx-padding: 0.1em 1em 0.1em 0.1em;
8 | }
--------------------------------------------------------------------------------
/examples/todomvc-example/src/main/java/de/saxsys/mvvmfx/examples/todomvc/ui/controls/ControlsView.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.examples.todomvc.ui.controls;
2 |
3 | import de.saxsys.mvvmfx.FxmlView;
4 | import de.saxsys.mvvmfx.InjectViewModel;
5 | import javafx.fxml.FXML;
6 | import javafx.scene.control.Label;
7 |
8 | /**
9 | * @author manuel.mauky
10 | */
11 | public class ControlsView implements FxmlView {
12 |
13 | @FXML
14 | public Label itemsLeftLabel;
15 |
16 | @InjectViewModel
17 | private ControlsViewModel viewModel;
18 |
19 | public void initialize() {
20 | itemsLeftLabel.textProperty().bind(viewModel.itemsLeftLabelTextProperty());
21 | }
22 |
23 | public void all() {
24 | viewModel.all();
25 | }
26 |
27 | public void active() {
28 | viewModel.active();
29 | }
30 |
31 | public void completed() {
32 | viewModel.completed();
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/examples/todomvc-example/src/main/java/de/saxsys/mvvmfx/examples/todomvc/ui/item/ItemOverviewView.fxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/examples/todomvc-example/src/main/java/de/saxsys/mvvmfx/examples/todomvc/ui/item/ItemOverviewView.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.examples.todomvc.ui.item;
2 |
3 | import javafx.fxml.FXML;
4 | import javafx.scene.control.ListView;
5 |
6 | import de.saxsys.mvvmfx.FxmlView;
7 | import de.saxsys.mvvmfx.InjectViewModel;
8 | import de.saxsys.mvvmfx.utils.viewlist.CachedViewModelCellFactory;
9 |
10 | /**
11 | * @author manuel.mauky
12 | */
13 | public class ItemOverviewView implements FxmlView {
14 |
15 | @FXML
16 | public ListView items;
17 |
18 | @InjectViewModel
19 | private ItemOverviewViewModel viewModel;
20 |
21 | public void initialize() {
22 | items.setItems(viewModel.itemsProperty());
23 | items.setCellFactory(CachedViewModelCellFactory.createForFxmlView(ItemView.class));
24 | }
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/examples/todomvc-example/src/main/java/de/saxsys/mvvmfx/examples/todomvc/ui/item/itemview.css:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | .strikethrough .text {
5 | -fx-strikethrough: true;
6 | }
7 |
8 | .close_icon {
9 | -fx-fill: #cc9a9a;
10 | }
11 |
12 | .close_icon:hover {
13 | -fx-fill: #af5b5e;
14 | }
15 |
16 | .content_box .button {
17 | -fx-background-color: none;
18 | }
19 |
20 | .item_root {
21 | -fx-padding: 0.5em;
22 | }
23 |
24 | .check-box {
25 | -fx-padding: 0em 1em 0em 0em;
26 | }
27 |
28 | .label {
29 | -fx-font-size: 1.2em;
30 | }
--------------------------------------------------------------------------------
/examples/todomvc-example/src/main/java/de/saxsys/mvvmfx/examples/todomvc/ui/main.css:
--------------------------------------------------------------------------------
1 |
2 | #title {
3 | -fx-font-size:3em;
4 | -fx-text-fill: rgba(175, 47, 47, 0.5);
5 | }
--------------------------------------------------------------------------------
/mvvmfx-archetype/README.md:
--------------------------------------------------------------------------------
1 | # MvvmFX Archetype
2 |
3 | This module is a maven archetype to create a simple mvvmFX application.
4 |
5 | To use this archetype:
6 |
7 | mvn archetype:generate
8 | -DarchetypeGroupId=de.saxsys
9 | -DarchetypeArtifactId=mvvmfx-archetype
10 | -DarchetypeVersion=
11 | -DgroupId=your.group.id
12 | -DartifactId=your.artifact.id
13 |
14 |
15 | This creates an example mvvmfx project similar to the [helloworld example](/examples/mini-examples/helloworld).
16 |
--------------------------------------------------------------------------------
/mvvmfx-archetype/src/main/resources/archetype-resources/src/main/java/HelloWorldView.java:
--------------------------------------------------------------------------------
1 | package ${package};
2 |
3 | import java.net.URL;
4 | import java.util.ResourceBundle;
5 | import javafx.fxml.FXML;
6 | import javafx.fxml.Initializable;
7 | import javafx.scene.control.Label;
8 |
9 | import de.saxsys.mvvmfx.FxmlView;
10 | import de.saxsys.mvvmfx.InjectViewModel;
11 |
12 | public class HelloWorldView implements FxmlView, Initializable {
13 |
14 | @FXML
15 | private Label helloLabel;
16 |
17 | @InjectViewModel
18 | private HelloWorldViewModel viewModel;
19 |
20 | @Override
21 | public void initialize(URL url, ResourceBundle resourceBundle) {
22 | helloLabel.textProperty().bind(viewModel.helloMessage());
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/mvvmfx-archetype/src/main/resources/archetype-resources/src/main/java/HelloWorldViewModel.java:
--------------------------------------------------------------------------------
1 | package ${package};
2 |
3 | import javafx.beans.property.SimpleStringProperty;
4 | import javafx.beans.property.StringProperty;
5 |
6 | import de.saxsys.mvvmfx.ViewModel;
7 |
8 | public class HelloWorldViewModel implements ViewModel {
9 |
10 | private StringProperty helloMessage = new SimpleStringProperty("Hello World");
11 |
12 | public StringProperty helloMessage() {
13 | return helloMessage;
14 | }
15 |
16 | public String getHelloMessage() {
17 | return helloMessage.get();
18 | }
19 |
20 | public void setHelloMessage(String message) {
21 | helloMessage.set(message);
22 | }
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/mvvmfx-archetype/src/main/resources/archetype-resources/src/main/java/Starter.java:
--------------------------------------------------------------------------------
1 | package ${package};
2 |
3 | import de.saxsys.mvvmfx.FluentViewLoader;
4 | import javafx.application.Application;
5 | import javafx.scene.Parent;
6 | import javafx.scene.Scene;
7 | import javafx.stage.Stage;
8 |
9 | import de.saxsys.mvvmfx.ViewTuple;
10 |
11 |
12 | public class Starter extends Application {
13 |
14 |
15 | public static void main(String... args) {
16 | Application.launch(args);
17 | }
18 |
19 |
20 | @Override
21 | public void start(Stage stage) throws Exception {
22 | stage.setTitle("Hello World Application");
23 |
24 | ViewTuple viewTuple = FluentViewLoader.fxmlView(HelloWorldView.class).load();
25 |
26 | Parent root = viewTuple.getView();
27 | stage.setScene(new Scene(root));
28 | stage.show();
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/mvvmfx-archetype/src/main/resources/archetype-resources/src/main/resources/HelloWorldView.fxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/mvvmfx-cdi/src/test/java/de/saxsys/mvvmfx/cdi/it/MyService.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.cdi.it;
2 |
3 | public class MyService {
4 | public static int instanceCounter = 0;
5 |
6 | public MyService() {
7 | instanceCounter++;
8 | }
9 |
10 | }
11 |
--------------------------------------------------------------------------------
/mvvmfx-cdi/src/test/java/de/saxsys/mvvmfx/cdi/it/MyView.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.cdi.it;
2 |
3 | import javafx.application.Application;
4 | import javafx.application.HostServices;
5 | import javafx.stage.Stage;
6 |
7 | import javax.inject.Inject;
8 |
9 | import de.saxsys.mvvmfx.FxmlView;
10 | import de.saxsys.mvvmfx.utils.notifications.NotificationCenter;
11 |
12 | public class MyView implements FxmlView {
13 | @Inject
14 | Stage primaryStage;
15 |
16 | @Inject
17 | Application.Parameters parameters;
18 |
19 | @Inject
20 | NotificationCenter notificationCenter;
21 |
22 | @Inject
23 | HostServices hostServices;
24 |
25 | public static int instanceCounter = 0;
26 |
27 | public MyView() {
28 | instanceCounter++;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/mvvmfx-cdi/src/test/java/de/saxsys/mvvmfx/cdi/it/MyViewModel.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.cdi.it;
2 |
3 | import javax.inject.Inject;
4 |
5 | import de.saxsys.mvvmfx.ViewModel;
6 |
7 | public class MyViewModel implements ViewModel {
8 | public static int instanceCounter = 0;
9 |
10 | @Inject
11 | private MyService myService;
12 |
13 | public MyViewModel() {
14 | instanceCounter++;
15 | }
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/mvvmfx-cdi/src/test/resources/META-INF/beans.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
--------------------------------------------------------------------------------
/mvvmfx-cdi/src/test/resources/de/saxsys/mvvmfx/cdi/it/MyView.fxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
10 |
--------------------------------------------------------------------------------
/mvvmfx-guice/src/test/java/de/saxsys/mvvmfx/guice/interceptiontest/InterceptedView.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.guice.interceptiontest;
2 |
3 | import de.saxsys.mvvmfx.FxmlView;
4 | import de.saxsys.mvvmfx.InjectViewModel;
5 |
6 | public class InterceptedView implements FxmlView {
7 | public static boolean vmWasInjected = false;
8 | public static boolean wasInitCalled = false;
9 |
10 | @InjectViewModel
11 | private InterceptedViewModel viewModel;
12 |
13 | public void initialize() {
14 | wasInitCalled = true;
15 | vmWasInjected = viewModel != null;
16 | }
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/mvvmfx-guice/src/test/java/de/saxsys/mvvmfx/guice/interceptiontest/InterceptedViewModel.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.guice.interceptiontest;
2 |
3 | import de.saxsys.mvvmfx.ViewModel;
4 |
5 | public class InterceptedViewModel implements ViewModel {
6 |
7 |
8 |
9 | }
10 |
--------------------------------------------------------------------------------
/mvvmfx-guice/src/test/java/de/saxsys/mvvmfx/guice/interceptiontest/InterceptorModule.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.guice.interceptiontest;
2 |
3 | import com.google.inject.Binder;
4 | import com.google.inject.Module;
5 | import com.google.inject.matcher.Matchers;
6 |
7 | public class InterceptorModule implements Module {
8 | @Override
9 | public void configure(Binder binder) {
10 | binder.bindInterceptor(Matchers.subclassesOf(InterceptedView.class), Matchers.any(), new TestInterceptor());
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/mvvmfx-guice/src/test/java/de/saxsys/mvvmfx/guice/interceptiontest/TestInterceptor.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.guice.interceptiontest;
2 |
3 | import org.aopalliance.intercept.MethodInterceptor;
4 | import org.aopalliance.intercept.MethodInvocation;
5 |
6 | public class TestInterceptor implements MethodInterceptor {
7 | public static boolean wasIntercepted = false;
8 |
9 | @Override
10 | public Object invoke(MethodInvocation methodInvocation) throws Throwable {
11 | wasIntercepted = true;
12 |
13 | return methodInvocation.proceed();
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/mvvmfx-guice/src/test/java/de/saxsys/mvvmfx/guice/it/MyModule.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.guice.it;
2 |
3 | import com.google.inject.AbstractModule;
4 |
5 | import java.util.function.Supplier;
6 |
7 | import static org.assertj.core.api.Assertions.assertThat;
8 |
9 | public class MyModule extends AbstractModule {
10 |
11 | public static boolean works = false;
12 |
13 | @Override
14 | protected void configure() {
15 | Supplier supplier = () -> "lambda in module works";
16 |
17 | assertThat(supplier.get()).isNotEmpty().contains("works");
18 | works = true;
19 |
20 | bind(MyService.class).to(MyServiceImpl.class);
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/mvvmfx-guice/src/test/java/de/saxsys/mvvmfx/guice/it/MyService.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.guice.it;
2 |
3 | public interface MyService {
4 | }
5 |
--------------------------------------------------------------------------------
/mvvmfx-guice/src/test/java/de/saxsys/mvvmfx/guice/it/MyServiceImpl.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.guice.it;
2 |
3 | public class MyServiceImpl implements MyService {
4 | }
5 |
--------------------------------------------------------------------------------
/mvvmfx-guice/src/test/java/de/saxsys/mvvmfx/guice/it/MyView.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.guice.it;
2 |
3 | import de.saxsys.mvvmfx.FxmlView;
4 | import de.saxsys.mvvmfx.utils.notifications.NotificationCenter;
5 | import javafx.application.Application;
6 | import javafx.application.HostServices;
7 | import javafx.stage.Stage;
8 |
9 | import javax.inject.Inject;
10 |
11 | public class MyView implements FxmlView {
12 | @Inject
13 | Stage primaryStage;
14 |
15 | @Inject
16 | Application.Parameters parameters;
17 |
18 | @Inject
19 | NotificationCenter notificationCenter;
20 |
21 | @Inject
22 | HostServices hostServices;
23 |
24 | public static boolean wasInitCalled = false;
25 |
26 |
27 | public void initialize() {
28 | wasInitCalled = true;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/mvvmfx-guice/src/test/java/de/saxsys/mvvmfx/guice/it/MyViewModel.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.guice.it;
2 |
3 | import de.saxsys.mvvmfx.ViewModel;
4 |
5 | import javax.inject.Inject;
6 | import java.util.function.Supplier;
7 |
8 | import static org.assertj.core.api.Assertions.assertThat;
9 |
10 | public class MyViewModel implements ViewModel {
11 |
12 | public static boolean works = false;
13 |
14 | @Inject
15 | public MyViewModel(MyService service) {
16 | Supplier supplier = () -> "lambda in ViewModel works";
17 | assertThat(supplier.get()).isNotEmpty().contains("works");
18 | assertThat(service).isNotNull();
19 | works = true;
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/mvvmfx-guice/src/test/resources/de/saxsys/mvvmfx/guice/interceptiontest/InterceptedView.fxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/mvvmfx-guice/src/test/resources/de/saxsys/mvvmfx/guice/it/MyView.fxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
10 |
--------------------------------------------------------------------------------
/mvvmfx-spring-boot/src/test/java/de/saxsys/mvvmfx/spring/MyService.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.spring;
2 |
3 | import org.springframework.stereotype.Service;
4 |
5 | @Service
6 | public class MyService {
7 | public static int instanceCounter = 0;
8 |
9 | public MyService() {
10 | instanceCounter++;
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/mvvmfx-spring-boot/src/test/java/de/saxsys/mvvmfx/spring/MyView.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.spring;
2 |
3 | import de.saxsys.mvvmfx.FxmlView;
4 | import de.saxsys.mvvmfx.utils.notifications.NotificationCenter;
5 | import javafx.application.HostServices;
6 | import org.springframework.beans.factory.annotation.Autowired;
7 | import org.springframework.context.annotation.Lazy;
8 | import org.springframework.stereotype.Component;
9 |
10 | @Component
11 | public class MyView implements FxmlView {
12 |
13 | @Autowired
14 | NotificationCenter notificationCenter;
15 |
16 | @Autowired
17 | HostServices hostServices;
18 |
19 | public static int instanceCounter = 0;
20 |
21 | public MyView() {
22 | instanceCounter++;
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/mvvmfx-spring-boot/src/test/java/de/saxsys/mvvmfx/spring/MyViewModel.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.spring;
2 |
3 | import de.saxsys.mvvmfx.ViewModel;
4 | import org.springframework.beans.factory.annotation.Autowired;
5 | import org.springframework.context.annotation.Lazy;
6 | import org.springframework.stereotype.Component;
7 |
8 |
9 | @Component
10 | public class MyViewModel implements ViewModel {
11 | public static int instanceCounter = 0;
12 |
13 | @Autowired
14 | private MyService myService;
15 |
16 | public MyViewModel() {
17 | instanceCounter++;
18 | }
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/mvvmfx-spring-boot/src/test/resources/de/saxsys/mvvmfx/spring/MyView.fxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
8 |
--------------------------------------------------------------------------------
/mvvmfx-testing-utils/README.md:
--------------------------------------------------------------------------------
1 | # MvvmFX Testing Utils
2 |
3 | This module contains utils that can be useful for testing JavaFX and mvvmFX applications.
4 |
5 | ```xml
6 |
7 | de.saxsys
8 | mvvmfx-testing-utils
9 | ${mvvmfx-version}
10 |
11 | ```
--------------------------------------------------------------------------------
/mvvmfx-testing-utils/src/main/java/de/saxsys/mvvmfx/testingutils/ExceptionUtils.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.testingutils;
2 |
3 | public class ExceptionUtils {
4 |
5 | /**
6 | * This method returns the root cause of a given Exception.
7 | *
8 | * @param e
9 | * the exception from that the root cause is extracted.
10 | * @return the root cause of the given exception.
11 | */
12 | public static Throwable getRootCause(Exception e) {
13 | Throwable cause = e;
14 |
15 | while (cause != null) {
16 | if (cause.getCause() == null) {
17 | break;
18 | }
19 | cause = cause.getCause();
20 | }
21 |
22 | return cause;
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/mvvmfx-testing-utils/src/main/java/de/saxsys/mvvmfx/testingutils/jfxrunner/TestInJfxThread.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.testingutils.jfxrunner;
2 |
3 | import java.lang.annotation.ElementType;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.RetentionPolicy;
6 | import java.lang.annotation.Target;
7 |
8 | /**
9 | * This annotation can be used together with {@link JfxRunner} to execute
10 | * an annotated test method on the JavaFX Thread.
11 | *
12 | * Please notices that this only works with JUnit 4.
13 | * For a solution for JUnit 5 see {@link de.saxsys.mvvmfx.testingutils.FxTestingUtils#runInFXThread(Runnable)}.
14 | */
15 | @Retention(RetentionPolicy.RUNTIME)
16 | @Target(ElementType.METHOD)
17 | public @interface TestInJfxThread {
18 | }
--------------------------------------------------------------------------------
/mvvmfx-testing-utils/src/test/java/de/saxsys/mvvmfx/testingutils/jfxrunner/AnotherJfxRunnerTest.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.testingutils.jfxrunner;
2 |
3 | import javafx.scene.control.TextField;
4 | import org.junit.Test;
5 | import org.junit.runner.RunWith;
6 |
7 | import static org.assertj.core.api.Assertions.assertThat;
8 |
9 | /**
10 | * This is a second test of {@link JfxRunner} to make sure that more then one such tests can be executed in an
11 | * automated build.
12 | *
13 | */
14 | @RunWith(JfxRunner.class)
15 | public class AnotherJfxRunnerTest {
16 |
17 | @Test
18 | public void test() {
19 | TextField textField = new TextField();
20 |
21 | assertThat(textField).isNotNull();
22 | }
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/mvvmfx-testing-utils/src/test/java/de/saxsys/mvvmfx/testingutils/jfxrunner/TestFxTest.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.testingutils.jfxrunner;
2 |
3 | import javafx.scene.Node;
4 | import javafx.scene.Parent;
5 | import javafx.scene.layout.VBox;
6 | import org.junit.Test;
7 | import org.loadui.testfx.GuiTest;
8 |
9 | import static org.assertj.core.api.Assertions.assertThat;
10 |
11 | /**
12 | *
13 | * This test is used to check the compatibility of {@link JfxRunner}
14 | * with TestFX. Especially it should be possible to have both TestFX tests and JfxRunner tests in one build process.
15 | *
16 | * @author manuel.mauky
17 | */
18 | public class TestFxTest extends GuiTest {
19 | @Override
20 | protected Parent getRootNode() {
21 | final VBox root = new VBox();
22 | root.setId("root");
23 | return root;
24 | }
25 |
26 | @Test
27 | public void test() {
28 | final Node root = find("#root");
29 |
30 | assertThat(root).isNotNull();
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/mvvmfx-utils/README.md:
--------------------------------------------------------------------------------
1 | # MvvmFX Utils
2 |
3 | This module contains some utils that can be useful for JavaFX and mvvmFX developers.
4 |
5 | ```xml
6 |
7 | de.saxsys
8 | mvvmfx-utils
9 | ${mvvmfx-version}
10 |
11 | ```
--------------------------------------------------------------------------------
/mvvmfx-utils/src/main/java/de/saxsys/mvvmfx/utils/listener/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Manage listeners to prevent memory leaks due to still registered listeners after a view is removed.
3 | */
4 | package de.saxsys.mvvmfx.utils.listener;
--------------------------------------------------------------------------------
/mvvmfx-utils/src/main/java/de/saxsys/mvvmfx/utils/sizebinding/internal/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Internal: Implementation of the {@link de.saxsys.mvvmfx.utils.sizebinding.SizeBindingsBuilder} step-builder.
3 | */
4 | package de.saxsys.mvvmfx.utils.sizebinding.internal;
--------------------------------------------------------------------------------
/mvvmfx-utils/src/main/java/de/saxsys/mvvmfx/utils/sizebinding/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Provide a fluent api to bind the size of different controls to each other.
3 | */
4 | package de.saxsys.mvvmfx.utils.sizebinding;
--------------------------------------------------------------------------------
/mvvmfx-validation/README.md:
--------------------------------------------------------------------------------
1 | # MvvmFX Validation
2 |
3 | This module contains validation utils that can be useful for JavaFX and mvvmFX developers.
4 |
5 | ```xml
6 |
7 | de.saxsys
8 | mvvmfx-validation
9 | ${mvvmfx-version}
10 |
11 | ```
12 |
--------------------------------------------------------------------------------
/mvvmfx-validation/src/test/java/de/saxsys/mvvmfx/utils/validation/cssvisualizer/CssVisualizerExampleApp.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.utils.validation.cssvisualizer;
2 |
3 | import de.saxsys.mvvmfx.FluentViewLoader;
4 | import javafx.application.Application;
5 | import javafx.scene.Parent;
6 | import javafx.scene.Scene;
7 | import javafx.stage.Stage;
8 |
9 | public class CssVisualizerExampleApp extends Application {
10 |
11 | public static void main(String[] args) {
12 | launch(args);
13 | }
14 |
15 | @Override
16 | public void start(Stage primaryStage) throws Exception {
17 |
18 | Parent parent = FluentViewLoader.fxmlView(CssVisualizerView.class).load().getView();
19 |
20 | primaryStage.setScene(new Scene(parent));
21 | primaryStage.show();
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/mvvmfx-validation/src/test/java/de/saxsys/mvvmfx/utils/validation/cssvisualizer/CssVisualizerView.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.utils.validation.cssvisualizer;
2 |
3 | import de.saxsys.mvvmfx.FxmlView;
4 | import de.saxsys.mvvmfx.InjectViewModel;
5 | import de.saxsys.mvvmfx.utils.validation.visualization.ValidationVisualizer;
6 | import javafx.fxml.FXML;
7 | import javafx.scene.control.TextField;
8 |
9 | public class CssVisualizerView implements FxmlView {
10 |
11 | @FXML
12 | private TextField email;
13 |
14 | @InjectViewModel
15 | private CssVisualizerViewModel viewModel;
16 |
17 | private ValidationVisualizer visualizer = new CssVisualizer("error", "valid", "required");
18 |
19 | public void initialize() {
20 | email.textProperty().bindBidirectional(viewModel.emailAddressProperty());
21 |
22 | visualizer.initVisualization(viewModel.getValidationStatus(), email, true);
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/mvvmfx-validation/src/test/java/de/saxsys/mvvmfx/utils/validation/cssvisualizer/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * This package contains an example for a simple custom visualizer that uses CSS styling. It's not intended to be an
3 | * official visualizer but just a starting point for people to implement their own visualizers.
4 | */
5 | package de.saxsys.mvvmfx.utils.validation.cssvisualizer;
--------------------------------------------------------------------------------
/mvvmfx-validation/src/test/resources/de/saxsys/mvvmfx/utils/validation/cssvisualizer/CssVisualizerView.fxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/mvvmfx-validation/src/test/resources/de/saxsys/mvvmfx/utils/validation/cssvisualizer/style.css:
--------------------------------------------------------------------------------
1 |
2 | .error {
3 | -fx-border-color: red;
4 | }
5 |
6 | .valid {
7 | -fx-border-color: green;
8 | }
9 |
10 | .required {
11 | -fx-background-color: yellow;
12 | }
--------------------------------------------------------------------------------
/mvvmfx/README.md:
--------------------------------------------------------------------------------
1 | # MvvmFX Core
2 |
3 | This module is the core of [MvvmFX](https://github.com/sialcasa/mvvmFX).
4 |
5 | It contains helper classes to implement the MVVM design pattern,
6 | load Views based on FXML or pure Java code
7 | and some additional helpers for some typical problems of UI development in JavaFX.
8 |
9 |
10 | ```xml
11 |
12 | de.saxsys
13 | mvvmfx
14 | ${mvvmfx-version}
15 |
16 | ```
17 |
18 |
--------------------------------------------------------------------------------
/mvvmfx/src/main/java/de/saxsys/mvvmfx/Context.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx;
2 |
3 | public interface Context {
4 |
5 | }
6 |
--------------------------------------------------------------------------------
/mvvmfx/src/main/java/de/saxsys/mvvmfx/InjectContext.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx;
2 |
3 | import java.lang.annotation.ElementType;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.RetentionPolicy;
6 | import java.lang.annotation.Target;
7 |
8 | /**
9 | *
10 | * @author alexander.casall
11 | *
12 | */
13 | @Retention(RetentionPolicy.RUNTIME)
14 | @Target(ElementType.FIELD)
15 | public @interface InjectContext {
16 | }
--------------------------------------------------------------------------------
/mvvmfx/src/main/java/de/saxsys/mvvmfx/InjectScope.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx;
2 |
3 | import java.lang.annotation.ElementType;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.RetentionPolicy;
6 | import java.lang.annotation.Target;
7 |
8 | /**
9 | * This annotation is used to inject a {@link Scope} object into a {@link ViewModel}.
10 | *
11 | * @author alexander.casall
12 | */
13 | @Retention(RetentionPolicy.RUNTIME)
14 | @Target(ElementType.FIELD)
15 | public @interface InjectScope {
16 | }
--------------------------------------------------------------------------------
/mvvmfx/src/main/java/de/saxsys/mvvmfx/SceneLifecycle.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx;
2 |
3 |
4 | public interface SceneLifecycle {
5 |
6 | /**
7 | * This method will be invoked when the View is added to a {@link javafx.scene.Scene}.
8 | */
9 | void onViewAdded();
10 |
11 | /**
12 | * This method will be invoked when the View is removed from a {@link javafx.scene.Scene}.
13 | */
14 | void onViewRemoved();
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/mvvmfx/src/main/java/de/saxsys/mvvmfx/ScopeProvider.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx;
2 |
3 | import java.lang.annotation.ElementType;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.RetentionPolicy;
6 | import java.lang.annotation.Target;
7 |
8 | @Retention(RetentionPolicy.RUNTIME)
9 | @Target(ElementType.TYPE)
10 | public @interface ScopeProvider {
11 | /**
12 | * The scopes provided by this scope provider.
13 | */
14 | Class extends Scope>[] scopes() default {};
15 |
16 | /**
17 | * The scopes provided by this scope provider. This is an alias for {@link #scopes()}.
18 | * If both {@link #value()} and {@link #scopes()} are provided, the content of
19 | * {@link #value()} is preferred.
20 | */
21 | Class extends Scope>[] value() default {};
22 | }
--------------------------------------------------------------------------------
/mvvmfx/src/main/java/de/saxsys/mvvmfx/internal/ContextImpl.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.internal;
2 |
3 | import java.util.HashMap;
4 | import java.util.Map;
5 |
6 | import de.saxsys.mvvmfx.Context;
7 | import de.saxsys.mvvmfx.Scope;
8 |
9 | public class ContextImpl implements Context {
10 |
11 | private final Map, Object> scopeContext;
12 |
13 | public ContextImpl() {
14 | this(new HashMap<>());
15 | }
16 |
17 | private ContextImpl(Map, Object> scopeContext) {
18 | this.scopeContext = scopeContext;
19 | }
20 |
21 | public void addScopeToContext(Scope scope) {
22 | scopeContext.put(scope.getClass(), scope);
23 | }
24 |
25 | public Object getScope(Class scopeType) {
26 | return scopeContext.get(scopeType);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/mvvmfx/src/main/java/de/saxsys/mvvmfx/internal/SideEffect.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.internal;
2 |
3 | /**
4 | * A functional interface that is used in this class to express callbacks that don't take any argument and don't
5 | * return anything. Such a callback has to work only by side effects.
6 | *
7 | * This interface doesn't allow the implementation to throw checked exceptions.
8 | * If checked exceptions are needed, use {@link SideEffectWithException} instead.
9 | */
10 | @FunctionalInterface
11 | public interface SideEffect {
12 | void call();
13 | }
14 |
--------------------------------------------------------------------------------
/mvvmfx/src/main/java/de/saxsys/mvvmfx/internal/SideEffectWithException.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.internal;
2 |
3 | /**
4 | * A functional interface that is used in this class to express callbacks that don't take any argument and don't
5 | * return anything. Such a callback has to work only by side effects.
6 | *
7 | * This interface allows the implementation to throw checked exceptions. Therefore the caller has to handle this exception.
8 | * If no checked exceptions are needed, use {@link SideEffect} instead.
9 | */
10 | @FunctionalInterface
11 | public interface SideEffectWithException {
12 | void call() throws Exception;
13 | }
14 |
--------------------------------------------------------------------------------
/mvvmfx/src/main/java/de/saxsys/mvvmfx/internal/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Internal implementation classes.
3 | */
4 | package de.saxsys.mvvmfx.internal;
--------------------------------------------------------------------------------
/mvvmfx/src/main/java/de/saxsys/mvvmfx/internal/viewloader/PreventGarbageCollectionStore.java:
--------------------------------------------------------------------------------
1 | package de.saxsys.mvvmfx.internal.viewloader;
2 |
3 | import java.util.ArrayList;
4 | import java.util.List;
5 |
6 | /**
7 | * This class is used to store references to objects that may not be
8 | * garbage collected (yet).
9 | */
10 | public class PreventGarbageCollectionStore {
11 |
12 | private static final PreventGarbageCollectionStore SINGLETON = new PreventGarbageCollectionStore();
13 |
14 | private PreventGarbageCollectionStore() {
15 | }
16 |
17 | public static PreventGarbageCollectionStore getInstance() {
18 | return SINGLETON;
19 | }
20 |
21 | private List