在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):mvysny/vaadin-on-kotlin开源软件地址(OpenSource Url):https://github.com/mvysny/vaadin-on-kotlin开源编程语言(OpenSource Language):Kotlin 95.7%开源软件介绍(OpenSource Introduction):Welcome to Vaadin-On-KotlinVaadin-on-Kotlin is a web-application framework that includes everything needed to create database-backed web applications. Please see the official documentation at www.vaadinonkotlin.eu. Vaadin-on-Kotlin does not enforce you to use Model-View-Controller (MVC), Dependency Injection (DI) nor Service-Oriented Architecture (SOA). It by default does not use Spring nor JavaEE. Instead, Vaadin-on-Kotlin focuses on simplicity. The View layer leverages component-oriented programming as offered by the Vaadin framework. Vaadin offers powerful components which are built on AJAX; programming in Vaadin resembles programming in a traditional client-side framework such as JavaFX or Swing. The database access layer is covered by the vok-orm library.
Everything is combined with the conciseness of the Kotlin programming language, which makes Vaadin-on-Kotlin a perfect starting point for beginner programmers. And Kotlin is statically-typed, so you can always Ctrl+Click on a code and learn how it works under the hood! For a Getting Started guide please see the official documentation at www.vaadinonkotlin.eu/. Getting Started
Example projectA more polished example application which you can inspire from. Just type this into your terminal: git clone https://github.com/mvysny/vaadin-on-kotlin
cd vaadin-on-kotlin
./gradlew vok-example-crud-vokdb:appRun The web app will be running at http://localhost:8080. You can find the VoK-CRUD Live Demo running on Heroku. For more information check out the vok-example-crud-vokdb module. Vaadin 14 Flow Example projectHead to Beverage Buddy VoK for the standalone example project. Run the example application from Intellij IDEA Community
If you have the Intellij IDEA Ultimate version, we recommend you to use Tomcat for development, since it offers better code hot-redeployment:
ContributingWe encourage you to contribute to Vaadin-on-Kotlin! Join us and discuss at Vaadin Forums: Miscellaneous. Trying to report a possible security vulnerability in Vaadin-on-Kotlin? Please use Vaadin Bug Tracker. For general Vaadin-on-Kotlin bugs, please use the Vaadin-on-Kotlin Github Issue Tracker. ModulesVaadin-on-Kotlin consists of several modules which provides you with handy functionality. To include the modules
into your project, you simply add appropriate Gradle jar dependencies to your Every module contains a description of what exactly the module does, when you should use it and when it might be better to use something else. The list of modules:
Code ExamplesEasy database transactions:vok-orm: button("Save", { db { person.save() } }) See vok-orm for an explanation on how this works. Prepare your databaseSimply use Flyway: write Flyway scripts, add a Gradle dependency: compile 'org.flywaydb:flyway-core:7.1.1' and introduce a context listener, to auto-update your database to the newest version before your app starts: @WebListener
class Bootstrap: ServletContextListener {
override fun contextInitialized(sce: ServletContextEvent?) {
VaadinOnKotlin.init()
val flyway = Flyway()
flyway.dataSource = VaadinOnKotlin.getDataSource()
flyway.migrate()
}
} Please scroll below for more details. Defining UI DSL-styleverticalLayout {
formLayout {
isSpacing = true
textField("Name:") {
focus()
}
textField("Age:")
}
horizontalLayout {
w = 100.perc
isSpacing = true
button("Save") {
onLeftClick { okPressed() }
setPrimary()
}
}
} Simple popupspopupView("Details") {
verticalLayout {
formLayout { ... }
button("Close", { isPopupVisible = false })
}
} vok-orm-based grid is a breezeSupport for sorting and filtering out-of-the-box: grid<User>(dataProvider = Person.dataProvider) {
isExpand = true
val filterBar = appendHeaderRow().asFilterBar(this)
columnFor(User::id) {
filterBar.forField(NumberRangePopup(), this).inRange()
}
columnFor(User::username) {
filterBar.forField(TextField(), this).ilike()
}
columnFor(User::roles) {
filterBar.forField(TextField(), this).ilike()
}
columnFor(User::hashedPassword)
addButtonColumn(VaadinIcon.EDIT, "edit", { createOrEditUser(it) }) {}
addButtonColumn(VaadinIcon.TRASH, "delete", { it.delete(); refresh() }) {}
} Advanced syntaxKeyboard shortcuts via operator overloadingimport com.github.mvysny.karibudsl.v8.ModifierKey.Alt
import com.github.mvysny.karibudsl.v8.ModifierKey.Ctrl
import com.vaadin.event.ShortcutAction.KeyCode.C
button("Create New Person (Ctrl+Alt+C)") {
onLeftClick { ... }
clickShortcut = Ctrl + Alt + C
} Width/heightbutton {
icon = ...
w = 48.px
h = 50.perc
}
if (button.w.isFillParent) { ... } Further Links
LicenseLicensed under the MIT License. Copyright (c) 2017-2018 Martin Vysny All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论