Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
svenruppert committed Apr 16, 2019
1 parent c9eccbe commit c61e86d
Show file tree
Hide file tree
Showing 73 changed files with 3,621 additions and 2 deletions.
27 changes: 27 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
_data/webdrivers/*




.DS_Store
.classpath
.project
.settings
.idea
*.iml
*/target/
vaadin-testbench-standalone/dependency-reduced-pom.xml
vaadin-testbench-recorder/selenium-extensions/core/user-extensions.js
vaadin-testbench-recorder/chrome/content/selenium/scripts/selenium-api.js
vaadin-testbench-recorder/chrome/content/selenium/scripts/selenium-browserbot.js
vaadin-testbench-recorder/chrome/testbench-recorder.jar
vaadin-testbench-recorder/extension/
vaadin-testbench-recorder/install.rdf
vaadin-testbench-playground
vaadin-testbench-integration-tests/error-screenshots/
vaadin-testbench-integration-tests/config/testbench.properties
chromedriver.log
phantomjsdriver.log

test/temp/

45 changes: 43 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,43 @@
# fluent-api-for-flow
Fluent API for Vaadin Flow
# Fluent API for Flow

The description is available under [https://vaadin.com/tutorials/flow-java-api-fluent](https://vaadin.com/tutorials/flow-java-api-fluent)

## Available
Vaadin Button
Vaadin Checkbox
Vaadin Ordered Layout - Horizontal / Vertical
Vaadin Text Field - Text / Password
Vaadin Combo Box
Vaadin Context Menu

## Backlog
Vaadin Accordion
Vaadin Date Picker
Vaadin Time Picker
Vaadin Details
Vaadin Dialog
Vaadin Select
Vaadin Form Layout
Vaadin Grid
Vaadin Icons
Vaadin Item
Vaadin List Box
Vaadin Notification
Vaadin Progress Bar
Vaadin Radio Button
Vaadin Split Layout
Vaadin Tabs
Vaadin Upload
Vaadin Custom Field

Vaadin App Layout
Vaadin Login

Vaadin Board
Vaadin Charts
Vaadin Confirm Dialog
Vaadin Cookie Consent
Vaadin Crud
Vaadin Grid Pro
Vaadin Rich Text Editor

6 changes: 6 additions & 0 deletions fluent-api-impl/assembly/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Manifest-Version: 1.0
Vaadin-Package-Version: 1
Vaadin-Addon: ${project.build.finalName}.${project.packaging}
Implementation-Vendor: ${organization.name}
Implementation-Title: Fluent API for Flow
Implementation-Version: ${project.version}
59 changes: 59 additions & 0 deletions fluent-api-impl/assembly/assembly.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright © 2018 Sven Ruppert (sven.ruppert@gmail.com)
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
http://www.apache.org/licenses/LICENSE-2.0
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.
-->
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<id>paper-slider</id>

<formats>
<format>zip</format>
</formats>

<!-- Do not use because we must put META-INF/MANIFEST.MF there. -->
<includeBaseDirectory>false</includeBaseDirectory>

<fileSets>
<fileSet>
<directory>../</directory>
<includes>
<include>LICENSE</include>
<include>README.md</include>
</includes>
</fileSet>
<fileSet>
<directory>target</directory>
<outputDirectory></outputDirectory>
<includes>
<include>*.jar</include>
<include>*.pdf</include>
</includes>
</fileSet>
</fileSets>

<files>
<!-- This is vaadin.com/directory related manifest needed in the
zip package -->
<file>
<source>assembly/MANIFEST.MF</source>
<outputDirectory>META-INF</outputDirectory>
<filtered>true</filtered>
</file>
</files>
</assembly>
78 changes: 78 additions & 0 deletions fluent-api-impl/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright © 2018 Sven Ruppert (sven.ruppert@gmail.com)
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
http://www.apache.org/licenses/LICENSE-2.0
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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>org.rapidpm.vaadin</groupId>
<artifactId>fluent-api-for-flow</artifactId>
<version>00.08.00-RPM</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>fluent-api-for-flow-impl</artifactId>


<properties>
<!--Properties for Vaadin Directory-->
<Vaadin-Package-Version>1</Vaadin-Package-Version>
<Vaadin-Addon>${project.build.finalName}.${project.packaging}</Vaadin-Addon>
</properties>

<build>
<plugins>
<!--For Vaadin Directory deployment-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<index>true</index>
<manifest>
<addClasspath>false</addClasspath>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
<manifestEntries>
<Vaadin-Package-Version>${Vaadin-Package-Version}</Vaadin-Package-Version>
</manifestEntries>
</archive>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
<descriptor>assembly/assembly.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<goals>
<goal>single</goal>
</goals>
<phase>install</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/**
* Copyright © 2018 Sven Ruppert (sven.ruppert@gmail.com)
*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* 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.
*/
package org.rapidpm.vaadin.api.fluent.builder;


import static org.rapidpm.frp.model.Result.ofNullable;

import java.util.function.Supplier;

import org.rapidpm.frp.model.Result;
import com.vaadin.flow.component.Component;

public class ComponentHolder<T extends Component> {

private Result<T> component;

public ComponentHolder(T component) {
this.component = ofNullable(component);
}

public ComponentHolder(Result<T> component) {
this.component = component;
}

public ComponentHolder(Supplier<T> supplier) {
this.component = ofNullable(supplier.get());
}

public Result<T> component() {
return component;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
/**
* Copyright © 2018 Sven Ruppert (sven.ruppert@gmail.com)
*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* 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.
*/
package org.rapidpm.vaadin.api.fluent.builder;

import java.util.function.Supplier;

import org.rapidpm.vaadin.api.fluent.builder.button.ButtonBuilder;
import org.rapidpm.vaadin.api.fluent.builder.checkbox.CheckboxBuilder;
import org.rapidpm.vaadin.api.fluent.builder.layout.horizontal.HorizontalLayoutBuilder;
import org.rapidpm.vaadin.api.fluent.builder.layout.vertical.VerticalLayoutBuilder;
import org.rapidpm.vaadin.api.fluent.builder.textfield.TextFieldBuilder;
import com.vaadin.flow.component.button.Button;
import com.vaadin.flow.component.checkbox.Checkbox;
import com.vaadin.flow.component.orderedlayout.HorizontalLayout;
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
import com.vaadin.flow.component.textfield.TextField;

public interface FluentAPI {

static ButtonBuilder buttonBuilder() {
return buttonBuilder(Button::new);
}

static ButtonBuilder buttonBuilder(Button b) {
return new ButtonBuilder(b);
}

static ButtonBuilder buttonBuilder(Supplier<Button> supplier) {
return new ButtonBuilder(supplier);
}



static TextFieldBuilder textFieldBuilder() {
return textFieldBuilder(TextField::new);
}

static TextFieldBuilder textFieldBuilder(TextField t) {
return new TextFieldBuilder(t);
}

static TextFieldBuilder textFieldBuilder(Supplier<TextField> supplier) {
return new TextFieldBuilder(supplier);
}


static CheckboxBuilder checkBoxBuilder() {
return checkBoxBuilder(Checkbox::new);
}

static CheckboxBuilder checkBoxBuilder(Checkbox t) {
return new CheckboxBuilder(t);
}

static CheckboxBuilder checkBoxBuilder(Supplier<Checkbox> supplier) {
return new CheckboxBuilder(supplier);
}






//layouts
static VerticalLayoutBuilder verticalLayoutBuilder() {
return verticalLayoutBuilder(VerticalLayout::new);
}

static VerticalLayoutBuilder verticalLayoutBuilder(VerticalLayout t) {
return new VerticalLayoutBuilder(t);
}

static VerticalLayoutBuilder verticalLayoutBuilder(Supplier<VerticalLayout> supplier) {
return new VerticalLayoutBuilder(supplier);
}

static HorizontalLayoutBuilder horizontalLayoutBuilder() {
return horizontalLayoutBuilder(HorizontalLayout::new);
}

static HorizontalLayoutBuilder horizontalLayoutBuilder(HorizontalLayout t) {
return new HorizontalLayoutBuilder(t);
}

static HorizontalLayoutBuilder horizontalLayoutBuilder(Supplier<HorizontalLayout> supplier) {
return new HorizontalLayoutBuilder(supplier);
}
}


Loading

0 comments on commit c61e86d

Please sign in to comment.