From f9ec156507d9b18dc3dbbd87e07cfe788f8ab036 Mon Sep 17 00:00:00 2001 From: Anry Das Date: Sat, 15 Mar 2025 11:38:15 +0200 Subject: [PATCH] Bug fixing: corrected Number Update in List behavior; corrected Number conversion --- NovaPoshta/.gitignore | 45 + NovaPoshta/DB/np_empty.db | Bin 0 -> 102400 bytes NovaPoshta/Docs/API_request.json | 18 + NovaPoshta/Docs/API_responce_descr.xlsx | Bin 0 -> 14565 bytes NovaPoshta/Docs/API_response.json | 119 + .../Docs/CFX Examples/HelloActionGroup.java | 204 + .../Docs/CFX Examples/HelloActionProxy.java | 224 + .../Docs/CFX Examples/HelloAutoComplete.java | 208 + .../Docs/CFX Examples/HelloCheckComboBox.java | 241 + .../Docs/CFX Examples/HelloDialogs.java | 742 ++ .../Docs/CFX Examples/HelloGlyphFont.java | 170 + .../CFX Examples/HelloHiddenSidesPane.java | 124 + .../CFX Examples/HelloListActionView.java | 196 + .../CFX Examples/HelloMasterDetailPane.java | 156 + .../Docs/CFX Examples/HelloPropertySheet.java | 258 + .../Docs/CFX Examples/HelloValidation.java | 234 + NovaPoshta/Docs/EditPhones.fxml | 15 + NovaPoshta/Docs/HelloDialogs.java | 742 ++ NovaPoshta/Docs/HelloListActionView.java | 196 + NovaPoshta/Docs/HelloValidation.java | 234 + NovaPoshta/Docs/ProxyBean.java | 33 + NovaPoshta/Docs/class_loader.txt | 51 + NovaPoshta/Docs/response.json | 1 + NovaPoshta/Docs/scheduling.txt | 74 + NovaPoshta/Docs/splitter_position.txt | 4 + NovaPoshta/Docs/sql/DbCreationService.java | 49 + NovaPoshta/Docs/sql/data.sql | 10 + NovaPoshta/Docs/sql/schema.sql | 119 + NovaPoshta/Docs/statuses.txt | 22 + NovaPoshta/README.md | 35 + NovaPoshta/distribution/assembly.xml | 44 + NovaPoshta/help/en/config.md | 25 + NovaPoshta/help/en/detail.md | 12 + NovaPoshta/help/en/groups.md | 21 + NovaPoshta/help/en/help.md | 22 + NovaPoshta/help/en/hot_keys.md | 49 + NovaPoshta/help/en/log.md | 16 + NovaPoshta/help/en/main.md | 29 + NovaPoshta/help/en/menu.md | 61 + NovaPoshta/help/en/new.md | 19 + NovaPoshta/help/en/phones.md | 16 + NovaPoshta/help/en/plugins.md | 26 + NovaPoshta/help/en/search.md | 52 + NovaPoshta/help/en/view_mode.md | 29 + NovaPoshta/help/en/windows.md | 35 + NovaPoshta/help/index.md | 4 + NovaPoshta/help/uk/config.md | 25 + NovaPoshta/help/uk/detail.md | 12 + NovaPoshta/help/uk/groups.md | 21 + NovaPoshta/help/uk/help.md | 22 + NovaPoshta/help/uk/hot_keys.md | 49 + NovaPoshta/help/uk/log.md | 16 + NovaPoshta/help/uk/main.md | 29 + NovaPoshta/help/uk/menu.md | 61 + NovaPoshta/help/uk/new.md | 19 + NovaPoshta/help/uk/phones.md | 16 + NovaPoshta/help/uk/plugins.md | 26 + NovaPoshta/help/uk/search.md | 52 + NovaPoshta/help/uk/view_mode.md | 29 + NovaPoshta/help/uk/windows.md | 33 + NovaPoshta/logs/NP.log | 5958 +++++++++++++++++ NovaPoshta/logs/NP.log.2024-06-15.0.gz | Bin 0 -> 16759 bytes NovaPoshta/logs/NP.log.2024-06-16.0.gz | Bin 0 -> 8738 bytes NovaPoshta/logs/NP.log.2024-06-27.0.gz | Bin 0 -> 9952 bytes NovaPoshta/logs/NP.log.2024-07-01.0.gz | Bin 0 -> 52204 bytes NovaPoshta/logs/NP.log.2024-10-24.0.gz | Bin 0 -> 344154 bytes NovaPoshta/logs/NP.log.2024-10-26.0.gz | Bin 0 -> 149942 bytes NovaPoshta/logs/NP.log.2025-03-15.0.gz | Bin 0 -> 564951 bytes NovaPoshta/plugins/.gitkeep | 0 NovaPoshta/pom.xml | 182 + NovaPoshta/run.cmd | 1 + NovaPoshta/run.sh | 2 + .../java/das/tools/np/JavaFxApplication.java | 33 + .../das/tools/np/NovaPoshtaApplication.java | 17 + .../java/das/tools/np/config/AppConfig.java | 61 + .../das/tools/np/config/ConversionConfig.java | 38 + .../java/das/tools/np/config/GuiConfig.java | 24 + .../tools/np/controller/UpdateController.java | 26 + .../CargoNumberToSimpleConverter.java | 39 + .../CargoNumbersToSimpleNumbersConverter.java | 25 + .../GZipToResponseDataConverter.java | 47 + .../JsonStrToSearchParamsConverter.java | 25 + .../JsonStrToWindowPositionConverter.java | 23 + .../ResponseDataToCargoNumberConverter.java | 33 + .../ResponseDataToGzipConverter.java | 39 + .../SearchParamsToJsonStrConverter.java | 23 + ...ringArrayIdsToDocumentsArrayConverter.java | 17 + .../WindowPositionToJsonStrConverter.java | 22 + .../java/das/tools/np/entity/NameValue.java | 15 + .../das/tools/np/entity/StageReadyEvent.java | 13 + .../das/tools/np/entity/SwitchViewEntry.java | 17 + .../das/tools/np/entity/WindowPosition.java | 21 + .../das/tools/np/entity/db/CargoNumber.java | 49 + .../das/tools/np/entity/db/CargoStatus.java | 16 + .../das/tools/np/entity/db/ExtraPhone.java | 18 + .../java/das/tools/np/entity/db/Group.java | 18 + .../das/tools/np/entity/db/NumberToPhone.java | 18 + .../das/tools/np/entity/db/NumberType.java | 8 + .../java/das/tools/np/entity/db/Property.java | 15 + .../das/tools/np/entity/db/SearchHistory.java | 16 + .../das/tools/np/entity/db/SearchOptions.java | 22 + .../das/tools/np/entity/db/SearchResult.java | 18 + .../das/tools/np/entity/db/SimpleNumber.java | 28 + .../java/das/tools/np/entity/db/Status.java | 81 + .../tools/np/entity/plugin/PluginInfo.java | 18 + .../np/entity/plugin/PluginInterface.java | 13 + .../tools/np/entity/request/AppRequest.java | 22 + .../das/tools/np/entity/request/Document.java | 19 + .../np/entity/request/MethodProperties.java | 17 + .../tools/np/entity/response/AppResponse.java | 25 + .../np/entity/response/ResponseData.java | 177 + .../np/entity/search/LevenshteinDistance.java | 36 + .../np/entity/search/SearchDateValue.java | 72 + .../np/entity/search/SearchIntValue.java | 50 + .../tools/np/entity/search/SearchParams.java | 37 + .../np/entity/search/SearchStringValue.java | 56 + .../np/entity/search/SearchTypeValue.java | 58 + .../tools/np/entity/search/SqlCondition.java | 6 + .../np/entity/search/ValueCondition.java | 16 + .../search/values/AbstractValueBox.java | 66 + .../search/values/CargoStatusValueBox.java | 40 + .../np/entity/search/values/DateValueBox.java | 44 + .../entity/search/values/IntegerValueBox.java | 31 + .../search/values/NumberTypeValueBox.java | 40 + .../entity/search/values/StatusValueBox.java | 40 + .../entity/search/values/StringTextBox.java | 32 + .../entity/search/values/StringValueBox.java | 35 + .../entity/search/values/TypedValueBox.java | 38 + .../tools/np/gui/ApplicationLogService.java | 135 + .../CargoNumbersTableViewProducerService.java | 87 + .../das/tools/np/gui/FieldNameService.java | 101 + .../tools/np/gui/FilteringModeService.java | 59 + .../main/java/das/tools/np/gui/Localized.java | 5 + .../np/gui/NumberInfoTableProduceService.java | 76 + .../tools/np/gui/NumberInfoViewService.java | 366 + .../das/tools/np/gui/NumberListService.java | 147 + .../tools/np/gui/NumberTreeViewService.java | 80 + .../tools/np/gui/PrimaryStageInitializer.java | 47 + .../java/das/tools/np/gui/RunInThread.java | 23 + .../main/java/das/tools/np/gui/Splash.java | 55 + .../tools/np/gui/SwitchNumberViewService.java | 60 + .../das/tools/np/gui/ViewModeService.java | 60 + .../das/tools/np/gui/WindowListService.java | 58 + .../gui/controllers/AddGroupController.java | 97 + .../gui/controllers/AddNumberController.java | 292 + .../np/gui/controllers/ConfigController.java | 177 + .../controllers/DetailedInfoController.java | 75 + .../np/gui/controllers/MainController.java | 91 + .../gui/controllers/MainControllerImpl.java | 711 ++ .../np/gui/controllers/edit/EditAction.java | 5 + .../edit/EditActionTextService.java | 34 + .../controllers/edit/EditControlsHolder.java | 20 + .../edit/EditControlsProducer.java | 186 + .../edit/EditGroupsController.java | 256 + .../edit/EditPhonesController.java | 252 + .../edit/EditSearchOptionsController.java | 306 + .../controllers/search/SearchController.java | 313 + .../search/SearchControlsProduceService.java | 272 + .../search/options/SearchCondition.java | 28 + .../search/options/SearchOptionsControls.java | 159 + .../windows/ArchivedNumbersController.java | 206 + .../windows/CustomNumbersListController.java | 165 + .../gui/controllers/windows/WindowAction.java | 14 + .../windows/WindowControlsHolder.java | 21 + .../windows/WindowControlsProducer.java | 103 + .../das/tools/np/gui/dialog/AlertService.java | 80 + .../np/gui/dialog/SelectComboDialog.java | 67 + .../tools/np/gui/dialog/ToastComponent.java | 66 + .../das/tools/np/gui/enums/AddsBoxTypes.java | 5 + .../das/tools/np/gui/enums/FilteringMode.java | 5 + .../tools/np/gui/enums/LogMessageType.java | 5 + .../tools/np/gui/enums/SwitchControlType.java | 5 + .../java/das/tools/np/gui/enums/ViewMode.java | 5 + .../das/tools/np/gui/enums/WindowType.java | 5 + .../das/tools/np/gui/menu/ActionService.java | 268 + .../tools/np/gui/menu/ApplicationAction.java | 13 + .../tools/np/gui/menu/CommonMenuService.java | 77 + .../das/tools/np/gui/menu/MenuService.java | 312 + .../gui/menu/NumberInfoTableMenuService.java | 119 + .../np/repository/ArchiveRepository.java | 109 + .../np/repository/CargoNumberRepository.java | 148 + .../np/repository/ExtraPhonesRepository.java | 48 + .../tools/np/repository/GroupRepository.java | 32 + .../repository/NumberToPhoneRepository.java | 26 + .../np/repository/PropertiesRepository.java | 32 + .../repository/SearchHistoryRepository.java | 35 + .../repository/SearchOptionsRepository.java | 43 + .../impl/ArchiveRepositoryImpl.java | 147 + .../impl/CargoNumberRepositoryImpl.java | 342 + .../impl/ExtraPhonesRepositoryImpl.java | 187 + .../repository/impl/GroupRepositoryImpl.java | 132 + .../impl/NumberToPhoneRepositoryImpl.java | 138 + .../impl/PropertiesRepositoryImpl.java | 122 + .../impl/SearchHistoryRepositoryImpl.java | 120 + .../impl/SearchOptionsRepositoryImpl.java | 139 + .../das/tools/np/services/ApiService.java | 9 + .../np/services/ArchiveNumberService.java | 7 + .../tools/np/services/CargoNumberService.java | 40 + .../tools/np/services/CargoStatusService.java | 57 + .../tools/np/services/CargoTypeService.java | 31 + .../das/tools/np/services/CommonService.java | 26 + .../das/tools/np/services/ConfigService.java | 81 + .../das/tools/np/services/GroupService.java | 21 + .../np/services/LocalizeResourcesService.java | 11 + .../das/tools/np/services/PluginService.java | 15 + .../np/services/SearchQueryProducer.java | 9 + .../das/tools/np/services/SearchService.java | 37 + .../das/tools/np/services/UTF8Control.java | 11 + .../np/services/impl/ApiServiceImpl.java | 116 + .../impl/ArchiveNumberServiceImpl.java | 85 + .../services/impl/CargoNumberServiceImpl.java | 260 + .../services/impl/CargoStatusServiceImpl.java | 231 + .../services/impl/CargoTypeServiceImpl.java | 113 + .../np/services/impl/CommonServiceImpl.java | 87 + .../np/services/impl/ConfigServiceImpl.java | 277 + .../np/services/impl/GroupServiceImpl.java | 71 + .../impl/LocalizeResourcesService.java | 40 + .../np/services/impl/PluginServiceImpl.java | 196 + .../impl/SearchQueryProducerImpl.java | 129 + .../np/services/impl/SearchServiceImpl.java | 156 + .../np/services/impl/UTF8ControlImpl.java | 47 + .../src/main/resources/css/combo-box.css | 6 + NovaPoshta/src/main/resources/css/config.css | 11 + .../src/main/resources/css/configTable.css | 3 + NovaPoshta/src/main/resources/css/log.css | 15 + .../resources/css/number-list-controls.css | 3 + .../main/resources/css/search-controls.css | 9 + NovaPoshta/src/main/resources/fxml/Add.fxml | 89 + .../src/main/resources/fxml/AddGroup.fxml | 35 + .../src/main/resources/fxml/Config.fxml | 60 + .../src/main/resources/fxml/Detail.fxml | 27 + NovaPoshta/src/main/resources/fxml/Main.fxml | 65 + .../src/main/resources/fxml/Search.fxml | 45 + .../src/main/resources/images/np_app_icon.ico | Bin 0 -> 3428 bytes plugins/demo/pom.xml | 59 + .../das/tools/np/entity/db/CargoNumber.java | 48 + .../das/tools/np/entity/db/CargoStatus.java | 9 + .../java/das/tools/np/entity/db/Group.java | 15 + .../das/tools/np/entity/db/NumberType.java | 8 + .../tools/np/entity/plugin/DemoPlugin.java | 47 + .../tools/np/entity/plugin/PluginInfo.java | 18 + .../np/entity/plugin/PluginInterface.java | 13 + .../np/entity/response/ResponseData.java | 176 + plugins/demo/target/DemoPlugin.jar | Bin 0 -> 29288 bytes .../db/CargoNumber$CargoNumberBuilder.class | Bin 0 -> 7253 bytes .../das/tools/np/entity/db/CargoNumber.class | Bin 0 -> 17717 bytes .../das/tools/np/entity/db/CargoStatus.class | Bin 0 -> 1357 bytes .../np/entity/db/Group$GroupBuilder.class | Bin 0 -> 1455 bytes .../das/tools/np/entity/db/Group.class | Bin 0 -> 2274 bytes .../das/tools/np/entity/db/NumberType.class | Bin 0 -> 1239 bytes .../tools/np/entity/plugin/DemoPlugin.class | Bin 0 -> 2290 bytes .../plugin/PluginInfo$PluginInfoBuilder.class | Bin 0 -> 2026 bytes .../tools/np/entity/plugin/PluginInfo.class | Bin 0 -> 4001 bytes .../np/entity/plugin/PluginInterface.class | Bin 0 -> 373 bytes .../ResponseData$ResponseDataBuilder.class | Bin 0 -> 17039 bytes .../np/entity/response/ResponseData.class | Bin 0 -> 27954 bytes .../demo/target/maven-archiver/pom.properties | 3 + .../compile/default-compile/createdFiles.lst | 12 + .../compile/default-compile/inputFiles.lst | 8 + .../default-testCompile/createdFiles.lst | 0 .../default-testCompile/inputFiles.lst | 0 plugins/template/pom.xml | 59 + .../das/tools/np/entity/db/CargoNumber.java | 48 + .../das/tools/np/entity/db/CargoStatus.java | 9 + .../java/das/tools/np/entity/db/Group.java | 15 + .../das/tools/np/entity/db/NumberType.java | 8 + .../tools/np/entity/plugin/PluginInfo.java | 18 + .../np/entity/plugin/PluginInterface.java | 13 + .../np/entity/response/ResponseData.java | 176 + plugins/template/target/PluginClassName.jar | Bin 0 -> 27997 bytes .../db/CargoNumber$CargoNumberBuilder.class | Bin 0 -> 7253 bytes .../das/tools/np/entity/db/CargoNumber.class | Bin 0 -> 17717 bytes .../das/tools/np/entity/db/CargoStatus.class | Bin 0 -> 1357 bytes .../np/entity/db/Group$GroupBuilder.class | Bin 0 -> 1455 bytes .../das/tools/np/entity/db/Group.class | Bin 0 -> 2274 bytes .../das/tools/np/entity/db/NumberType.class | Bin 0 -> 1239 bytes .../plugin/PluginInfo$PluginInfoBuilder.class | Bin 0 -> 2026 bytes .../tools/np/entity/plugin/PluginInfo.class | Bin 0 -> 4001 bytes .../np/entity/plugin/PluginInterface.class | Bin 0 -> 373 bytes .../ResponseData$ResponseDataBuilder.class | Bin 0 -> 17039 bytes .../np/entity/response/ResponseData.class | Bin 0 -> 27954 bytes .../target/maven-archiver/pom.properties | 3 + .../compile/default-compile/createdFiles.lst | 11 + .../compile/default-compile/inputFiles.lst | 7 + .../default-testCompile/createdFiles.lst | 0 .../default-testCompile/inputFiles.lst | 0 286 files changed, 24678 insertions(+) create mode 100644 NovaPoshta/.gitignore create mode 100644 NovaPoshta/DB/np_empty.db create mode 100644 NovaPoshta/Docs/API_request.json create mode 100644 NovaPoshta/Docs/API_responce_descr.xlsx create mode 100644 NovaPoshta/Docs/API_response.json create mode 100644 NovaPoshta/Docs/CFX Examples/HelloActionGroup.java create mode 100644 NovaPoshta/Docs/CFX Examples/HelloActionProxy.java create mode 100644 NovaPoshta/Docs/CFX Examples/HelloAutoComplete.java create mode 100644 NovaPoshta/Docs/CFX Examples/HelloCheckComboBox.java create mode 100644 NovaPoshta/Docs/CFX Examples/HelloDialogs.java create mode 100644 NovaPoshta/Docs/CFX Examples/HelloGlyphFont.java create mode 100644 NovaPoshta/Docs/CFX Examples/HelloHiddenSidesPane.java create mode 100644 NovaPoshta/Docs/CFX Examples/HelloListActionView.java create mode 100644 NovaPoshta/Docs/CFX Examples/HelloMasterDetailPane.java create mode 100644 NovaPoshta/Docs/CFX Examples/HelloPropertySheet.java create mode 100644 NovaPoshta/Docs/CFX Examples/HelloValidation.java create mode 100644 NovaPoshta/Docs/EditPhones.fxml create mode 100644 NovaPoshta/Docs/HelloDialogs.java create mode 100644 NovaPoshta/Docs/HelloListActionView.java create mode 100644 NovaPoshta/Docs/HelloValidation.java create mode 100644 NovaPoshta/Docs/ProxyBean.java create mode 100644 NovaPoshta/Docs/class_loader.txt create mode 100644 NovaPoshta/Docs/response.json create mode 100644 NovaPoshta/Docs/scheduling.txt create mode 100644 NovaPoshta/Docs/splitter_position.txt create mode 100644 NovaPoshta/Docs/sql/DbCreationService.java create mode 100644 NovaPoshta/Docs/sql/data.sql create mode 100644 NovaPoshta/Docs/sql/schema.sql create mode 100644 NovaPoshta/Docs/statuses.txt create mode 100644 NovaPoshta/README.md create mode 100644 NovaPoshta/distribution/assembly.xml create mode 100644 NovaPoshta/help/en/config.md create mode 100644 NovaPoshta/help/en/detail.md create mode 100644 NovaPoshta/help/en/groups.md create mode 100644 NovaPoshta/help/en/help.md create mode 100644 NovaPoshta/help/en/hot_keys.md create mode 100644 NovaPoshta/help/en/log.md create mode 100644 NovaPoshta/help/en/main.md create mode 100644 NovaPoshta/help/en/menu.md create mode 100644 NovaPoshta/help/en/new.md create mode 100644 NovaPoshta/help/en/phones.md create mode 100644 NovaPoshta/help/en/plugins.md create mode 100644 NovaPoshta/help/en/search.md create mode 100644 NovaPoshta/help/en/view_mode.md create mode 100644 NovaPoshta/help/en/windows.md create mode 100644 NovaPoshta/help/index.md create mode 100644 NovaPoshta/help/uk/config.md create mode 100644 NovaPoshta/help/uk/detail.md create mode 100644 NovaPoshta/help/uk/groups.md create mode 100644 NovaPoshta/help/uk/help.md create mode 100644 NovaPoshta/help/uk/hot_keys.md create mode 100644 NovaPoshta/help/uk/log.md create mode 100644 NovaPoshta/help/uk/main.md create mode 100644 NovaPoshta/help/uk/menu.md create mode 100644 NovaPoshta/help/uk/new.md create mode 100644 NovaPoshta/help/uk/phones.md create mode 100644 NovaPoshta/help/uk/plugins.md create mode 100644 NovaPoshta/help/uk/search.md create mode 100644 NovaPoshta/help/uk/view_mode.md create mode 100644 NovaPoshta/help/uk/windows.md create mode 100644 NovaPoshta/logs/NP.log create mode 100644 NovaPoshta/logs/NP.log.2024-06-15.0.gz create mode 100644 NovaPoshta/logs/NP.log.2024-06-16.0.gz create mode 100644 NovaPoshta/logs/NP.log.2024-06-27.0.gz create mode 100644 NovaPoshta/logs/NP.log.2024-07-01.0.gz create mode 100644 NovaPoshta/logs/NP.log.2024-10-24.0.gz create mode 100644 NovaPoshta/logs/NP.log.2024-10-26.0.gz create mode 100644 NovaPoshta/logs/NP.log.2025-03-15.0.gz create mode 100644 NovaPoshta/plugins/.gitkeep create mode 100644 NovaPoshta/pom.xml create mode 100644 NovaPoshta/run.cmd create mode 100644 NovaPoshta/run.sh create mode 100644 NovaPoshta/src/main/java/das/tools/np/JavaFxApplication.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/NovaPoshtaApplication.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/config/AppConfig.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/config/ConversionConfig.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/config/GuiConfig.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/controller/UpdateController.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/converter/CargoNumberToSimpleConverter.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/converter/CargoNumbersToSimpleNumbersConverter.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/converter/GZipToResponseDataConverter.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/converter/JsonStrToSearchParamsConverter.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/converter/JsonStrToWindowPositionConverter.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/converter/ResponseDataToCargoNumberConverter.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/converter/ResponseDataToGzipConverter.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/converter/SearchParamsToJsonStrConverter.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/converter/StringArrayIdsToDocumentsArrayConverter.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/converter/WindowPositionToJsonStrConverter.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/entity/NameValue.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/entity/StageReadyEvent.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/entity/SwitchViewEntry.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/entity/WindowPosition.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/entity/db/CargoNumber.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/entity/db/CargoStatus.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/entity/db/ExtraPhone.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/entity/db/Group.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/entity/db/NumberToPhone.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/entity/db/NumberType.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/entity/db/Property.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/entity/db/SearchHistory.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/entity/db/SearchOptions.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/entity/db/SearchResult.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/entity/db/SimpleNumber.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/entity/db/Status.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/entity/plugin/PluginInfo.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/entity/plugin/PluginInterface.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/entity/request/AppRequest.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/entity/request/Document.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/entity/request/MethodProperties.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/entity/response/AppResponse.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/entity/response/ResponseData.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/entity/search/LevenshteinDistance.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/entity/search/SearchDateValue.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/entity/search/SearchIntValue.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/entity/search/SearchParams.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/entity/search/SearchStringValue.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/entity/search/SearchTypeValue.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/entity/search/SqlCondition.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/entity/search/ValueCondition.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/entity/search/values/AbstractValueBox.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/entity/search/values/CargoStatusValueBox.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/entity/search/values/DateValueBox.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/entity/search/values/IntegerValueBox.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/entity/search/values/NumberTypeValueBox.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/entity/search/values/StatusValueBox.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/entity/search/values/StringTextBox.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/entity/search/values/StringValueBox.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/entity/search/values/TypedValueBox.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/gui/ApplicationLogService.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/gui/CargoNumbersTableViewProducerService.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/gui/FieldNameService.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/gui/FilteringModeService.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/gui/Localized.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/gui/NumberInfoTableProduceService.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/gui/NumberInfoViewService.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/gui/NumberListService.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/gui/NumberTreeViewService.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/gui/PrimaryStageInitializer.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/gui/RunInThread.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/gui/Splash.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/gui/SwitchNumberViewService.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/gui/ViewModeService.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/gui/WindowListService.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/gui/controllers/AddGroupController.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/gui/controllers/AddNumberController.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/gui/controllers/ConfigController.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/gui/controllers/DetailedInfoController.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/gui/controllers/MainController.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/gui/controllers/MainControllerImpl.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/gui/controllers/edit/EditAction.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/gui/controllers/edit/EditActionTextService.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/gui/controllers/edit/EditControlsHolder.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/gui/controllers/edit/EditControlsProducer.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/gui/controllers/edit/EditGroupsController.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/gui/controllers/edit/EditPhonesController.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/gui/controllers/edit/EditSearchOptionsController.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/gui/controllers/search/SearchController.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/gui/controllers/search/SearchControlsProduceService.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/gui/controllers/search/options/SearchCondition.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/gui/controllers/search/options/SearchOptionsControls.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/gui/controllers/windows/ArchivedNumbersController.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/gui/controllers/windows/CustomNumbersListController.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/gui/controllers/windows/WindowAction.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/gui/controllers/windows/WindowControlsHolder.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/gui/controllers/windows/WindowControlsProducer.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/gui/dialog/AlertService.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/gui/dialog/SelectComboDialog.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/gui/dialog/ToastComponent.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/gui/enums/AddsBoxTypes.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/gui/enums/FilteringMode.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/gui/enums/LogMessageType.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/gui/enums/SwitchControlType.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/gui/enums/ViewMode.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/gui/enums/WindowType.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/gui/menu/ActionService.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/gui/menu/ApplicationAction.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/gui/menu/CommonMenuService.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/gui/menu/MenuService.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/gui/menu/NumberInfoTableMenuService.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/repository/ArchiveRepository.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/repository/CargoNumberRepository.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/repository/ExtraPhonesRepository.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/repository/GroupRepository.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/repository/NumberToPhoneRepository.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/repository/PropertiesRepository.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/repository/SearchHistoryRepository.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/repository/SearchOptionsRepository.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/repository/impl/ArchiveRepositoryImpl.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/repository/impl/CargoNumberRepositoryImpl.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/repository/impl/ExtraPhonesRepositoryImpl.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/repository/impl/GroupRepositoryImpl.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/repository/impl/NumberToPhoneRepositoryImpl.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/repository/impl/PropertiesRepositoryImpl.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/repository/impl/SearchHistoryRepositoryImpl.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/repository/impl/SearchOptionsRepositoryImpl.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/services/ApiService.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/services/ArchiveNumberService.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/services/CargoNumberService.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/services/CargoStatusService.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/services/CargoTypeService.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/services/CommonService.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/services/ConfigService.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/services/GroupService.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/services/LocalizeResourcesService.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/services/PluginService.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/services/SearchQueryProducer.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/services/SearchService.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/services/UTF8Control.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/services/impl/ApiServiceImpl.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/services/impl/ArchiveNumberServiceImpl.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/services/impl/CargoNumberServiceImpl.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/services/impl/CargoStatusServiceImpl.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/services/impl/CargoTypeServiceImpl.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/services/impl/CommonServiceImpl.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/services/impl/ConfigServiceImpl.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/services/impl/GroupServiceImpl.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/services/impl/LocalizeResourcesService.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/services/impl/PluginServiceImpl.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/services/impl/SearchQueryProducerImpl.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/services/impl/SearchServiceImpl.java create mode 100644 NovaPoshta/src/main/java/das/tools/np/services/impl/UTF8ControlImpl.java create mode 100644 NovaPoshta/src/main/resources/css/combo-box.css create mode 100644 NovaPoshta/src/main/resources/css/config.css create mode 100644 NovaPoshta/src/main/resources/css/configTable.css create mode 100644 NovaPoshta/src/main/resources/css/log.css create mode 100644 NovaPoshta/src/main/resources/css/number-list-controls.css create mode 100644 NovaPoshta/src/main/resources/css/search-controls.css create mode 100644 NovaPoshta/src/main/resources/fxml/Add.fxml create mode 100644 NovaPoshta/src/main/resources/fxml/AddGroup.fxml create mode 100644 NovaPoshta/src/main/resources/fxml/Config.fxml create mode 100644 NovaPoshta/src/main/resources/fxml/Detail.fxml create mode 100644 NovaPoshta/src/main/resources/fxml/Main.fxml create mode 100644 NovaPoshta/src/main/resources/fxml/Search.fxml create mode 100644 NovaPoshta/src/main/resources/images/np_app_icon.ico create mode 100644 plugins/demo/pom.xml create mode 100644 plugins/demo/src/main/java/das/tools/np/entity/db/CargoNumber.java create mode 100644 plugins/demo/src/main/java/das/tools/np/entity/db/CargoStatus.java create mode 100644 plugins/demo/src/main/java/das/tools/np/entity/db/Group.java create mode 100644 plugins/demo/src/main/java/das/tools/np/entity/db/NumberType.java create mode 100644 plugins/demo/src/main/java/das/tools/np/entity/plugin/DemoPlugin.java create mode 100644 plugins/demo/src/main/java/das/tools/np/entity/plugin/PluginInfo.java create mode 100644 plugins/demo/src/main/java/das/tools/np/entity/plugin/PluginInterface.java create mode 100644 plugins/demo/src/main/java/das/tools/np/entity/response/ResponseData.java create mode 100644 plugins/demo/target/DemoPlugin.jar create mode 100644 plugins/demo/target/classes/das/tools/np/entity/db/CargoNumber$CargoNumberBuilder.class create mode 100644 plugins/demo/target/classes/das/tools/np/entity/db/CargoNumber.class create mode 100644 plugins/demo/target/classes/das/tools/np/entity/db/CargoStatus.class create mode 100644 plugins/demo/target/classes/das/tools/np/entity/db/Group$GroupBuilder.class create mode 100644 plugins/demo/target/classes/das/tools/np/entity/db/Group.class create mode 100644 plugins/demo/target/classes/das/tools/np/entity/db/NumberType.class create mode 100644 plugins/demo/target/classes/das/tools/np/entity/plugin/DemoPlugin.class create mode 100644 plugins/demo/target/classes/das/tools/np/entity/plugin/PluginInfo$PluginInfoBuilder.class create mode 100644 plugins/demo/target/classes/das/tools/np/entity/plugin/PluginInfo.class create mode 100644 plugins/demo/target/classes/das/tools/np/entity/plugin/PluginInterface.class create mode 100644 plugins/demo/target/classes/das/tools/np/entity/response/ResponseData$ResponseDataBuilder.class create mode 100644 plugins/demo/target/classes/das/tools/np/entity/response/ResponseData.class create mode 100644 plugins/demo/target/maven-archiver/pom.properties create mode 100644 plugins/demo/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst create mode 100644 plugins/demo/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst create mode 100644 plugins/demo/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst create mode 100644 plugins/demo/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst create mode 100644 plugins/template/pom.xml create mode 100644 plugins/template/src/main/java/das/tools/np/entity/db/CargoNumber.java create mode 100644 plugins/template/src/main/java/das/tools/np/entity/db/CargoStatus.java create mode 100644 plugins/template/src/main/java/das/tools/np/entity/db/Group.java create mode 100644 plugins/template/src/main/java/das/tools/np/entity/db/NumberType.java create mode 100644 plugins/template/src/main/java/das/tools/np/entity/plugin/PluginInfo.java create mode 100644 plugins/template/src/main/java/das/tools/np/entity/plugin/PluginInterface.java create mode 100644 plugins/template/src/main/java/das/tools/np/entity/response/ResponseData.java create mode 100644 plugins/template/target/PluginClassName.jar create mode 100644 plugins/template/target/classes/das/tools/np/entity/db/CargoNumber$CargoNumberBuilder.class create mode 100644 plugins/template/target/classes/das/tools/np/entity/db/CargoNumber.class create mode 100644 plugins/template/target/classes/das/tools/np/entity/db/CargoStatus.class create mode 100644 plugins/template/target/classes/das/tools/np/entity/db/Group$GroupBuilder.class create mode 100644 plugins/template/target/classes/das/tools/np/entity/db/Group.class create mode 100644 plugins/template/target/classes/das/tools/np/entity/db/NumberType.class create mode 100644 plugins/template/target/classes/das/tools/np/entity/plugin/PluginInfo$PluginInfoBuilder.class create mode 100644 plugins/template/target/classes/das/tools/np/entity/plugin/PluginInfo.class create mode 100644 plugins/template/target/classes/das/tools/np/entity/plugin/PluginInterface.class create mode 100644 plugins/template/target/classes/das/tools/np/entity/response/ResponseData$ResponseDataBuilder.class create mode 100644 plugins/template/target/classes/das/tools/np/entity/response/ResponseData.class create mode 100644 plugins/template/target/maven-archiver/pom.properties create mode 100644 plugins/template/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst create mode 100644 plugins/template/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst create mode 100644 plugins/template/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst create mode 100644 plugins/template/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst diff --git a/NovaPoshta/.gitignore b/NovaPoshta/.gitignore new file mode 100644 index 0000000..bb9401a --- /dev/null +++ b/NovaPoshta/.gitignore @@ -0,0 +1,45 @@ +HELP.md +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/**/target/ +!**/src/test/**/target/ + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ +!**/src/main/**/build/ +!**/src/test/**/build/ + +### VS Code ### +.vscode/ + +### App ### +*.properties +mvnw +mvnw.cmd +*.zip +*.png +/plugins/tt1/ +/plugins/tt2/ +/plugins/DemoPlugin.jar +/plugins/RunTestImpl.jar +/DB/np.db diff --git a/NovaPoshta/DB/np_empty.db b/NovaPoshta/DB/np_empty.db new file mode 100644 index 0000000000000000000000000000000000000000..8c41d34c81d0b1acf8eaef6b35668d7d672af1c6 GIT binary patch literal 102400 zcmeI4&u<&Y700=fNLsRJIX^do&|-{2H8)BV(GC(MK+rJM+7Mz2<7J@Wzlr#v6ptm0K2lUWG?mZRgvB+PLQxKrYDaW9PTspHqXGv*yDFrPUf9Z(Y zoq6--&1c@cncbOa`{oV9q2#V&+K3=<(|o)b&h2Tz zntDTJP;1rgT6Hax;X>U(8%C-QGGaB;hmNIrU3)_Hr8(t|g@Sx@MamgHoj$bhcbFHq zw1H!~_pPB`Z&ij87MO>f<6dTzit=mA(j&<&C)Vs4z`#EgQ%k;ct=HGocZir1$#Yy{ zPT6gx@=W@pMG5hGKIXn+PP*?3UUGWJb*&`_n$_Odtn!srg#=!k>T#x} zvvKLMCPvSpd(;X`vrfBnz93hYr1xFeo|x@%+vcGCl=Cshqhg$|pX#CArpyT}<=wd= z*Y5XatXxA-KX)YszuY!ov3=ma;`cu{8rHge?O+(BP5V19;-eQ6HWJ0mCxluQC?b-zQ_xa+4k8N ze0^dhwiCVhtPbo|96ImSSCk~5-LuR=pS6F)Rf$gTYJ-kLDoMq)e!pcqnlrFZRtUG`NDrv7x9@QKlA6*s?Nk|^+HK3| zJBHcIT6tTu_RJ>d6U3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F`(38v1e?Lw4iCe~Z@(@q}Kw>x|(!>B>e1;>pJg zm>d4#iK48s8|H*%tMGHUx1V8`;KmY_l00ck)1V8`;Kp>3(&i|(o zLOuw900@8p2!H?xfB*=900@8p2uwZ!JpWIAAEE^y00JNY0w4eaAOHd&00JNY0w9n^ z0O$YH2q7N?KmY_l00ck)1V8`;KmY_l00btV0G|IRzYoy@5C8!X009sH0T2KI5C8!X z009t4BOsjre~!t@?B`kkcX0g-yMKcHJjH&V_Vc(5PtS7C#P9(D5C8!X009sH0T2KI P5C8!X009vAe-ijFr{*k$ literal 0 HcmV?d00001 diff --git a/NovaPoshta/Docs/API_request.json b/NovaPoshta/Docs/API_request.json new file mode 100644 index 0000000..d179044 --- /dev/null +++ b/NovaPoshta/Docs/API_request.json @@ -0,0 +1,18 @@ +{ + "apiKey": "[ВАШ КЛЮЧ]", + "modelName": "TrackingDocument", + "calledMethod": "getStatusDocuments", + "methodProperties": { + "Documents" : [ + { + "DocumentNumber":"20400048799000", + "Phone":"380600000000" + } + , + { + "DocumentNumber":"20400048799001", + "Phone":"380600000000" + } + ] + } +} diff --git a/NovaPoshta/Docs/API_responce_descr.xlsx b/NovaPoshta/Docs/API_responce_descr.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..13ba1da02c9bb119ecd8446e0924c77564338731 GIT binary patch literal 14565 zcmeHugBB2Co%Q zn{5A8ntOrp~i)uRuksgi09Ob@w|^@KLXB`;RR5{0I);FdN0y`}=00sM#P3deK4 zC&^r~fTD7>=(@N_wmdB0=_&Md!zhB4q4!%sG z<>}U#V{?lT3R;wdeY9aFL|_SlMXq5&yC5=q56wWj+WMuL8Ln^1-P_<$0;@H9tFqBW z|B)wPGA>FrPhqy!t;KRX7XC8b>GFv6b8$sD-4`vBBl#QHXLl?U?<+gnqDxHwiG89R zrnqyDjvyGP5M+y0z*_4u$`3rJ3h;f{^B-y)m}i&|Nr*8soSd;)OMp~2L(KR}?kfaH ze}p3uNArd2D7?F}WyIC&0wKbUlyg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Xw zk;oS;qX(XBRk4BYbw+zowCg`hJnM~GqT)ebiVNyR{=1hN+S~uvNkNwL=aH45V7JVO zFmMWSjgPR3%eAVA;9qVe$?>CF04%}POuodJxRxxeJpO1}p)r1D(RC@>+uQv+9@vRGB1R4OgJNdx^v!wwgZHHnTK|TXeUCA@yyT`{mro%(wWzFhd<5RNQdBx8 z9Vw}j0YvloA%2C7IPQ&=k`4qpV<11|J;5~&N_&`$g!JVJTp#e0% z=UTQA^xT1Q)Hu$Dx6IRQ1{xKsjyE@sv-Ef<&9u#AJJ|@OE)AF6?A-f47sNRrr!cub z)KwTGtqlZwyc%DXCo7(^(6zeWas`zy__z0O!wC|gCa|rl<;FDHB(r|R#v#s-FjJ=k z6FF0yPTLz#uN+yoHD2Jc`_K%J)a|Z!)bO#9j;#DrTL;4rWyW~T!cpXND^%Ce z{n4Elqj%um_o~C4)dFwzUCbN{>CR`%C)|ITF&H=;KL;3QCgx|I6%um-BnI^3P5%?I|DE;sFyUXU38cSY%wIvn-=+NfEzDms003SF0N_7vXntq^eG~diKntk2 y8KlwQwxHkJzqX{`h5q}3{g+4pV3YZ8nEqV86=k46HV6P9fIbu;GcINO+4_GAX(vJe literal 0 HcmV?d00001 diff --git a/NovaPoshta/Docs/API_response.json b/NovaPoshta/Docs/API_response.json new file mode 100644 index 0000000..fae2666 --- /dev/null +++ b/NovaPoshta/Docs/API_response.json @@ -0,0 +1,119 @@ +{ + "success": true, + "data": [{ + "PossibilityCreateReturn" : true, + "PossibilityCreateRefusal" : true, + "PossibilityChangeEW" : true, + "PossibilityCreateRedirecting" : true, + "Number" : "20400048799000", + "Redelivery" : "0", + "RedeliverySum" : "0", + "RedeliveryNum" : "", + "RedeliveryPayer" : "Sender/Recipient", + "OwnerDocumentType" : "", + "LastCreatedOnTheBasisDocumentType" : "", + "LastCreatedOnTheBasisPayerType" : "", + "LastCreatedOnTheBasisDateTime" : "", + "LastTransactionStatusGM" : "", + "LastTransactionDateTimeGM" : "", + "LastAmountTransferGM" : "", + "DateCreated" : "18-11-2021 11:52:42", + "DocumentWeight" : "3", + "FactualWeight" : "3", + "VolumeWeight" : "0.1", + "CheckWeight" : "", + "CheckWeightMethod" : "", + "DocumentCost" : "51", + "CalculatedWeight" : "3", + "SumBeforeCheckWeight" : "", + "PayerType" : "Sender", + "RecipientFullName" : "ПІБ", + "RecipientDateTime" : "21.11.2021 13:53:47", + "ScheduledDeliveryDate" : "19.11.2021 13:53:47", + "PaymentMethod" : "Cash", + "CargoDescriptionString" : "Одяг", + "CargoType" : "Cargo", + "CitySender" : "Київ", + "CityRecipient" : "Київ", + "WarehouseRecipient" : "Відділення №101 (до 15 кг), Міні-відділення: вул. Велика Васильківська, 143/2, (маг. "Фора")", + "CounterpartyType" : "PrivatePerson", + "AfterpaymentOnGoodsCost" : "0", + "ServiceType" : "WarehouseWarehouse", + "UndeliveryReasonsSubtypeDescription" : "", + "WarehouseRecipientNumber" : "101", + "LastCreatedOnTheBasisNumber" : "", + "PhoneRecipient" : "380600000000", + "RecipientFullNameEW" : "", + "WarehouseRecipientInternetAddressRef" : "00000000-0000-0000-0000-000000000000", + "MarketplacePartnerToken" : "", + "ClientBarcode" : "", + "RecipientAddress" : "м. Київ, Відділення №101 (до 15 кг), Міні-відділення, вул. Велика Васильківська, 143/2", + "CounterpartyRecipientDescription" : "Приватна особа", + "DateScan" : "0001-01-01 00:00:00", + "PaymentStatus" : "", + "PaymentStatusDate" : "", + "AmountToPay" : "", + "AmountPaid" : "", + "Status" : "", + "StatusCode" : "", + "RefEW" : "00000000-0000-0000-0000-000000000000", + "BackwardDeliverySubTypesActions" : "", + "BackwardDeliverySubTypesServices" : "", + "UndeliveryReasons" : "", + "DatePayedKeeping" : "", + "InternationalDeliveryType" : "", + "SeatsAmount" : "1", + "CardMaskedNumber" : "", + "ExpressWaybillPaymentStatus" : "PaymentNotAvailable", + "ExpressWaybillAmountToPay" : "", + "PhoneSender" : "", + "TrackingUpdateDate" : "2022-06-07 13:42:56", + "WarehouseSender" : "Отделение №178 (до 30 кг): просп. Оболонский, 35", + "DateReturnCargo" : "", + "DateMoving" : "", + "DateFirstDayStorage" : "", + "RefCityRecipient" : "00000000-0000-0000-0000-000000000000", + "RefCitySender" : "00000000-0000-0000-0000-000000000000", + "RefSettlementRecipient" : "00000000-0000-0000-0000-000000000000", + "RefSettlementSender" : "00000000-0000-0000-0000-000000000000", + "SenderAddress" : "м. Київ, Відділення №178 (до 30 кг): просп. Оболонський, 35", + "SenderFullNameEW" : "Іванов Петро Миколайович", + "AnnouncedPrice" : "50000", + "AdditionalInformationEW" : "", + "ActualDeliveryDate" : "", + "PostomatV3CellReservationNumber" : "00000000-0000-0000-0000-000000000000", + "OwnerDocumentNumber" : "", + "LastAmountReceivedCommissionGM" : "", + "DeliveryTimeframe" : "", + "CreatedOnTheBasis" : "", + "UndeliveryReasonsDate" : "", + "RecipientWarehouseTypeRef" : "00000000-0000-0000-0000-000000000000", + "WarehouseRecipientRef" : "00000000-0000-0000-0000-000000000000", + "CategoryOfWarehouse" : "Branch", + "WarehouseRecipientAddress" : "Киев, Героев Днепра, 53", + "WarehouseSenderInternetAddressRef" : "00000000-0000-0000-0000-000000000000", + "WarehouseSenderAddress" : "Киев, Оболонский, 35", + "CounterpartySenderType" : "PrivatePerson", + "AviaDelivery" : "", + "BarcodeRedBox" : "", + "CargoReturnRefusal" : "false", + "DaysStorageCargo" : "", + "Packaging" : null, + "PartialReturnGoods" : null, + "SecurePayment" : "false", + "PossibilityChangeCash2Card" : true, + "PossibilityChangeDeliveryIntervals" : true, + "PossibilityTermExtensio" : true, + "StorageAmount" : "", + "StoragePrice" : "", + "FreeShipping" : "", + "LoyaltyCardRecipient" : "" + }], + "errors": [], + "warnings": [], + "info": [], + "messageCodes": [], + "errorCodes": [], + "warningCodes": [], + "infoCodes": [] +} \ No newline at end of file diff --git a/NovaPoshta/Docs/CFX Examples/HelloActionGroup.java b/NovaPoshta/Docs/CFX Examples/HelloActionGroup.java new file mode 100644 index 0000000..ca5d526 --- /dev/null +++ b/NovaPoshta/Docs/CFX Examples/HelloActionGroup.java @@ -0,0 +1,204 @@ +/** + * Copyright (c) 2013, ControlsFX + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of ControlsFX, any associated website, nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL CONTROLSFX BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package org.controlsfx.samples.actions; + +import javafx.beans.property.BooleanProperty; +import javafx.collections.FXCollections; +import javafx.collections.ObservableList; +import javafx.event.ActionEvent; +import javafx.geometry.Insets; +import javafx.scene.Node; +import javafx.scene.control.ComboBox; +import javafx.scene.control.Control; +import javafx.scene.control.Label; +import javafx.scene.image.Image; +import javafx.scene.image.ImageView; +import javafx.scene.layout.GridPane; +import javafx.scene.layout.Priority; +import javafx.scene.layout.VBox; +import javafx.stage.Stage; +import org.controlsfx.ControlsFXSample; +import org.controlsfx.control.action.Action; +import org.controlsfx.control.action.ActionCheck; +import org.controlsfx.control.action.ActionGroup; +import org.controlsfx.control.action.ActionUtils; +import org.controlsfx.control.action.ActionUtils.ActionTextBehavior; +import org.controlsfx.samples.Utils; + +import java.util.Arrays; +import java.util.Collection; + +import static org.controlsfx.control.action.ActionUtils.ACTION_SEPARATOR; +import static org.controlsfx.control.action.ActionUtils.ACTION_SPAN; + +public class HelloActionGroup extends ControlsFXSample { + + private static final ImageView image = new ImageView( new Image("/org/controlsfx/samples/security-low.png")); + + private Collection actions = Arrays.asList( + new ActionGroup("Group 1", image, new DummyAction("Action 1.1", image), + new CheckDummyAction("Action 1.2") ), + new ActionGroup("Group 2", image, new DummyAction("Action 2.1"), + ACTION_SEPARATOR, + new ActionGroup("Action 2.2", new DummyAction("Action 2.2.1"), + new CheckDummyAction("Action 2.2.2")), + new DummyAction("Action 2.3") ), + ACTION_SPAN, + ACTION_SEPARATOR, + new CheckDummyAction("Action 3", image), + new ActionGroup("Group 4", image, new DummyAction("Action 4.1", image), + new CheckDummyAction("Action 4.2")) + ); + + private static class DummyAction extends Action { + public DummyAction(String name, Node image) { + super(name); + setGraphic(image); + setEventHandler(ae -> String.format("Action '%s' is executed", getText()) ); + } + + public DummyAction( String name ) { + super(name); + } + + @Override public String toString() { + return getText(); + } + } + + @ActionCheck + private static class CheckDummyAction extends Action { + public CheckDummyAction(String name, Node image) { + super(name); + setGraphic(image); + setEventHandler(ae -> String.format("Action '%s' is executed", getText()) ); + } + + public CheckDummyAction( String name ) { + super(name); + } + + @Override public String toString() { + return getText(); + } + } + + private ObservableList flatten( Collection actions, ObservableList dest ) { + for (Action a : actions) { + if ( a == null || a == ActionUtils.ACTION_SEPARATOR ) continue; + dest.add(a); + if ( a instanceof ActionGroup ) { + flatten( ((ActionGroup)a).getActions(), dest); + } + } + + return dest; + } + + @Override public String getSampleName() { + return "Action Group"; + } + + @Override public String getJavaDocURL() { + return Utils.JAVADOC_BASE + "org/controlsfx/control/action/ActionGroup.html"; + } + + @Override public String getSampleDescription() { + return "MenuBar, ToolBar and ContextMenu presented here are effortlessly built out of the same action tree. " + + "Action properties can be dynamically changed, triggering changes in all related controls"; + } + + @Override public Node getControlPanel() { + GridPane grid = new GridPane(); + grid.setVgap(10); + grid.setHgap(10); + grid.setPadding(new Insets(30, 30, 0, 30)); + + int row = 0; + + // Dynamically enable/disable action + Label lblAddCrumb = new Label("Dynamically enable/disable action: "); + lblAddCrumb.getStyleClass().add("property"); + grid.add(lblAddCrumb, 0, row); + final ComboBox cbActions = new ComboBox<>(flatten( actions, FXCollections.observableArrayList())); + cbActions.getSelectionModel().select(0); + grid.add(cbActions, 1, row); + Action toggleAction = new Action("Enable/Disable") { + { setEventHandler(this::handleAction); } + + private void handleAction(ActionEvent ae) { + Action action = cbActions.getSelectionModel().getSelectedItem(); + if ( action != null ) { + BooleanProperty p = action.disabledProperty(); + p.set(!p.get()); + } + } + }; + grid.add(ActionUtils.createButton(toggleAction), 2, row++); + + return grid; + } + + @Override public Node getPanel(final Stage stage) { + VBox root = new VBox(10); + root.setPadding(new Insets(10, 10, 10, 10)); + root.setMaxHeight(Double.MAX_VALUE); + + Insets topMargin = new Insets(7, 7, 0, 7); + Insets margin = new Insets(0, 7, 7, 7); + + addWithMargin(root, new Label("MenuBar:"), topMargin ).setStyle("-fx-font-weight: bold;"); + addWithMargin(root, ActionUtils.createMenuBar(actions), margin); + + addWithMargin(root,new Label("ToolBar (with text on controls):"), topMargin).setStyle("-fx-font-weight: bold;"); + addWithMargin(root, ActionUtils.createToolBar(actions, ActionTextBehavior.SHOW), margin); + + addWithMargin(root,new Label("ToolBar (no text on controls):"), topMargin).setStyle("-fx-font-weight: bold;"); + addWithMargin(root, ActionUtils.createToolBar(actions, ActionTextBehavior.HIDE), margin); + + addWithMargin(root, new Label("ContextMenu:"), topMargin).setStyle("-fx-font-weight: bold;"); + Label context = new Label("Right-click to see the context menu"); + addWithMargin(root,context, margin); + context.setContextMenu(ActionUtils.createContextMenu(actions)); + context.setStyle("-fx-background-color: #E0E0E0 ;-fx-border-color: black;-fx-border-style: dotted"); + context.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE); + VBox.setVgrow(context, Priority.ALWAYS); + VBox.setVgrow(root, Priority.ALWAYS); + + return root; + } + + private Control addWithMargin( VBox parent, Control control, Insets insets) { + parent.getChildren().add(control); + VBox.setMargin(control, insets); + return control; + } + + public static void main(String[] args) { + launch(args); + } +} \ No newline at end of file diff --git a/NovaPoshta/Docs/CFX Examples/HelloActionProxy.java b/NovaPoshta/Docs/CFX Examples/HelloActionProxy.java new file mode 100644 index 0000000..367f57b --- /dev/null +++ b/NovaPoshta/Docs/CFX Examples/HelloActionProxy.java @@ -0,0 +1,224 @@ +/** + * Copyright (c) 2013, ControlsFX + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of ControlsFX, any associated website, nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL CONTROLSFX BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package org.controlsfx.samples.actions; + +import javafx.beans.property.BooleanProperty; +import javafx.collections.FXCollections; +import javafx.collections.ObservableList; +import javafx.event.ActionEvent; +import javafx.geometry.Insets; +import javafx.scene.Node; +import javafx.scene.control.ComboBox; +import javafx.scene.control.Control; +import javafx.scene.control.Label; +import javafx.scene.image.Image; +import javafx.scene.image.ImageView; +import javafx.scene.layout.GridPane; +import javafx.scene.layout.Priority; +import javafx.scene.layout.VBox; +import javafx.stage.Stage; +import org.controlsfx.ControlsFXSample; +import org.controlsfx.control.action.*; +import org.controlsfx.control.action.ActionUtils.ActionTextBehavior; +import org.controlsfx.samples.Utils; + +import java.util.Arrays; +import java.util.Collection; + +import static org.controlsfx.control.action.ActionMap.action; +import static org.controlsfx.control.action.ActionMap.actions; +import static org.controlsfx.control.action.ActionUtils.ACTION_SEPARATOR; +import static org.controlsfx.control.action.ActionUtils.ACTION_SPAN; + +public class HelloActionProxy extends ControlsFXSample { + + private static final String imagePath = "/org/controlsfx/samples/security-low.png"; + private static final ImageView image = new ImageView(new Image(imagePath)); + + private Collection actions; + + public HelloActionProxy() { + ActionMap.register(this); + actions = Arrays.asList( + new ActionGroup("Group 1", image, actions("action11","action12") ), + new ActionGroup("Group 2", image, actions("action21","---","action22", "action221","action222","action23") ), + ACTION_SPAN, + ACTION_SEPARATOR, + action("action3"), + new ActionGroup("Group 4", image, actions("action41","action42")) + ); + } + + @ActionProxy(text="Action 1.1", graphic=imagePath, accelerator="ctrl+shift+T") + private void action11() { + System.out.println( "Action 1.1 is executed"); + } + + @ActionCheck + @ActionProxy(text="Action 1.2", graphic="http://icons.iconarchive.com/icons/custom-icon-design/mini-3/16/teacher-male-icon.png") + private void action12() { + System.out.println( "Action 1.2 is executed"); + } + + @ActionProxy(text="Action 2.1", graphic=imagePath, factory="org.controlsfx.samples.actions.HelloCustomActionFactory") + private void action21() { + System.out.println( "Action 2.1 is executed (and used a custom action factory)"); + } + + @ActionProxy(text="Action 2.2", graphic=imagePath) + private void action22( ActionEvent evt ) { + System.out.println( "Action 2.2 is executed (and received an ActionEvent)"); + } + + @ActionProxy(text="Action 2.2.1", graphic=imagePath) + private void action221( ActionEvent evt, Action action ) { + System.out.println( "Action 2.2.1 is executed (and received both an ActionEvent and an Action)"); + } + + @ActionProxy(text="Action 2.2.2", graphic=imagePath) + private void action222() { + System.out.println( "Action 2.2.2 is executed"); + } + + @ActionProxy(text="Action 2.3", graphic=imagePath) + private void action23() { + System.out.println( "Action 2.3 is executed"); + } + + @ActionCheck + @ActionProxy(text="Action 3", graphic="font>FontAwesome|STAR") + private void action3() { + System.out.println( "Action 3 is executed"); + } + + @ActionProxy(text="Action 4.1", graphic=imagePath) + private void action41() { + System.out.println( "Action 4.1 is executed"); + } + + @ActionProxy(text="Action 4.2", graphic=imagePath) + private void action42() { + System.out.println( "Action 4.2 is executed"); + } + + private ObservableList flatten( Collection actions, ObservableList dest ) { + + for (Action a : actions) { + if ( a == null || a == ActionUtils.ACTION_SEPARATOR ) continue; + dest.add(a); + if ( a instanceof ActionGroup ) { + flatten( ((ActionGroup)a).getActions(), dest); + } + } + + return dest; + } + + + @Override public String getSampleName() { + return "Action Proxy"; + } + + @Override public String getJavaDocURL() { + return Utils.JAVADOC_BASE + "org/controlsfx/control/action/ActionProxy.html"; + } + + @Override public String getSampleDescription() { + return "MenuBar, ToolBar and ContextMenu presented here are effortlessly built out of the same action tree. " + + "Action properties can be dynamically changed, triggering changes in all related controls"; + } + + @Override public Node getControlPanel() { + GridPane grid = new GridPane(); + grid.setVgap(10); + grid.setHgap(10); + grid.setPadding(new Insets(30, 30, 0, 30)); + + int row = 0; + + // Dynamically enable/disable action + Label lblAddCrumb = new Label("Dynamically enable/disable action: "); + lblAddCrumb.getStyleClass().add("property"); + grid.add(lblAddCrumb, 0, row); + final ComboBox cbActions = new ComboBox<>(flatten( actions, FXCollections.observableArrayList())); + cbActions.getSelectionModel().select(0); + grid.add(cbActions, 1, row); + Action toggleAction = new Action("Enable/Disable") { + { setEventHandler(this::handleAction); } + + private void handleAction(ActionEvent ae) { + Action action = cbActions.getSelectionModel().getSelectedItem(); + if ( action != null ) { + BooleanProperty p = action.disabledProperty(); + p.set(!p.get()); + } + } + }; + grid.add(ActionUtils.createButton(toggleAction), 2, row++); + + return grid; + } + + @Override public Node getPanel(final Stage stage) { + VBox root = new VBox(10); + root.setPadding(new Insets(10, 10, 10, 10)); + root.setMaxHeight(Double.MAX_VALUE); + + Insets topMargin = new Insets(7, 7, 0, 7); + Insets margin = new Insets(0, 7, 7, 7); + + addWithMargin(root, new Label("MenuBar:"), topMargin ).setStyle("-fx-font-weight: bold;"); + addWithMargin(root, ActionUtils.createMenuBar(actions), margin); + + addWithMargin(root,new Label("ToolBar (with text on controls):"), topMargin).setStyle("-fx-font-weight: bold;"); + addWithMargin(root, ActionUtils.createToolBar(actions, ActionTextBehavior.SHOW), margin); + + addWithMargin(root,new Label("ToolBar (no text on controls):"), topMargin).setStyle("-fx-font-weight: bold;"); + addWithMargin(root, ActionUtils.createToolBar(actions, ActionTextBehavior.HIDE), margin); + + addWithMargin(root, new Label("ContextMenu:"), topMargin).setStyle("-fx-font-weight: bold;"); + Label context = new Label("Right-click to see the context menu"); + addWithMargin(root,context, margin); + context.setContextMenu(ActionUtils.createContextMenu(actions)); + context.setStyle("-fx-background-color: #E0E0E0 ;-fx-border-color: black;-fx-border-style: dotted"); + context.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE); + VBox.setVgrow(context, Priority.ALWAYS); + VBox.setVgrow(root, Priority.ALWAYS); + + return root; + } + + private Control addWithMargin( VBox parent, Control control, Insets insets) { + parent.getChildren().add(control); + VBox.setMargin(control, insets); + return control; + } + + public static void main(String[] args) { + launch(args); + } +} \ No newline at end of file diff --git a/NovaPoshta/Docs/CFX Examples/HelloAutoComplete.java b/NovaPoshta/Docs/CFX Examples/HelloAutoComplete.java new file mode 100644 index 0000000..9366d30 --- /dev/null +++ b/NovaPoshta/Docs/CFX Examples/HelloAutoComplete.java @@ -0,0 +1,208 @@ +/** + * Copyright (c) 2014, ControlsFX + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of ControlsFX, any associated website, nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL CONTROLSFX BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package org.controlsfx.samples.textfields; + +import java.lang.reflect.Field; +import java.util.Arrays; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +import org.controlsfx.ControlsFXSample; +import org.controlsfx.control.textfield.AutoCompletionBinding; +import org.controlsfx.control.textfield.TextFields; +import org.controlsfx.samples.Utils; + +import impl.org.controlsfx.skin.AutoCompletePopup; +import impl.org.controlsfx.skin.AutoCompletePopupSkin; +import javafx.event.EventHandler; +import javafx.geometry.Insets; +import javafx.scene.Node; +import javafx.scene.control.Label; +import javafx.scene.control.ListCell; +import javafx.scene.control.TextField; +import javafx.scene.input.KeyEvent; +import javafx.scene.layout.BorderPane; +import javafx.scene.layout.GridPane; +import javafx.scene.layout.Priority; +import javafx.scene.paint.Color; +import javafx.scene.shape.Rectangle; +import javafx.stage.Stage; + +public class HelloAutoComplete extends ControlsFXSample { + + private AutoCompletionBinding autoCompletionBinding; + private String[] _possibleSuggestions = {"Hey", "Hello", "Hello World", "Apple", "Cool", "Costa", "Cola", "Coca Cola"}; + private Set possibleSuggestions = new HashSet<>(Arrays.asList(_possibleSuggestions)); + private Map colorSuggestions = allColorsWithName(); + + private TextField learningTextField; + + @Override public String getSampleName() { + return "AutoComplete"; + } + + @Override public String getJavaDocURL() { + return Utils.JAVADOC_BASE + "org/controlsfx/control/textfield/TextFields.html"; + } + + @Override public String getSampleDescription() { + return "AutoComplete helps a user with suggestions to type faster, " + + "but does not limit the user from entering alternative text." + + "\n\n" + + "The textfields have been primed with the following words:\n" + + "\"Hey\", \"Hello\", \"Hello World\", \"Apple\", \"Cool\", " + + "\"Costa\", \"Cola\", \"Coca Cola\"" + + "\n\n" + + "The 'Learning TextField' will add whatever words are typed " + + "to the auto-complete popup, as long as you press Enter once " + + "you've finished typing the word." + + "\n\n" + + "The Color TextField will suggest different colors when you type " + + "in their name."; + } + + @Override public Node getPanel(final Stage stage) { + + BorderPane root = new BorderPane(); + + GridPane grid = new GridPane(); + grid.setVgap(10); + grid.setHgap(10); + grid.setPadding(new Insets(30, 30, 0, 30)); + + // + // TextField with static auto-complete functionality + // + TextField textField = new TextField(); + + TextFields.bindAutoCompletion( + textField, + "Hey", "Hello", "Hello World", "Apple", "Cool", "Costa", "Cola", "Coca Cola"); + + grid.add(new Label("Auto-complete Text"), 0, 0); + grid.add(textField, 1, 0); + GridPane.setHgrow(textField, Priority.ALWAYS); + + + // + // TextField with learning auto-complete functionality + // Learn the word when user presses ENTER + // + learningTextField = new TextField(); + autoCompletionBinding = TextFields.bindAutoCompletion(learningTextField, possibleSuggestions); + learningTextField.setOnKeyPressed(new EventHandler() { + @Override + public void handle(KeyEvent ke) { + switch (ke.getCode()) { + case ENTER: + autoCompletionLearnWord(learningTextField.getText().trim()); + break; + default: + break; + } + } + }); + + grid.add(new Label("Learning TextField"), 0, 1); + grid.add(learningTextField, 1, 1); + GridPane.setHgrow(learningTextField, Priority.ALWAYS); + + // + // TextField with custom cell factory + // Completes color names + // + TextField customTextField = new TextField(); + AutoCompletePopup colorCompletionPopup = TextFields.bindAutoCompletion(customTextField, colorSuggestions.keySet()).getAutoCompletionPopup(); + colorCompletionPopup.setSkin(new AutoCompletePopupSkin(colorCompletionPopup, param -> new ListCell() { + @Override + public void updateItem(String item, boolean empty) { + super.updateItem(item, empty); + if (empty) { + setText(null); + setGraphic(null); + } else { + setGraphic(new Rectangle(32, 32, colorSuggestions.get(item))); + setText(item); + } + } + })); + + grid.add(new Label("Color TextField with custom CellFactory"), 0, 2); + grid.add(customTextField, 1, 2); + GridPane.setHgrow(customTextField, Priority.ALWAYS); + + root.setTop(grid); + return root; + } + + private void autoCompletionLearnWord(String newWord){ + possibleSuggestions.add(newWord); + + // we dispose the old binding and recreate a new binding + if (autoCompletionBinding != null) { + autoCompletionBinding.dispose(); + } + autoCompletionBinding = TextFields.bindAutoCompletion(learningTextField, possibleSuggestions); + } + + @Override public Node getControlPanel() { + GridPane grid = new GridPane(); + grid.setVgap(10); + grid.setHgap(10); + grid.setPadding(new Insets(30, 30, 0, 30)); + + // TODO Add customization example controls + + + return grid; + } + + /* Modified from https://stackoverflow.com/a/17465261/6094756 */ + private Map allColorsWithName() { + Map map = new HashMap<>(); + try { + for (Field f : Color.class.getFields()) { + Object obj = f.get(null); + if (obj instanceof Color) { + map.put(f.getName(), (Color) obj); + } + } + } catch (IllegalArgumentException | IllegalAccessException e) { + map.put("red", Color.RED); + map.put("green", Color.GREEN); + map.put("blue", Color.BLUE); + } + return map; + } + + public static void main(String[] args) { + launch(args); + } + +} \ No newline at end of file diff --git a/NovaPoshta/Docs/CFX Examples/HelloCheckComboBox.java b/NovaPoshta/Docs/CFX Examples/HelloCheckComboBox.java new file mode 100644 index 0000000..25b115e --- /dev/null +++ b/NovaPoshta/Docs/CFX Examples/HelloCheckComboBox.java @@ -0,0 +1,241 @@ +/** + * Copyright (c) 2013, 2018 ControlsFX + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of ControlsFX, any associated website, nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL CONTROLSFX BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package org.controlsfx.samples.checked; + +import javafx.beans.binding.Bindings; +import javafx.beans.property.ReadOnlyStringProperty; +import javafx.beans.property.ReadOnlyStringWrapper; +import javafx.beans.property.SimpleStringProperty; +import javafx.beans.property.StringProperty; +import javafx.collections.FXCollections; +import javafx.collections.ListChangeListener; +import javafx.collections.ObservableList; +import javafx.geometry.Insets; +import javafx.scene.Node; +import javafx.scene.control.CheckBox; +import javafx.scene.control.ComboBox; +import javafx.scene.control.Label; +import javafx.scene.layout.GridPane; +import javafx.stage.Stage; +import javafx.util.StringConverter; + +import org.controlsfx.ControlsFXSample; +import org.controlsfx.control.CheckComboBox; +import org.controlsfx.control.IndexedCheckModel; +import org.controlsfx.samples.Utils; + +public class HelloCheckComboBox extends ControlsFXSample { + + private final Label checkedItemsLabel = new Label(); + private CheckComboBox checkComboBox; + + @Override public String getSampleName() { + return "CheckComboBox"; + } + + @Override public String getJavaDocURL() { + return Utils.JAVADOC_BASE + "org/controlsfx/control/CheckComboBox.html"; + } + + @Override public String getSampleDescription() { + return "A simple UI control that makes it possible to select zero or " + + "more items within a ComboBox without the need to set a custom " + + "cell factory or manually create boolean properties for each " + + "row - simply use the check model property to request the " + + "current selection state."; + } + + @Override public Node getPanel(Stage stage) { + GridPane grid = new GridPane(); + grid.setVgap(10); + grid.setHgap(10); + grid.setPadding(new Insets(30, 30, 0, 30)); + + int row = 0; + + final ObservableList strings = FXCollections.observableArrayList(); + for (int i = 0; i <= 100; i++) { + strings.add("Item " + i); + } + + // normal ComboBox + grid.add(new Label("Normal ComboBox: "), 0, row); + final ComboBox comboBox = new ComboBox<>(strings); + comboBox.focusedProperty().addListener((o, ov, nv) -> { + if(nv) comboBox.show(); else comboBox.hide(); + }); + grid.add(comboBox, 1, row++); + + // CheckComboBox + checkComboBox = new CheckComboBox<>(strings); + checkComboBox.focusedProperty().addListener((o, ov, nv) -> { + if(nv) checkComboBox.show(); else checkComboBox.hide(); + }); + checkComboBox.getCheckModel().getCheckedItems().addListener((ListChangeListener) change -> { + updateText(checkedItemsLabel, change.getList()); + + while (change.next()) { + System.out.println("============================================"); + System.out.println("Change: " + change); + System.out.println("Added sublist " + change.getAddedSubList()); + System.out.println("Removed sublist " + change.getRemoved()); + System.out.println("List " + change.getList()); + System.out.println("Added " + change.wasAdded() + " Permutated " + change.wasPermutated() + " Removed " + change.wasRemoved() + " Replaced " + + change.wasReplaced() + " Updated " + change.wasUpdated()); + System.out.println("============================================"); + } + }); + grid.add(new Label("CheckComboBox: "), 0, row); + grid.add(checkComboBox, 1, row++); + + CheckComboBox checkComboBox2 = new CheckComboBox<>(Person.createDemoList()); + checkComboBox2.setConverter(new StringConverter() { + @Override + public String toString(Person object) { + return object.getFullName(); + } + @Override + public Person fromString(String string) { + return null; + } + }); + checkComboBox2.focusedProperty().addListener((o, ov, nv) -> { + if(nv) checkComboBox2.show(); else checkComboBox2.hide(); + }); + grid.add(new Label("CheckComboBox with data objects: "), 0, row); + grid.add(checkComboBox2, 1, row); + + return grid; + } + + @Override public Node getControlPanel() { + GridPane grid = new GridPane(); + grid.setVgap(10); + grid.setHgap(10); + grid.setPadding(new Insets(30, 30, 0, 30)); + + int row = 0; + + Label label1 = new Label("Checked items: "); + label1.getStyleClass().add("property"); + grid.add(label1, 0, 0); + grid.add(checkedItemsLabel, 1, row++); + updateText(checkedItemsLabel, null); + + Label checkItem2Label = new Label("Check 'Item 2': "); + checkItem2Label.getStyleClass().add("property"); + grid.add(checkItem2Label, 0, row); + final CheckBox checkItem2Btn = new CheckBox(); + checkItem2Btn.setOnAction(e -> { + IndexedCheckModel cm = checkComboBox.getCheckModel(); + if (cm != null) { + cm.toggleCheckState(2); + } + }); + grid.add(checkItem2Btn, 1, row); + + return grid; + } + + protected void updateText(Label label, ObservableList list) { + final StringBuilder sb = new StringBuilder(); + + if (list != null) { + for (int i = 0, max = list.size(); i < max; i++) { + sb.append(list.get(i)); + if (i < max - 1) { + sb.append(", "); + } + } + } + + final String str = sb.toString(); + label.setText(str.isEmpty() ? "" : str); + } + + public static void main(String[] args) { + launch(args); + } + +} + +class Person { + private StringProperty firstName = new SimpleStringProperty(); + private StringProperty lastName = new SimpleStringProperty(); + private ReadOnlyStringWrapper fullName = new ReadOnlyStringWrapper(); + + public Person(String firstName, String lastName) { + this.firstName.set(firstName); + this.lastName.set(lastName); + fullName.bind(Bindings.concat(firstName, " ", lastName)); + } + + public static final ObservableList createDemoList() { + final ObservableList result = FXCollections.observableArrayList(); + result.add(new Person("Paul", "McCartney")); + result.add(new Person("Andrew Lloyd", "Webber")); + result.add(new Person("Herb", "Alpert")); + result.add(new Person("Emilio", "Estefan")); + result.add(new Person("Bernie", "Taupin")); + result.add(new Person("Elton", "John")); + result.add(new Person("Mick", "Jagger")); + result.add(new Person("Keith", "Richerds")); + return result; + } + + public final StringProperty firstNameProperty() { + return this.firstName; + } + + public final java.lang.String getFirstName() { + return this.firstNameProperty().get(); + } + + public final void setFirstName(final String firstName) { + this.firstNameProperty().set(firstName); + } + + public final StringProperty lastNameProperty() { + return this.lastName; + } + + public final String getLastName() { + return this.lastNameProperty().get(); + } + + public final void setLastName(final String lastName) { + this.lastNameProperty().set(lastName); + } + + public final ReadOnlyStringProperty fullNameProperty() { + return this.fullName.getReadOnlyProperty(); + } + + public final String getFullName() { + return this.fullNameProperty().get(); + } +} \ No newline at end of file diff --git a/NovaPoshta/Docs/CFX Examples/HelloDialogs.java b/NovaPoshta/Docs/CFX Examples/HelloDialogs.java new file mode 100644 index 0000000..d0fb1e6 --- /dev/null +++ b/NovaPoshta/Docs/CFX Examples/HelloDialogs.java @@ -0,0 +1,742 @@ +/** + * Copyright (c) 2013, 2015 ControlsFX + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of ControlsFX, any associated website, nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL CONTROLSFX BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package org.controlsfx.samples.dialogs; + +import java.util.Arrays; +import java.util.List; +import java.util.Optional; + +import javafx.application.Application; +import javafx.application.Platform; +import javafx.collections.FXCollections; +import javafx.concurrent.Task; +import javafx.event.ActionEvent; +import javafx.geometry.Insets; +import javafx.scene.Node; +import javafx.scene.control.Alert; +import javafx.scene.control.Alert.AlertType; +import javafx.scene.control.Button; +import javafx.scene.control.ButtonBar.ButtonData; +import javafx.scene.control.ButtonType; +import javafx.scene.control.CheckBox; +import javafx.scene.control.ChoiceDialog; +import javafx.scene.control.ComboBox; +import javafx.scene.control.Dialog; +import javafx.scene.control.Label; +import javafx.scene.control.TextField; +import javafx.scene.control.TextInputDialog; +import javafx.scene.image.Image; +import javafx.scene.image.ImageView; +import javafx.scene.layout.GridPane; +import javafx.scene.layout.HBox; +import javafx.scene.layout.Priority; +import javafx.scene.layout.VBox; +import javafx.scene.text.Font; +import javafx.stage.Modality; +import javafx.stage.Stage; +import javafx.stage.StageStyle; +import javafx.stage.Window; + +import org.controlsfx.ControlsFXSample; +import org.controlsfx.dialog.CommandLinksDialog; +import org.controlsfx.dialog.CommandLinksDialog.CommandLinksButtonType; +import org.controlsfx.dialog.WizardPane; +import org.controlsfx.dialog.ExceptionDialog; +import org.controlsfx.dialog.FontSelectorDialog; +import org.controlsfx.dialog.LoginDialog; +import org.controlsfx.dialog.ProgressDialog; +import org.controlsfx.dialog.Wizard; +import org.controlsfx.dialog.Wizard.LinearFlow; +import org.controlsfx.validation.ValidationSupport; +import org.controlsfx.validation.Validator; + +public class HelloDialogs extends ControlsFXSample { + + @Override + public String getSampleName() { + return "Dialogs"; + } + + @Override + public String getJavaDocURL() { +// return Utils.JAVADOC_BASE + "org/controlsfx/dialog/Dialogs.html"; + return null; + } + + @Override + public String getSampleDescription() { + return ""; + } + + private final ComboBox styleCombobox = new ComboBox<>(); + private final ComboBox modalityCombobox = new ComboBox<>(); + private final CheckBox cbUseBlocking = new CheckBox(); + private final CheckBox cbCloseDialogAutomatically = new CheckBox(); + private final CheckBox cbShowMasthead = new CheckBox(); + private final CheckBox cbSetOwner = new CheckBox(); + private final CheckBox cbCustomGraphic = new CheckBox(); + + private Stage stage; + + @Override + public Node getPanel(Stage stage) { + this.stage = stage; + + GridPane grid = new GridPane(); + grid.setPadding(new Insets(10, 10, 10, 10)); + grid.setHgap(10); + grid.setVgap(10); + + int row = 0; + + Label javafxDialogs = new Label("JavaFX Dialogs:"); + javafxDialogs.setFont(Font.font(25)); + grid.add(javafxDialogs, 0, row++, 2, 1); + + // ******************************************************************* + // Information Dialog + // ******************************************************************* + + grid.add(createLabel("Information Dialog: "), 0, row); + + final Button Hyperlink2 = new Button("Show"); + Hyperlink2.setOnAction( (ActionEvent e) -> { + + Alert dlg = createAlert(AlertType.INFORMATION); + dlg.setTitle("Custom title"); + String optionalMasthead = "Wouldn't this be nice?"; + dlg.getDialogPane().setContentText("A collection of pre-built JavaFX dialogs?\nSeems like a great idea to me..."); + configureSampleDialog(dlg, optionalMasthead); + + // lets get some output when events happen + dlg.setOnShowing(evt -> System.out.println(evt)); + dlg.setOnShown(evt -> System.out.println(evt)); + dlg.setOnHiding(evt -> System.out.println(evt)); + dlg.setOnHidden(evt -> System.out.println(evt)); + +// dlg.setOnCloseRequest(evt -> evt.consume()); + + showDialog(dlg); + }); + + final Button Hyperlink2a = new Button("2 x Buttons (no cancel)"); + Hyperlink2a.setOnAction( (ActionEvent e) -> { + Alert dlg = createAlert(AlertType.INFORMATION); + dlg.setTitle("Custom title"); + String optionalMasthead = "Wouldn't this be nice?"; + dlg.getDialogPane().setContentText("A collection of pre-built JavaFX dialogs?\nSeems like a great idea to me..."); + configureSampleDialog(dlg, optionalMasthead); + dlg.getButtonTypes().add(ButtonType.NEXT); + +// dlg.setOnCloseRequest(evt -> evt.consume()); + + showDialog(dlg); + + }); + + grid.add(new HBox(10, Hyperlink2, Hyperlink2a), 1, row); + + row++; + + // ******************************************************************* + // Confirmation Dialog + // ******************************************************************* + + grid.add(createLabel("Confirmation Dialog: "), 0, row); + + final CheckBox cbShowCancel = new CheckBox("Show Cancel Button"); + cbShowCancel.setSelected(true); + + final Button Hyperlink3 = new Button("Show"); + Hyperlink3.setOnAction(e -> { + Alert dlg = createAlert(AlertType.CONFIRMATION); + dlg.setTitle("You do want dialogs right?"); + String optionalMasthead = "Just Checkin'"; + dlg.getDialogPane().setContentText("I was a bit worried that you might not want them, so I wanted to double check."); + + if (!cbShowCancel.isSelected()) { + dlg.getDialogPane().getButtonTypes().remove(ButtonType.CANCEL); + } + + configureSampleDialog(dlg, optionalMasthead); + showDialog(dlg); + }); + grid.add(new HBox(10, Hyperlink3, cbShowCancel), 1, row); + + row++; + + // ******************************************************************* + // Warning Dialog + // ******************************************************************* + + grid.add(createLabel("Warning Dialog: "), 0, row); + + final Button Hyperlink6a = new Button("Show"); + Hyperlink6a.setOnAction(e -> { + Alert dlg = createAlert(AlertType.WARNING); + dlg.setTitle("I'm warning you!"); + String optionalMasthead = "This is a warning"; + dlg.getDialogPane().setContentText("I'm glad I didn't need to use this..."); + configureSampleDialog(dlg, optionalMasthead); + showDialog(dlg); + }); + grid.add(new HBox(10, Hyperlink6a), 1, row); + + row++; + + // ******************************************************************* + // Error Dialog + // ******************************************************************* + + grid.add(createLabel("Error Dialog: "), 0, row); + + final Button Hyperlink7a = new Button("Show"); + Hyperlink7a.setOnAction(e -> { + Alert dlg = createAlert(AlertType.ERROR); + dlg.setTitle("It looks like you're making a bad decision"); + String optionalMasthead = "Exception Encountered"; + dlg.getDialogPane().setContentText("Better change your mind - this is really your last chance! (Even longer text that should probably wrap)"); + configureSampleDialog(dlg, optionalMasthead); + showDialog(dlg); + }); + grid.add(new HBox(10, Hyperlink7a), 1, row); + + row++; + + + // ******************************************************************* + // Input Dialog (with header) + // ******************************************************************* + + grid.add(createLabel("Input Dialog: "), 0, row); + + final Button Hyperlink8 = new Button("TextField"); + Hyperlink8.setOnAction(e -> { + TextInputDialog dlg = new TextInputDialog(""); + dlg.setTitle("Name Check"); + String optionalMasthead = "Please type in your name"; + dlg.getDialogPane().setContentText("What is your name?"); + configureSampleDialog(dlg, optionalMasthead); + showDialog(dlg); + }); + + final Button Hyperlink9 = new Button("Initial Value Set"); + Hyperlink9.setOnAction(e -> { + TextInputDialog dlg = new TextInputDialog("Jonathan"); + dlg.setTitle("Name Guess"); + String optionalMasthead = "Name Guess"; + dlg.getDialogPane().setContentText("Pick a name?"); + configureSampleDialog(dlg, optionalMasthead); + showDialog(dlg); + }); + + final Button Hyperlink10 = new Button("Set Choices (< 10)"); + Hyperlink10.setOnAction(e -> { + ChoiceDialog dlg = new ChoiceDialog<>("Jonathan", + "Matthew", "Jonathan", "Ian", "Sue", "Hannah"); + dlg.setTitle("Name Guess"); + String optionalMasthead = "Name Guess"; + dlg.getDialogPane().setContentText("Pick a name?"); + configureSampleDialog(dlg, optionalMasthead); + showDialog(dlg); + }); + + final Button Hyperlink11 = new Button("Set Choices (>= 10)"); + Hyperlink11.setOnAction(e -> { + ChoiceDialog dlg = new ChoiceDialog<>("Jonathan", + "Matthew", "Jonathan", "Ian", "Sue", + "Hannah", "Julia", "Denise", "Stephan", + "Sarah", "Ron", "Ingrid"); + dlg.setTitle("Name Guess"); + String optionalMasthead = "Name Guess"; + dlg.getDialogPane().setContentText("Pick a name?"); + configureSampleDialog(dlg, optionalMasthead); + showDialog(dlg); + }); + + grid.add(new HBox(10, Hyperlink8, Hyperlink9, Hyperlink10, Hyperlink11), 1, row); + row++; + + + + + + + // --------- ControlsFX-specific Dialogs + + Label controlsfxDialogs = new Label("ControlsFX Dialogs:"); + controlsfxDialogs.setFont(Font.font(25)); + grid.add(controlsfxDialogs, 0, row++, 2, 1); + + + // ******************************************************************* + // Command links + // ******************************************************************* + + grid.add(createLabel("Pre-built dialogs: "), 0, row); + final Button Hyperlink12 = new Button("Command Links"); + Hyperlink12.setOnAction(e -> { + List links = Arrays + .asList(new CommandLinksButtonType( + "Add a network that is in the range of this computer", + "This shows you a list of networks that are currently available and lets you connect to one.", false), + new CommandLinksButtonType( + "Manually create a network profile", + "This creates a new network profile or locates an existing one and saves it on your computer", + true /*default*/), + new CommandLinksButtonType("Create an ad hoc network", + "This creates a temporary network for sharing files or and Internet connection", false)); + + CommandLinksDialog dlg = new CommandLinksDialog(links); + dlg.setTitle("Manually connect to wireless network"); + String optionalMasthead = "Manually connect to wireless network"; + dlg.getDialogPane().setContentText("How do you want to add a network?"); + configureSampleDialog(dlg, optionalMasthead); + showDialog(dlg); + }); + + final Button Hyperlink12a = new Button("Font Selector"); + Hyperlink12a.setOnAction(e -> { + FontSelectorDialog dlg = new FontSelectorDialog(null); + configureSampleDialog(dlg, "Please select a font!"); + showDialog(dlg); + }); + + final Button Hyperlink12b = new Button("Progress"); + Hyperlink12b.setOnAction((ActionEvent e) -> { + Task worker = new Task() { + @Override + protected Object call() throws Exception { + for (int i = 0; i <= 100; i++) { + updateProgress(i, 99); + updateMessage("progress: " + i); + System.out.println("progress: " + i); + Thread.sleep(100); + } + return null; + } + }; + + ProgressDialog dlg = new ProgressDialog(worker); + configureSampleDialog(dlg, ""); + + Thread th = new Thread(worker); + th.setDaemon(true); + th.start(); + }); + + final Button Hyperlink12c = new Button("Login"); + Hyperlink12c.setOnAction((ActionEvent e) -> { + LoginDialog dlg = new LoginDialog(null, null); + configureSampleDialog(dlg, ""); + showDialog(dlg); + }); + + final Button Hyperlink12d = new Button("Exception"); + Hyperlink12d.setOnAction((ActionEvent e) -> { + ExceptionDialog dlg = new ExceptionDialog(new Exception("ControlsFX is _too_ awesome!")); + configureSampleDialog(dlg, ""); + showDialog(dlg); + }); + + grid.add(new HBox(10, Hyperlink12, Hyperlink12a, Hyperlink12b, Hyperlink12c, Hyperlink12d), 1, row); + row++; + + + // ******************************************************************* + // wizards + // ******************************************************************* + + grid.add(createLabel("Wizard: "), 0, row); + final Button Hyperlink15a = new Button("Linear Wizard"); + Hyperlink15a.setOnAction(e -> showLinearWizard()); + + final Button Hyperlink15b = new Button("Branching Wizard"); + Hyperlink15b.setOnAction(e -> showBranchingWizard()); + + final Button Hyperlink15c = new Button("Validated Linear Wizard"); + Hyperlink15c.setOnAction(e -> showValidatedLinearWizard()); + + grid.add(new HBox(10, Hyperlink15a, Hyperlink15b, Hyperlink15c), 1, row++); + + return grid; + } + + private Alert createAlert(AlertType type) { + Window owner = cbSetOwner.isSelected() ? stage : null; + Alert dlg = new Alert(type, ""); + dlg.initModality(modalityCombobox.getValue()); + dlg.initOwner(owner); + return dlg; + } + + private void configureSampleDialog(Dialog dlg, String header) { + Window owner = cbSetOwner.isSelected() ? stage : null; + if (header != null && cbShowMasthead.isSelected()) { + dlg.getDialogPane().setHeaderText(header); + } + + if (cbCustomGraphic.isSelected()) { + dlg.getDialogPane().setGraphic(new ImageView(new Image(getClass().getResource("/org/controlsfx/samples/controlsfx-logo.png").toExternalForm()))); + } + + dlg.initStyle(styleCombobox.getValue()); + dlg.initOwner(owner); + } + + private void showDialog(Dialog dlg) { + Window owner = cbSetOwner.isSelected() ? stage : null; + if (cbCloseDialogAutomatically.isSelected()) { + new Thread(() -> { + try { + Thread.sleep(2000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + System.out.println("Attempting to close dialog now..."); + Platform.runLater(() -> dlg.close()); + }).start(); + } + dlg.initOwner(owner); + + if (cbUseBlocking.isSelected()) { + dlg.showAndWait().ifPresent(result -> System.out.println("Result is " + result)); + } else { + dlg.show(); + dlg.resultProperty().addListener(o -> System.out.println("Result is: " + dlg.getResult())); + System.out.println("This println is _after_ the show method - we're non-blocking!"); + } + } + + @Override public Node getControlPanel() { + GridPane grid = new GridPane(); + grid.setVgap(10); + grid.setHgap(10); + grid.setPadding(new Insets(30, 30, 0, 30)); + + int row = 0; + + // stage style + grid.add(createLabel("Style: ", "property"), 0, row); + styleCombobox.getItems().setAll(StageStyle.values()); + styleCombobox.setValue(styleCombobox.getItems().get(0)); + grid.add(styleCombobox, 1, row); + row++; + + // modality + grid.add(createLabel("Modality: ", "property"), 0, row); + modalityCombobox.getItems().setAll(Modality.values()); + modalityCombobox.setValue(modalityCombobox.getItems().get(Modality.values().length-1)); + grid.add(modalityCombobox, 1, row); + row++; + + // use blocking + cbUseBlocking.setSelected(true); + grid.add(createLabel("Use blocking: ", "property"), 0, row); + grid.add(cbUseBlocking, 1, row); + row++; + + // close dialog automatically + grid.add(createLabel("Close dialog after 2000ms: ", "property"), 0, row); + grid.add(cbCloseDialogAutomatically, 1, row); + row++; + + // show header + grid.add(createLabel("Show custom header text: ", "property"), 0, row); + grid.add(cbShowMasthead, 1, row); + row++; + + // set owner + grid.add(createLabel("Set dialog owner: ", "property"), 0, row); + grid.add(cbSetOwner, 1, row); + row++; + + // custom graphic + grid.add(createLabel("Use custom graphic: ", "property"), 0, row); + grid.add(cbCustomGraphic, 1, row); + row++; + + return grid; + } + +// private CommandLinksButtonType buildCommandLink( String text, String comment, boolean isDefault ) { +// return new CommandLinksButtonType(text, comment, isDefault); +// } + + + public static void main(String[] args) { + Application.launch(args); + } + + private Node createLabel(String text, String... styleclass) { + Label label = new Label(text); + + if (styleclass == null || styleclass.length == 0) { + label.setFont(Font.font(13)); + } else { + label.getStyleClass().addAll(styleclass); + } + return label; + } + + private void showLinearWizard() { + Window owner = cbSetOwner.isSelected() ? stage : null; + // define pages to show + Wizard wizard = new Wizard(owner); + wizard.setTitle("Linear Wizard"); + + // --- page 1 + int row = 0; + + GridPane page1Grid = new GridPane(); + page1Grid.setVgap(10); + page1Grid.setHgap(10); + + page1Grid.add(new Label("First Name:"), 0, row); + TextField txFirstName = createTextField("firstName"); +// wizard.getValidationSupport().registerValidator(txFirstName, Validator.createEmptyValidator("First Name is mandatory")); + page1Grid.add(txFirstName, 1, row++); + + page1Grid.add(new Label("Last Name:"), 0, row); + TextField txLastName = createTextField("lastName"); +// wizard.getValidationSupport().registerValidator(txLastName, Validator.createEmptyValidator("Last Name is mandatory")); + page1Grid.add(txLastName, 1, row); + + WizardPane page1 = new WizardPane(); + page1.setHeaderText("Please Enter Your Details"); + page1.setContent(page1Grid); + + + // --- page 2 + final WizardPane page2 = new WizardPane() { + @Override public void onEnteringPage(Wizard wizard) { + String firstName = (String) wizard.getSettings().get("firstName"); + String lastName = (String) wizard.getSettings().get("lastName"); + + setContentText("Welcome, " + firstName + " " + lastName + "! Let's add some newlines!\n\n\n\n\n\n\nHello World!"); + } + }; + page2.setHeaderText("Thanks For Your Details!"); + + + // --- page 3 + WizardPane page3 = new WizardPane(); + page3.setHeaderText("Goodbye!"); + page3.setContentText("Page 3, with extra 'help' button!"); + + ButtonType helpDialogButton = new ButtonType("Help", ButtonData.HELP_2); + page3.getButtonTypes().add(helpDialogButton); + Button helpButton = (Button) page3.lookupButton(helpDialogButton); + helpButton.addEventFilter(ActionEvent.ACTION, actionEvent -> { + actionEvent.consume(); // stop hello.dialog from closing + System.out.println("Help clicked!"); + }); + + + + // create wizard + wizard.setFlow(new LinearFlow(page1, page2, page3)); + + System.out.println("page1: " + page1); + System.out.println("page2: " + page2); + System.out.println("page3: " + page3); + + // show wizard and wait for response + wizard.showAndWait().ifPresent(result -> { + if (result == ButtonType.FINISH) { + System.out.println("Wizard finished, settings: " + wizard.getSettings()); + } + }); + } + + private void showBranchingWizard() { + Window owner = cbSetOwner.isSelected() ? stage : null; + // define pages to show. + // Because page1 references page2, we need to declare page2 first. + final WizardPane page2 = new WizardPane(); + page2.setContentText("Page 2"); + + final CheckBox checkBox = new CheckBox("Skip the second page"); + checkBox.setId("skip-page-2"); + VBox vbox = new VBox(10, new Label("Page 1"), checkBox); + final WizardPane page1 = new WizardPane() { + // when we exit page 1, we will check the state of the 'skip page 2' + // checkbox, and if it is true, we will remove page 2 from the pages list + @Override public void onExitingPage(Wizard wizard) { +// List pages = wizard.getPages(); +// if (checkBox.isSelected()) { +// pages.remove(page2); +// } else { +// if (! pages.contains(page2)) { +// pages.add(1, page2); +// } +// } + } + }; + page1.setContent(vbox); + + final WizardPane page3 = new WizardPane(); + page3.setContentText("Page 3"); + + // create wizard + Wizard wizard = new Wizard(owner); + wizard.setTitle("Branching Wizard"); + Wizard.Flow branchingFlow = new Wizard.Flow() { + + @Override + public Optional advance(WizardPane currentPage) { + return Optional.of(getNext(currentPage)); + } + + @Override + public boolean canAdvance(WizardPane currentPage) { + return currentPage != page3; + } + + private WizardPane getNext(WizardPane currentPage) { + if ( currentPage == null ) { + return page1; + } else if ( currentPage == page1) { + return checkBox.isSelected()? page3: page2; + } else { + return page3; + } + } + + }; + + //wizard.setFlow( new LinearWizardFlow( page1, page2, page3)); + wizard.setFlow( branchingFlow); + + // show wizard + wizard.showAndWait().ifPresent(result -> { + if (result == ButtonType.FINISH) { + System.out.println("Wizard finished, settings: " + wizard.getSettings()); + } + }); + } + + private void showValidatedLinearWizard() { + Window owner = cbSetOwner.isSelected() ? stage : null; + Wizard wizard = new Wizard(owner); + wizard.setTitle("Validated Linear Wizard"); + + // Page 1 + WizardPane page1 = new WizardPane() { + ValidationSupport vs = new ValidationSupport(); + { + vs.initInitialDecoration(); + + int row = 0; + + GridPane page1Grid = new GridPane(); + page1Grid.setVgap(10); + page1Grid.setHgap(10); + + page1Grid.add(new Label("Username:"), 0, row); + TextField txUsername = createTextField("username"); + vs.registerValidator(txUsername, Validator.createEmptyValidator("EMPTY!")); + page1Grid.add(txUsername, 1, row++); + + page1Grid.add(new Label("Full Name:"), 0, row); + TextField txFullName = createTextField("fullName"); + page1Grid.add(txFullName, 1, row); + + setContent(page1Grid); + } + + @Override + public void onEnteringPage(Wizard wizard) { + wizard.invalidProperty().unbind(); + wizard.invalidProperty().bind(vs.invalidProperty()); + } + }; + + // Page 2 + + WizardPane page2 = new WizardPane() { + ValidationSupport vs = new ValidationSupport(); + { + vs.initInitialDecoration(); + + int row = 0; + + GridPane page2Grid = new GridPane(); + page2Grid.setVgap(10); + page2Grid.setHgap(10); + + page2Grid.add(new Label("ControlsFX is:"), 0, row); + ComboBox cbControlsFX = createComboBox("controlsfx"); + cbControlsFX.setItems(FXCollections.observableArrayList("Cool", "Great")); + vs.registerValidator(cbControlsFX, Validator.createEmptyValidator("EMPTY!")); + page2Grid.add(cbControlsFX, 1, row++); + + page2Grid.add(new Label("Where have you heard of it?:"), 0, row); + TextField txWhere = createTextField("where"); + vs.registerValidator(txWhere, Validator.createEmptyValidator("EMPTY!")); + page2Grid.add(txWhere, 1, row++); + + page2Grid.add(new Label("Free text:"), 0, row); + TextField txFreeText = createTextField("freetext"); + page2Grid.add(txFreeText, 1, row); + + setContent(page2Grid); + } + + @Override + public void onEnteringPage(Wizard wizard) { + wizard.invalidProperty().unbind(); + wizard.invalidProperty().bind(vs.invalidProperty()); + } + }; + + // create wizard + wizard.setFlow(new LinearFlow(page1, page2)); + + // show wizard and wait for response + wizard.showAndWait().ifPresent(result -> { + if (result == ButtonType.FINISH) { + System.out.println("Wizard finished, settings: " + wizard.getSettings()); + } + }); + } + + private TextField createTextField(String id) { + TextField textField = new TextField(); + textField.setId(id); + GridPane.setHgrow(textField, Priority.ALWAYS); + return textField; + } + + private ComboBox createComboBox(String id) { + ComboBox comboBox = new ComboBox<>(); + comboBox.setId(id); + GridPane.setHgrow(comboBox, Priority.ALWAYS); + return comboBox; + } + +} \ No newline at end of file diff --git a/NovaPoshta/Docs/CFX Examples/HelloGlyphFont.java b/NovaPoshta/Docs/CFX Examples/HelloGlyphFont.java new file mode 100644 index 0000000..cc39bc8 --- /dev/null +++ b/NovaPoshta/Docs/CFX Examples/HelloGlyphFont.java @@ -0,0 +1,170 @@ +/** + * Copyright (c) 2013, 2014 ControlsFX + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of ControlsFX, any associated website, nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL CONTROLSFX BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package org.controlsfx.samples; + +import javafx.collections.FXCollections; +import javafx.geometry.Insets; +import javafx.scene.Node; +import javafx.scene.control.Button; +import javafx.scene.control.ContentDisplay; +import javafx.scene.control.Label; +import javafx.scene.control.ScrollPane; +import javafx.scene.control.Tab; +import javafx.scene.control.TabPane; +import javafx.scene.control.ToolBar; +import javafx.scene.layout.GridPane; +import javafx.scene.layout.Priority; +import javafx.scene.layout.VBox; +import javafx.scene.paint.Color; +import javafx.stage.Stage; + +import org.controlsfx.ControlsFXSample; +import org.controlsfx.control.GridCell; +import org.controlsfx.control.GridView; +import org.controlsfx.glyphfont.FontAwesome; +import org.controlsfx.glyphfont.Glyph; +import org.controlsfx.glyphfont.GlyphFont; +import org.controlsfx.glyphfont.GlyphFontRegistry; + +public class HelloGlyphFont extends ControlsFXSample { + + static { + // Register a custom default font + GlyphFontRegistry.register("icomoon", HelloGlyphFont.class.getResourceAsStream("icomoon.ttf") , 16); + } + + + private GlyphFont fontAwesome = GlyphFontRegistry.font("FontAwesome"); + private GlyphFont icoMoon = GlyphFontRegistry.font("icomoon"); + + // private static char FAW_TRASH = '\uf014'; + private static char FAW_GEAR = '\uf013'; +// private static char FAW_STAR = '\uf005'; + + private static char IM_BOLD = '\ue027'; + private static char IM_UNDERSCORED = '\ue02b'; + private static char IM_ITALIC = '\ue13e'; + + + + @Override + public String getSampleName() { + return "Glyph Font"; + } + + @Override + public String getJavaDocURL() { + return Utils.JAVADOC_BASE + "org/controlsfx/glyphfont/GlyphFont.html"; + } + + @Override + public Node getPanel(final Stage stage) { + + VBox root = new VBox(10); + + root.setPadding(new Insets(10, 10, 10, 10)); + root.setMaxHeight(Double.MAX_VALUE); + Label title = new Label("Using FontAwesome(CDN)"); + root.getChildren().add(title); + ToolBar toolbar = new ToolBar( + + // There are many ways how you can define a Glyph: + + new Button("", new Glyph("FontAwesome", "TRASH_ALT")), // Use the Glyph-class with a icon name + new Button("", new Glyph("FontAwesome", FontAwesome.Glyph.STAR)), // Use the Glyph-class with a known enum value + new Button("", Glyph.create("FontAwesome|BUG")), // Use the static Glyph-class create protocol + new Button("", fontAwesome.create("REBEL")), // Use the font-instance with a name + new Button("", fontAwesome.create(FontAwesome.Glyph.SMILE_ALT)), // Use the font-instance with a enum + new Button("", fontAwesome.create(FAW_GEAR).color(Color.RED)) // Use the font-instance with a unicode char + ); + root.getChildren().add(toolbar); + title = new Label("Using IcoMoon (Local)"); + root.getChildren().add(title); + + Glyph effectGlyph = icoMoon.create(IM_UNDERSCORED) + .color(Color.BLUE) + .size(48) + .useHoverEffect(); + + Glyph effectGlyph2 = icoMoon.create(IM_UNDERSCORED) + .color(Color.BLUE) + .size(48) + .useGradientEffect().useHoverEffect(); + + toolbar = new ToolBar( + + // Since we have a custom font without named characters, + // we have to use unicode character codes for the icons: + + new Button("", icoMoon.create(IM_BOLD).size(16)), + new Button("", icoMoon.create(IM_UNDERSCORED).color(Color.GREEN).size(32)), + new Button("", icoMoon.create(IM_ITALIC).size(48)), + new Button("", effectGlyph), + new Button("", effectGlyph2)); + root.getChildren().add(toolbar); + + GridPane fontDemo = new GridPane(); + fontDemo.setHgap(5); + fontDemo.setVgap(5); + int maxColumns = 10; + int col = 0; + int row = 0; + + for ( FontAwesome.Glyph glyph: FontAwesome.Glyph.values() ){ + Color randomColor = new Color( Math.random(), Math.random(), Math.random(), 1); + Glyph graphic = Glyph.create( "FontAwesome|" + glyph.name()).sizeFactor(2).color(randomColor).useGradientEffect(); + Button button = new Button(glyph.name(), graphic); + button.setContentDisplay(ContentDisplay.TOP); + button.setMaxWidth(Double.MAX_VALUE); + col = col % maxColumns + 1; + if ( col == 1 ) row++; + fontDemo.add( button, col, row); + GridPane.setFillHeight(button, true); + GridPane.setFillWidth(button, true); + } + + ScrollPane scroller = new ScrollPane(fontDemo); + scroller.setFitToWidth(true); + + TabPane tabs = new TabPane(); + Tab tab = new Tab("FontAwesome Glyph Demo"); + tab.setContent(scroller); + tabs.getTabs().add(tab); + + + root.getChildren().add(tabs); + VBox.setVgrow(tabs, Priority.ALWAYS); + + return root; + + } + + + public static void main(String[] args) { + launch(args); + } +} \ No newline at end of file diff --git a/NovaPoshta/Docs/CFX Examples/HelloHiddenSidesPane.java b/NovaPoshta/Docs/CFX Examples/HelloHiddenSidesPane.java new file mode 100644 index 0000000..a2c28ae --- /dev/null +++ b/NovaPoshta/Docs/CFX Examples/HelloHiddenSidesPane.java @@ -0,0 +1,124 @@ +/** + * Copyright (c) 2014, ControlsFX + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of ControlsFX, any associated website, nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL CONTROLSFX BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package org.controlsfx.samples; + +import javafx.event.EventHandler; +import javafx.geometry.Pos; +import javafx.geometry.Side; +import javafx.scene.Node; +import javafx.scene.control.Label; +import javafx.scene.input.MouseEvent; +import javafx.scene.layout.StackPane; +import javafx.stage.Stage; + +import org.controlsfx.ControlsFXSample; +import org.controlsfx.control.HiddenSidesPane; + +public class HelloHiddenSidesPane extends ControlsFXSample { + + @Override + public String getSampleName() { + return "Hidden Sides Pane"; + } + + @Override + public String getJavaDocURL() { + return Utils.JAVADOC_BASE + + "org/controlsfx/control/HiddenSidesPane.html"; + } + + @Override + public String getSampleDescription() { + return "Hidden nodes will appear when moving the mouse cursor close to the edge of the content node. " + + "They disappear again when the mouse cursor exits them. In this example a hidden node " + + "can be pinned (and unpinned) by clicking on it so that it stays visible all the time."; + } + + @Override + public Node getPanel(Stage stage) { + StackPane stackPane = new StackPane(); + stackPane.setStyle("-fx-padding: 30"); + + HiddenSidesPane pane = new HiddenSidesPane(); + + Label content = new Label("Content Node"); + content.setStyle("-fx-background-color: white; -fx-border-color: black;"); + content.setAlignment(Pos.CENTER); + content.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE); + + pane.setContent(content); + + SideNode top = new SideNode("Top", Side.TOP, pane); + top.setStyle("-fx-background-color: rgba(0,255,0,.25);"); + pane.setTop(top); + + SideNode right = new SideNode("Right", Side.RIGHT, pane); + right.setStyle("-fx-background-color: rgba(0,0, 255,.25);"); + pane.setRight(right); + + SideNode bottom = new SideNode("Bottom", Side.BOTTOM, pane); + bottom.setStyle("-fx-background-color: rgba(255,255,0,.25);"); + pane.setBottom(bottom); + + SideNode left = new SideNode("Left", Side.LEFT, pane); + left.setStyle("-fx-background-color: rgba(255,0,0,.25);"); + pane.setLeft(left); + + stackPane.getChildren().add(pane); + + return stackPane; + } + + class SideNode extends Label { + + public SideNode(final String text, final Side side, + final HiddenSidesPane pane) { + + super(text + " (Click to pin / unpin)"); + + setAlignment(Pos.CENTER); + setPrefSize(200, 200); + + setOnMouseClicked(new EventHandler() { + @Override + public void handle(MouseEvent event) { + if (pane.getPinnedSide() != null) { + setText(text + " (unpinned)"); + pane.setPinnedSide(null); + } else { + setText(text + " (pinned)"); + pane.setPinnedSide(side); + } + } + }); + } + } + + public static void main(String[] args) { + launch(args); + } +} \ No newline at end of file diff --git a/NovaPoshta/Docs/CFX Examples/HelloListActionView.java b/NovaPoshta/Docs/CFX Examples/HelloListActionView.java new file mode 100644 index 0000000..4a7cf98 --- /dev/null +++ b/NovaPoshta/Docs/CFX Examples/HelloListActionView.java @@ -0,0 +1,196 @@ +/** + * Copyright (c) 2018 ControlsFX + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of ControlsFX, any associated website, nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL CONTROLSFX BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package org.controlsfx.samples; + +import javafx.collections.FXCollections; +import javafx.collections.ObservableList; +import javafx.geometry.Insets; +import javafx.geometry.Pos; +import javafx.geometry.Side; +import javafx.scene.Node; +import javafx.scene.control.*; +import javafx.scene.layout.GridPane; +import javafx.scene.layout.VBox; +import javafx.scene.text.Font; +import javafx.scene.text.FontPosture; +import javafx.scene.text.FontWeight; +import javafx.stage.Stage; +import org.controlsfx.ControlsFXSample; +import org.controlsfx.control.ListActionView; +import org.controlsfx.control.action.Action; +import org.controlsfx.control.action.ActionUtils; +import org.controlsfx.glyphfont.FontAwesome; + +import java.util.List; + +public class HelloListActionView extends ControlsFXSample { + + private ListActionView view; + + @Override + public String getSampleName() { + return "List Action View"; + } + + @Override + public Node getPanel(Stage stage) { + view = new ListActionView<>(); + view.getItems().addAll("Dirk", "Jonathan", "Eugene","Abhinay", "Samir"); + view.getActions().addAll(createActions()); + + GridPane pane = new GridPane(); + pane.add(view, 0, 0); + pane.setAlignment(Pos.CENTER); + + return pane; + } + + @Override + public Node getControlPanel() { + VBox root = new VBox(20); + root.setPadding(new Insets(30, 30, 30, 30)); + + CheckBox useCellFactory = new CheckBox("Use cell factory"); + useCellFactory.setOnAction(evt -> { + if (useCellFactory.isSelected()) { + view.setCellFactory(listView -> { + ListCell cell = new ListCell() { + @Override + public void updateItem(String item, boolean empty) { + super.updateItem(item, empty); + + if (empty) { + setText(null); + setGraphic(null); + } else { + setText(item == null ? "null" : item); + setGraphic(null); + } + } + }; + cell.setFont(Font.font("Arial", FontWeight.BOLD, + FontPosture.ITALIC, 18)); + return cell; + }); + } else { + view.setCellFactory(null); + } + }); + + CheckBox clearActions = new CheckBox("Clear Actions"); + clearActions.selectedProperty().addListener((observable, oldValue, newValue) -> { + if (newValue) { + view.getActions().clear(); + } else { + view.getActions().addAll(createActions()); + } + }); + + ComboBox sideComboBox = new ComboBox<>(FXCollections.observableArrayList(Side.values())); + sideComboBox.setTooltip(new Tooltip("The side of the ListView on which the actions should be displayed")); + + sideComboBox.getSelectionModel().select(Side.LEFT); + view.sideProperty().bind(sideComboBox.getSelectionModel().selectedItemProperty()); + + root.getChildren().addAll(useCellFactory, clearActions, sideComboBox); + + return root; + } + + @Override + public String getSampleDescription() { + return "A control used to let the user select multiple values from a " + + "list of available values. Selected values are moved into a " + + "second list that is showing the current selection. Items can " + + "be moved by double clicking on them or by first selecting " + + "them and then pressing one of the buttons in the center."; + } + + @Override + public String getJavaDocURL() { + return Utils.JAVADOC_BASE + + "org/controlsfx/control/ListActionView.html"; + } + + public static void main(String[] args) { + launch(args); + } + + private ObservableList createActions() { + ListActionView.ListAction moveUp = new ListActionView.ListAction( + new FontAwesome().create(FontAwesome.Glyph.ANGLE_UP)) { + @Override + public void initialize(ListView listView) { + setEventHandler(e -> moveSelectedItemsUp(listView)); + } + }; + ListActionView.ListAction moveDown = new ListActionView.ListAction(new FontAwesome().create(FontAwesome.Glyph.ANGLE_DOWN)) { + @Override + public void initialize(ListView listView) { + setEventHandler(e -> moveSelectedItemsDown(listView)); + } + }; + return FXCollections.observableArrayList(moveUp, ActionUtils.ACTION_SEPARATOR, moveDown); + } + + private void moveSelectedItemsUp(ListView listView) { + final MultipleSelectionModel selectionModel = listView.getSelectionModel(); + final ObservableList selectedIndices = selectionModel.getSelectedIndices(); + final ObservableList items = listView.getItems(); + for (final Integer selectedIndex : selectedIndices) { + if (selectedIndex > 0) { + if (selectedIndices.contains(selectedIndex - 1)) continue; + final String item = items.get(selectedIndex); + final String itemToBeReplaced = items.get(selectedIndex - 1); + items.set(selectedIndex - 1, item); + items.set(selectedIndex, itemToBeReplaced); + selectionModel.clearSelection(selectedIndex); + selectionModel.select(selectedIndex - 1); + } + } + } + + private void moveSelectedItemsDown(ListView listView) { + final ObservableList items = listView.getItems(); + final MultipleSelectionModel selectionModel = listView.getSelectionModel(); + final List selectedIndices = selectionModel.getSelectedIndices(); + int lastIndex = items.size() - 1; + // Last selected item is to be replaced first + for (int index = selectedIndices.size() - 1; index >= 0; index--) { + final Integer selectedIndex = selectedIndices.get(index); + if (selectedIndex < lastIndex) { + if (selectedIndices.contains(selectedIndex + 1)) continue; + final String item = items.get(selectedIndex); + final String itemToBeReplaced = items.get(selectedIndex + 1); + items.set(selectedIndex + 1, item); + items.set(selectedIndex, itemToBeReplaced); + selectionModel.clearSelection(selectedIndex); + selectionModel.select(selectedIndex + 1); + } + } + } +} \ No newline at end of file diff --git a/NovaPoshta/Docs/CFX Examples/HelloMasterDetailPane.java b/NovaPoshta/Docs/CFX Examples/HelloMasterDetailPane.java new file mode 100644 index 0000000..4a222fa --- /dev/null +++ b/NovaPoshta/Docs/CFX Examples/HelloMasterDetailPane.java @@ -0,0 +1,156 @@ +/** + * Copyright (c) 2014 - 2016 ControlsFX + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of ControlsFX, any associated website, nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL CONTROLSFX BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package org.controlsfx.samples; + +import javafx.application.Application; +import javafx.geometry.Insets; +import javafx.geometry.Pos; +import javafx.geometry.Side; +import javafx.scene.Node; +import javafx.scene.control.*; +import javafx.scene.layout.GridPane; +import javafx.stage.Stage; +import org.controlsfx.ControlsFXSample; +import org.controlsfx.control.MasterDetailPane; + +public class HelloMasterDetailPane extends ControlsFXSample { + + @Override + public String getJavaDocURL() { + return Utils.JAVADOC_BASE + + "org/controlsfx/control/MasterDetailPane.html"; + } + + + @Override + public String getControlStylesheetURL() { + return "/org/controlsfx/control/masterdetailpane.css"; + } + + private MasterDetailPane masterDetailPane; + + @Override + public Node getPanel(Stage stage) { + masterDetailPane = new MasterDetailPane(Side.BOTTOM); + masterDetailPane.setShowDetailNode(true); + + return masterDetailPane; + } + + @Override + public Node getControlPanel() { + GridPane grid = new GridPane(); + grid.setVgap(10); + grid.setHgap(10); + grid.setPadding(new Insets(30, 30, 0, 30)); + + int row = 0; + + // show details + Label lblShowDetail = new Label("Show details: "); + lblShowDetail.getStyleClass().add("property"); + grid.add(lblShowDetail, 0, row); + CheckBox chkShowDetails = new CheckBox(); + grid.add(chkShowDetails, 1, row++); + chkShowDetails.selectedProperty().bindBidirectional(masterDetailPane.showDetailNodeProperty()); + + + // animated + Label lblAnimated = new Label("Animated: "); + lblAnimated.getStyleClass().add("property"); + grid.add(lblAnimated, 0, row); + CheckBox chkAnimated = new CheckBox(); + grid.add(chkAnimated, 1, row++); + chkAnimated.selectedProperty().bindBidirectional(masterDetailPane.animatedProperty()); + + + // side + Label lblSide = new Label("Side: "); + lblSide.getStyleClass().add("property"); + grid.add(lblSide, 0, row); + ComboBox positionBox = new ComboBox<>(); + positionBox.getItems().addAll(Side.values()); + grid.add(positionBox, 1, row++); + positionBox.setValue(masterDetailPane.getDetailSide()); + masterDetailPane.detailSideProperty().bind(positionBox.valueProperty()); + + // detail node + Label lblDetailNode = new Label("Detail Node: "); + lblDetailNode.getStyleClass().add("property"); + grid.add(lblDetailNode, 0, row); + ComboBox detailNodeBox = new ComboBox<>(); + detailNodeBox.getItems().addAll(DetailType.values()); + grid.add(detailNodeBox, 1, row++); + detailNodeBox.valueProperty().addListener(it -> { + switch (detailNodeBox.getValue()) { + case LABEL: + final Label label = new Label("Detail"); + label.setMaxWidth(Double.MAX_VALUE); + label.setAlignment(Pos.CENTER); + label.setStyle("-fx-background-color: lightcoral;"); + masterDetailPane.setDetailNode(label); + break; + case NONE: + masterDetailPane.setDetailNode(null); + break; + case LIST_VIEW: + final ListView listView = new ListView<>(); + listView.getItems().addAll("Katja", "Dirk", "Philip", "Jule", "Armin"); + listView.setPrefSize(150,150); + masterDetailPane.setDetailNode(listView); + break; + } + }); + + // reset position + Button resetButton = new Button("Reset Divider"); + resetButton.setOnAction(evt -> masterDetailPane.resetDividerPosition()); + grid.add(resetButton, 1, row++); + + return grid; + } + + public enum DetailType { + NONE, + LABEL, + LIST_VIEW + } + + @Override + public String getSampleDescription() { + return "A control used to display a master node and a detail node. The detail can be shown / hidden at the top, the bottom, to the left or to the right."; + } + + public static void main(String[] args) { + Application.launch(args); + } + + @Override + public String getSampleName() { + return "Master Detail Pane"; + } +} \ No newline at end of file diff --git a/NovaPoshta/Docs/CFX Examples/HelloPropertySheet.java b/NovaPoshta/Docs/CFX Examples/HelloPropertySheet.java new file mode 100644 index 0000000..6b0e0db --- /dev/null +++ b/NovaPoshta/Docs/CFX Examples/HelloPropertySheet.java @@ -0,0 +1,258 @@ +/** + * Copyright (c) 2014, 2015 ControlsFX + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of ControlsFX, any associated website, nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL CONTROLSFX BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package org.controlsfx.samples; + +import java.time.LocalDate; +import java.time.Month; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Optional; +import javafx.beans.value.ObservableValue; + +import javafx.collections.FXCollections; +import javafx.collections.ObservableList; +import javafx.concurrent.Service; +import javafx.concurrent.Task; +import javafx.concurrent.WorkerStateEvent; +import javafx.event.ActionEvent; +import javafx.event.EventHandler; +import javafx.scene.Node; +import javafx.scene.control.Button; +import javafx.scene.control.CheckBox; +import javafx.scene.control.TextField; +import javafx.scene.layout.VBox; +import javafx.stage.Stage; + +import org.controlsfx.ControlsFXSample; +import org.controlsfx.control.PropertySheet; +import org.controlsfx.control.PropertySheet.Item; +import org.controlsfx.control.PropertySheet.Mode; +import org.controlsfx.control.SegmentedButton; +import org.controlsfx.control.action.Action; +import org.controlsfx.control.action.ActionUtils; +import org.controlsfx.property.BeanProperty; +import org.controlsfx.property.BeanPropertyUtils; +import org.controlsfx.samples.propertysheet.CustomPropertyDescriptor; +import org.controlsfx.samples.propertysheet.SampleBean; + +public class HelloPropertySheet extends ControlsFXSample { + + private static Map customDataMap = new LinkedHashMap<>(); + + static { + customDataMap.put("1. Name#First Name", "Jonathan"); + customDataMap.put("1. Name#Last Name", "Giles"); + customDataMap.put("1. Name#Birthday", LocalDate.of(1985, Month.JANUARY, 12)); + customDataMap.put("2. Billing Address#Address 1", ""); + customDataMap.put("2. Billing Address#Address 2", ""); + customDataMap.put("2. Billing Address#City", ""); + customDataMap.put("2. Billing Address#State", ""); + customDataMap.put("2. Billing Address#Zip", ""); + customDataMap.put("3. Phone#Home", "123-123-1234"); + customDataMap.put("3. Phone#Mobile", "234-234-2345"); + customDataMap.put("3. Phone#Work", ""); + } + + private PropertySheet propertySheet = new PropertySheet(); + + public static void main(String[] args) { + launch(); + } + + @Override + public String getSampleName() { + return "Property Sheet"; + } + + @Override + public String getSampleDescription() { + return "The PropertySheet control is useful when you want to present a number" + + " of properties to a user for them to edit."; + } + + @Override + public String getJavaDocURL() { + return Utils.JAVADOC_BASE + "org/controlsfx/control/PropertySheet.html"; + } + + + @Override + public String getControlStylesheetURL() { + return "/org/controlsfx/control/propertysheet.css"; + } + + class CustomPropertyItem implements Item { + + private String key; + private String category, name; + + public CustomPropertyItem(String key) { + this.key = key; + String[] skey = key.split("#"); + category = skey[0]; + name = skey[1]; + } + + @Override + public Class getType() { + return customDataMap.get(key).getClass(); + } + + @Override + public String getCategory() { + return category; + } + + @Override + public String getName() { + return name; + } + + @Override + public String getDescription() { + return null; + } + + @Override + public Object getValue() { + return customDataMap.get(key); + } + + @Override + public void setValue(Object value) { + customDataMap.put(key, value); + } + + @Override + public Optional> getObservableValue() { + return Optional.empty(); + } + + } + + class ActionShowInPropertySheet extends Action { + + private Object bean; + + public ActionShowInPropertySheet(String title, Object bean) { + super(title); + setEventHandler(this::handleAction); + this.bean = bean; + } + + private ObservableList getCustomModelProperties() { + ObservableList list = FXCollections.observableArrayList(); + for (String key : customDataMap.keySet()) { + list.add(new CustomPropertyItem(key)); + } + return list; + } + + private void handleAction(ActionEvent ae) { + + // retrieving bean properties may take some time + // so we have to put it on separate thread to keep UI responsive + Service service = new Service>() { + + @Override + protected Task> createTask() { + return new Task>() { + @Override + protected ObservableList call() throws Exception { + return bean == null ? getCustomModelProperties() : BeanPropertyUtils.getProperties(bean); + } + }; + } + + }; + service.setOnSucceeded(new EventHandler() { + + @SuppressWarnings("unchecked") + @Override + public void handle(WorkerStateEvent e) { + if (bean instanceof SampleBean) { + for (Item i : (ObservableList) e.getSource().getValue()) { + if (i instanceof BeanProperty && ((BeanProperty) i).getPropertyDescriptor() instanceof CustomPropertyDescriptor) { + BeanProperty bi = (BeanProperty) i; + bi.setEditable(((CustomPropertyDescriptor) bi.getPropertyDescriptor()).isEditable()); + } + } + } + propertySheet.getItems().setAll((ObservableList) e.getSource().getValue()); + } + }); + service.start(); + } + } + + @Override + public Node getPanel(Stage stage) { + return propertySheet; + } + + @Override + public Node getControlPanel() { + VBox infoPane = new VBox(10); + + Button button = new Button("Title"); + TextField textField = new TextField(); + SampleBean sampleBean = new SampleBean(); + + SegmentedButton segmentedButton = ActionUtils.createSegmentedButton( + new ActionShowInPropertySheet("Bean: Button", button), + new ActionShowInPropertySheet("Bean: TextField", textField), + new ActionShowInPropertySheet("Custom Model", null), + new ActionShowInPropertySheet("Custom BeanInfo", sampleBean) + ); + segmentedButton.getStyleClass().add(SegmentedButton.STYLE_CLASS_DARK); + segmentedButton.getButtons().get(0).fire(); + + CheckBox toolbarModeVisible = new CheckBox("Show Mode Buttons"); + toolbarModeVisible.selectedProperty().bindBidirectional(propertySheet.modeSwitcherVisibleProperty()); + + CheckBox toolbarSearchVisible = new CheckBox("Show Search Field"); + toolbarSearchVisible.selectedProperty().bindBidirectional(propertySheet.searchBoxVisibleProperty()); + + infoPane.getChildren().add(toolbarModeVisible); + infoPane.getChildren().add(toolbarSearchVisible); + infoPane.getChildren().add(segmentedButton); + infoPane.getChildren().add(button); + infoPane.getChildren().add(textField); + + return infoPane; + } + + class ActionModeChange extends Action { + + public ActionModeChange(String title, Mode mode) { + super(title); + setEventHandler(ae -> propertySheet.modeProperty().set(mode)); + } + + } + +} \ No newline at end of file diff --git a/NovaPoshta/Docs/CFX Examples/HelloValidation.java b/NovaPoshta/Docs/CFX Examples/HelloValidation.java new file mode 100644 index 0000000..4294987 --- /dev/null +++ b/NovaPoshta/Docs/CFX Examples/HelloValidation.java @@ -0,0 +1,234 @@ +/** + * Copyright (c) 2014, 2019 ControlsFX + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of ControlsFX, any associated website, nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL CONTROLSFX BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package org.controlsfx.samples; + +import java.time.LocalDate; +import java.util.Arrays; + +import javafx.beans.InvalidationListener; +import javafx.beans.Observable; +import javafx.geometry.Insets; +import javafx.scene.Node; +import javafx.scene.control.CheckBox; +import javafx.scene.control.ChoiceBox; +import javafx.scene.control.ColorPicker; +import javafx.scene.control.ComboBox; +import javafx.scene.control.Control; +import javafx.scene.control.DatePicker; +import javafx.scene.control.Label; +import javafx.scene.control.ListCell; +import javafx.scene.control.ListView; +import javafx.scene.control.ScrollPane; +import javafx.scene.control.Slider; +import javafx.scene.control.TextField; +import javafx.scene.control.ToggleButton; +import javafx.scene.layout.GridPane; +import javafx.scene.layout.Priority; +import javafx.scene.paint.Color; +import javafx.stage.Stage; +import javafx.util.Callback; + +import org.controlsfx.ControlsFXSample; +import org.controlsfx.validation.ValidationResult; +import org.controlsfx.validation.ValidationSupport; +import org.controlsfx.validation.Validator; +import org.controlsfx.validation.decoration.CompoundValidationDecoration; +import org.controlsfx.validation.decoration.GraphicValidationDecoration; +import org.controlsfx.validation.decoration.StyleClassValidationDecoration; +import org.controlsfx.validation.decoration.ValidationDecoration; + +public class HelloValidation extends ControlsFXSample { + + private TextField textField = new TextField(); + private ValidationSupport validationSupport = new ValidationSupport(); + + @Override public String getSampleName() { + return "Component Validation"; + } + + @Override public String getJavaDocURL() { + return Utils.JAVADOC_BASE + "org/controlsfx/validation/ValidationSupport.html"; + } + + @Override public String getSampleDescription() { + return "Component Validation"; + } + + @Override public Node getPanel(final Stage stage) { + GridPane root = new GridPane(); + root.setVgap(10); + root.setHgap(10); + root.setPadding(new Insets(30, 30, 0, 30)); + + root.sceneProperty().addListener(new InvalidationListener() { + @Override public void invalidated(Observable o) { + if (root.getScene() != null) { + root.getScene().getStylesheets().add(HelloDecorator.class.getResource("validation.css").toExternalForm()); + } + } + }); + + int row = 0; + + // text field + validationSupport.registerValidator(textField, Validator.createEmptyValidator("Text is required")); + + root.add(new Label("TextField"), 0, row); + root.add(textField, 1, row); + GridPane.setHgrow(textField, Priority.ALWAYS); + + //combobox + row++; + ComboBox combobox = new ComboBox(); + combobox.getItems().addAll("Item A", "Item B", "Item C"); + validationSupport.registerValidator(combobox, (Control c, String newValue) -> + ValidationResult.fromErrorIf(combobox, "ComboBox Selection required", newValue == null || newValue.isEmpty()) + .addInfoIf(combobox, "Item A is the first item", "Item A".equals(newValue)) + .addInfoIf(combobox, "Item B is the second item", "Item B".equals(newValue)) + .addInfoIf(combobox, "Item C is the third item", "Item C".equals(newValue)) + ); + + root.add(new Label("ComboBox"), 0, row); + root.add(combobox, 1, row); + GridPane.setHgrow(combobox, Priority.ALWAYS); + + //choicebox + row++; + ChoiceBox choiceBox = new ChoiceBox(); + choiceBox.getItems().addAll("Item A", "Item B", "Item C"); + validationSupport.registerValidator(choiceBox, Validator.createEmptyValidator("ChoiceBox Selection required")); + + root.add(new Label("ChoiceBox"), 0, row); + root.add(choiceBox, 1, row); + GridPane.setHgrow(choiceBox, Priority.ALWAYS); + + //checkbox + row++; + CheckBox checkBox = new CheckBox(); + validationSupport.registerValidator(checkBox, (Control c, Boolean newValue) -> + ValidationResult.fromErrorIf(c, "Checkbox should be checked", !newValue)); + + root.add(new Label("CheckBox"), 0, row); + root.add(checkBox, 1, row); + GridPane.setHgrow(checkBox, Priority.ALWAYS); + + //slider + row++; + Slider slider = new Slider(-50d, 50d, -10d); + slider.setShowTickLabels(true); + validationSupport.registerValidator(slider, (Control c, Double newValue) -> + ValidationResult.fromErrorIf(slider, "Slider value should be > 0", newValue <= 0)); + + root.add(new Label("Slider"), 0, row); + root.add(slider, 1, row); + GridPane.setHgrow(slider, Priority.ALWAYS); + + // color picker + row++; + ColorPicker colorPicker = new ColorPicker(Color.RED); + validationSupport.registerValidator(colorPicker, + Validator.createEqualsValidator("Color should be WHITE or BLACK", Arrays.asList(Color.WHITE, Color.BLACK))); + + root.add(new Label("Color Picker"), 0, row); + root.add(colorPicker, 1, row); + GridPane.setHgrow(colorPicker, Priority.ALWAYS); + + // date picker + row++; + DatePicker datePicker = new DatePicker(); + validationSupport.registerValidator(datePicker, false, (Control c, LocalDate newValue) -> + ValidationResult.fromWarningIf(datePicker, "The date should be today", !LocalDate.now().equals(newValue))); + + root.add(new Label("Date Picker"), 0, row); + root.add(datePicker, 1, row); + GridPane.setHgrow(datePicker, Priority.ALWAYS); + + ScrollPane scrollPane = new ScrollPane(root); + return scrollPane; + } + + @Override public Node getControlPanel() { + GridPane grid = new GridPane(); + grid.setVgap(10); + grid.setHgap(10); + grid.setPadding(new Insets(30, 30, 0, 30)); + + ValidationDecoration iconDecorator = new GraphicValidationDecoration(); + ValidationDecoration cssDecorator = new StyleClassValidationDecoration(); + ValidationDecoration compoundDecorator = new CompoundValidationDecoration(cssDecorator, iconDecorator); + + int row = 0; + + // --- validation decorator + Callback, ListCell> cellFactory = listView -> new ListCell() { + @Override protected void updateItem(ValidationDecoration decorator, boolean empty) { + super.updateItem(decorator, empty); + + if (empty) { + setText(""); + } else { + if (decorator instanceof StyleClassValidationDecoration) { + setText("Style Class Validation Decorator"); + } else if (decorator instanceof GraphicValidationDecoration) { + setText("Graphic Validation Decorator"); + } else if (decorator instanceof CompoundValidationDecoration) { + setText("Compound Validation Decorator"); + } else { + setText("Unknown decorator type!"); + } + } + } + }; + ComboBox decoratorBox = new ComboBox<>(); + decoratorBox.getItems().addAll(iconDecorator, cssDecorator, compoundDecorator); + decoratorBox.setCellFactory(cellFactory); + decoratorBox.setButtonCell(cellFactory.call(null)); + decoratorBox.getSelectionModel().selectedItemProperty().addListener((o,old,decorator) -> + validationSupport.setValidationDecorator(decorator)); + decoratorBox.getSelectionModel().select(0); + + Label validationDecoratorLabel = new Label("Validation Decorator: "); + validationDecoratorLabel.getStyleClass().add("property"); + grid.add(validationDecoratorLabel, 0, row); + grid.add(decoratorBox, 1, row); + GridPane.setHgrow(decoratorBox, Priority.ALWAYS); + + row++; + ToggleButton btnToggleRequired = new ToggleButton("Toggle TextField required status"); + btnToggleRequired.setSelected(ValidationSupport.isRequired(textField)); + btnToggleRequired.setOnAction(e -> { + ValidationSupport.setRequired(textField, btnToggleRequired.isSelected()); + }); + grid.add(btnToggleRequired, 1, row, 1, 1); + + return grid; + } + + public static void main(String[] args) { + launch(args); + } +} \ No newline at end of file diff --git a/NovaPoshta/Docs/EditPhones.fxml b/NovaPoshta/Docs/EditPhones.fxml new file mode 100644 index 0000000..effebc7 --- /dev/null +++ b/NovaPoshta/Docs/EditPhones.fxml @@ -0,0 +1,15 @@ + + + + + + + +