linkki
linkki is a data binding framework that makes building UI in vaadin applications easier and faster.
Features
Applications often consist of a variety of input elements that closely mirror objects and properties of a domain model. Creating such user interfaces and implementing the synchronization with the domain model is often a repetitive task. linkki automates most of the data binding tasks, enabling developers to focus on the domain and UI logic.
-
Fast UI development
-
Declarative UI definition (with annotations)
-
UI logic implementation using the presentation model pattern (PMO)
-
Automatic data binding between (P)MO and UI elements
-
Dynamic binding of other UI properties, including
-
Visibility
-
Enabled-state
-
List of available values
-
Examples
Model Binding
@ModelObject
public Report getReport() {
return report;
}
Textfield/Textarea
@UITextArea(position = 10, label = "Description", modelAttribute = "description", required = RequiredType.REQUIRED, rows = 5, width = "50em")
public void description() {
/* Use description from report (model object) directly */
}
ComboBox
@UIComboBox(position = 20, label = "Type", modelAttribute = "type", required = RequiredType.REQUIRED)
public void type() {
/*
* - bind value to the property "type" from report - use enum constants from ReportType as
* available values
*/
}
Button
@UIButton(position = 30, caption = "Send", icon = VaadinIcons.SEND, showIcon = true, enabled = EnabledType.DYNAMIC)
public void send() {
report.save();
Notification.show(
String.format("Report with id %d filed!", report.getId()),
"Thank you for reporting!",
Notification.Type.TRAY_NOTIFICATION);
}
/**
* Enable button only if description and type is present.
*
* @return {@code true} if button is enabled otherwise {@code false}
*/
public boolean isSendEnabled() {
String description = report.getDescription();
return description != null && !description.isEmpty()
&& report.getType() != null;
}
}
Note
|
The complete example can be found at Getting Started - 'Error report' tutorial. |
Installation
linkki is available from Maven Central and can be included via Maven/Gradle:
<dependency>
<groupId>org.linkki-framework</groupId>
<artifactId>linkki-core-vaadin8</artifactId>
<version>${linkki.version}</version>
</dependency>
Contribution
-
Bug reports, new ideas and improvements can be created in the GitHub issue tracker
-
Collaboration on issues/tasks via pull requests
Documentation
Documentation for linkki can be found at doc.linkki-framework.org.
License
Copyright Faktor Zehn GmbH.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.