Skip to content

A data binding framework for web based user interfaces with Vaadin

License

Notifications You must be signed in to change notification settings

trutzonline/linkki

 
 

Repository files navigation

linkki

A data binding framework for web based user interfaces with Vaadin.

Features

Commonly applications 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, columns = 50)
    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 = FontAwesome.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;
    }
}
report disabled
Figure 1. Report with disabled send button
report enabled
Figure 2. Report with enabled send button
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:

Maven dependency
<dependency>
  <groupId>org.linkki-framework</groupId>
  <artifactId>linkki-core</artifactId>
  <version>${linkki.version}</version>
</dependency>

To compile linkki, first clone the project from GitHub. The used build tool is Apache Maven.

$> mvn clean install

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 AG.

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.

About

A data binding framework for web based user interfaces with Vaadin

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 99.2%
  • CSS 0.8%