Skip to content

Commit

Permalink
Merge from master (#5302)
Browse files Browse the repository at this point in the history
* Send service URL to the client side for Web Components UI (#5031)

Fixes #5044
Fixes #5027

* Remove dependency from data to html-components (#5050)

Fixes #5025

* Clarify StreamResource JavaDoc (#4981)

* 1.5-SNAPSHOT (#5055)

* Fix flow-component-renderer for Chrome 72 (#5060)

Fixes #5025, vaadin/vaadin-grid-flow#502

* Make the java doc return say the correct thing. (#5063)

* Shortcuts: change click shortcut's default behavior (#5058) (#5065)

* Deprecated @VaadinServletConfiguration (#5052)

* Update chrome driver version (#5020)

* Update byte buddy version (#5026)

* Update byte buddy version

Fixes #4956

* Fix version id in drivers (#5083)

* Deprecate getBodyAttributes and replace it with getHtmlAttributes (#5019) Fixes #4765

* Add IT test for push in embedded web components (#5059) Fixes #5006

* Add m2e lifecycle mapping for maven-antrun-plugin (#5087)

* Add m2e lifecycle mapping for maven-antrun-plugin

* Catch Throwable during maps sync handling (#5077)

* Shortcuts no longer work, when element is disabled (#5099)

* Shortcuts no longer work, when element is disabled

* Fix getChildCount to always use filter  (#5101) (Fixes vaadin-grid-flow/issues/464)

* Fix invalid null check (#5132)

* Javadoc - Add a component already added to a parent. (#5137)

* Document the fact that a component with a parent will be added to a new parent and removed from the previous one.

* Added Thread.sleeps to make sure Enter key is registered (#5139)

* flow-component-renderer: set focus-target attribute to the first focusable node (#5142)

Fixes #4191

Defining focus-target is necessary for the grid cell delegating focus to the first focusable component within it when Enter key is used (tests available from another PR on vaadin-grid-flow repo)

* Add some configuration for surefire plugin (#5144)

* Add some configuration for surefire plugin

Due to issues with tests run under Windows 10 we need to
add the trimStackTrace and reuseForks configurations also
to the surefire plugin

* Also update the surefire and failsafe plugins.

* Register push static web resources (#5112)

* Avoid for..of loop in renderer (#5171)

* Add DOM listeners before attaching the element (#5195)

Fixes #5152

* Add a generic mechanism for passing values back to the server (#5093)

This is an enabler for #1724 and #4925.

Fixes #4927

* Register superclass in case of route target collision (#5218)

Fixes #5114

* Introduce ValueChangeMode#LAZY, and #TIMEOUT (#4945)

Introduces ValueChangeMode#LAZY, and #TIMEOUT for delayed value synchronization to the server and makes Input implement HasValueChangeMode.

* Check the function presence before calling it (#5208)

Check the function presence before calling it and take care about children property as well.

Fixes #5206

* enable TrackMessageSizeInterceptor to deal with multiple messages in same response

* test for _trackMessageSize responsible to handle multiple messages coming from a single response

* refactor imports

* refactor TrackMessageSize test

* using IOUtils to read from InputStream

* Test for Long Polling when multiple threads run within a short period

* Enhanced code

* refactor getFileContent to use full path to retrieve vaadinPush.js

* Correct javadocs for DomEvent (#5215)

Fixes #5211

* Update jsoup version (#5253)

Fixes #4127

* Avoid indeterministic behavior in tests. (#5283)

Set locale explicitly in the tests.

Fixes #3500

* Handle empty attribute values properly in HTML element (#5255)

Fixes #5220

* Update chrome version in tests (#5295)

* Remove redundant words form javadocs (#5294)

Fixes #2770

* Update chromedriver version (#5297)

* Exporter-based embeddable web component impl. (#5260)

WebComponent is currently named IWebComponent to avoid naming collisions with
the existing classes - this will be fixed once the functionality has been
transferred over to the new components.

* Merge branch 'master' into issues/merge_from_master

# Conflicts:
#	build-tools/pom.xml
#	flow-bom/pom.xml
#	flow-client/pom.xml
#	flow-components-parent/flow-code-generator-api/pom.xml
#	flow-components-parent/flow-code-generator/pom.xml
#	flow-components-parent/flow-component-demo-helpers/pom.xml
#	flow-components-parent/flow-generated-components/pom.xml
#	flow-components-parent/flow-webcomponent-api-analyzer/pom.xml
#	flow-components-parent/pom.xml
#	flow-data/pom.xml
#	flow-data/src/test/java/com/vaadin/flow/data/binder/testcomponents/TestLabel.java
#	flow-html-components-testbench/pom.xml
#	flow-html-components/pom.xml
#	flow-maven-plugin/pom.xml
#	flow-osgi/pom.xml
#	flow-push/pom.xml
#	flow-server-production-mode/pom.xml
#	flow-server/pom.xml
#	flow-server/src/main/java/com/vaadin/flow/component/WebComponent.java
#	flow-server/src/main/java/com/vaadin/flow/component/webcomponent/WebComponentMethod.java
#	flow-server/src/main/java/com/vaadin/flow/server/communication/WebComponentProvider.java
#	flow-server/src/main/java/com/vaadin/flow/server/webcomponent/WebComponentGenerator.java
#	flow-server/src/test/java/com/vaadin/flow/internal/nodefeature/ReturnChannelMapTest.java
#	flow-server/src/test/java/com/vaadin/flow/server/BootstrapHandlerTest.java
#	flow-server/src/test/java/com/vaadin/flow/server/communication/WebComponentProviderTest.java
#	flow-server/src/test/java/com/vaadin/flow/server/communication/rpc/ReturnChannelHandlerTest.java
#	flow-server/src/test/java/com/vaadin/flow/server/webcomponent/WebComponentGeneratorTest.java
#	flow-test-generic/pom.xml
#	flow-test-util/pom.xml
#	flow-tests/pom.xml
#	flow-tests/servlet-containers/felix-jetty/pom.xml
#	flow-tests/servlet-containers/pom.xml
#	flow-tests/servlet-containers/tomcat85/pom.xml
#	flow-tests/servlet-containers/tomcat9/pom.xml
#	flow-tests/test-common/pom.xml
#	flow-tests/test-dev-mode/pom.xml
#	flow-tests/test-frontend-production-custom-context/pom.xml
#	flow-tests/test-lumo-theme/pom.xml
#	flow-tests/test-material-theme/pom.xml
#	flow-tests/test-memory-leaks/pom.xml
#	flow-tests/test-pwa/pom.xml
#	flow-tests/test-resources/pom.xml
#	flow-tests/test-root-context/pom.xml
#	flow-tests/test-root-context/src/main/java/com/vaadin/flow/uitest/ui/DomListenerOnAttachView.java
#	flow-tests/test-root-context/src/main/java/com/vaadin/flow/uitest/ui/ReturnChannelView.java
#	flow-tests/test-root-context/src/test/java/com/vaadin/flow/uitest/ui/ReturnChannelIT.java
#	flow-tests/test-root-ui-context/pom.xml
#	flow-tests/test-router-custom-context/pom.xml
#	flow-tests/test-scalability/pom.xml
#	flow-tests/test-servlet/pom.xml
#	flow-tests/test-subcontext/pom.xml
#	flow-tests/test-themes/pom.xml
#	flow-tests/test-web-components/pom.xml
#	flow-tests/test-web-components/src/main/java/com/vaadin/flow/webcomponent/ClientSelect.java
#	flow-tests/test-web-components/src/main/java/com/vaadin/flow/webcomponent/UpdateServerSideWebComponent.java
#	flow-tests/test-web-components/src/main/webapp/push.html
#	flow-tests/test-web-components/src/test/java/com/vaadin/flow/webcomponent/UpdateServerSideWebComponentIT.java
#	flow-theme-integrations/lumo/pom.xml
#	flow-theme-integrations/material/pom.xml
#	flow-theme-integrations/pom.xml
#	flow/pom.xml
#	pom.xml
  • Loading branch information
caalador authored and manolo committed Mar 19, 2019
1 parent 4bcf9b7 commit 0655475
Show file tree
Hide file tree
Showing 57 changed files with 3,180 additions and 1,645 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Instructions on how to set up a working environment for developing the Flow proj

`master` branch is the latest version that will at some point be released in the [Vaadin platform](https://github.com/vaadin/platform). See other branches for other framework versions:
* 1.0 branch is Vaadin 10 LTS (Flow version 1.0)
* 1.3 branch is for Vaadin 13 (Flow version 1.3)
* 1.4 branch is for Vaadin 13 (Flow version 1.4)

Setting up Eclipse to Develop Flow
=========
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2019 Vaadin Ltd.
* Copyright 2000-2018 Vaadin Ltd.
*
* 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
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
* Copyright 2000-2018 Vaadin Ltd.
*
* 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 com.vaadin.flow.component;

import java.io.Serializable;

import com.vaadin.flow.component.webcomponent.WebComponentDefinition;

/**
* Provides a way to exporter a class which extends {@link Component} as an
* embeddable web component The tag of the exporter web component <b>must
* be</b> defined using {@link Tag} annotation - otherwise, an exception will
* be thrown. The tag must be a non-null, non-empty string with
* dash-separated words, i.e. "dash-separated".
* <p>
* The exported web components can be embedded into non-Vaadin
* applications.
* <p>
* Example of exporting {@code MyComponent} component:
* <pre>
* &#064;Tag("my-component")
* public class Exporter implements WebComponentExporter&lt;MyComponent&gt;() {
* &#064;Override
* public void define(WebComponentDefinition&lt;MyComponent&gt;
* definition) {
* definition.addProperty("name", "John Doe")
* .onChange(MyComponent::setName);
* }
* }
* </pre>
*
* @param <C> type of the component to export
*/
public interface WebComponentExporter<C extends Component> extends Serializable {
/**
* Called by the web component export process. Use the given
* {@link WebComponentDefinition} to define web component's properties,
* and how the properties interact with the {@link Component} being
* exported.
*
* @param definition instance used to define the component.
*/
void define(WebComponentDefinition<C> definition);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
/*
* Copyright 2000-2018 Vaadin Ltd.
*
* 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 com.vaadin.flow.component.webcomponent;

import java.io.Serializable;

/**
* {@code EventOptions} is used to configure the custom event
* published by an exported web component.
*/
public class EventOptions implements Serializable {
private boolean bubbles = false;
private boolean cancelable = false;
private boolean composed = false;

/**
* Create {@code EventOptions} used to configure the custom event
* published by an exported web component.
*
* @see #EventOptions(boolean, boolean, boolean) for all properties
* @see com.vaadin.flow.component.WebComponentExporter for exporting web
* components
*/
public EventOptions() {}

/**
* Create {@code EventOptions} used to configure the custom event
* published by an exported web component.
*
* @param bubbles
* A Boolean indicating whether the event bubbles up through the
* DOM or not.
* @see #EventOptions(boolean, boolean, boolean) for all properties
* @see com.vaadin.flow.component.WebComponentExporter for exporting web
* components
*/
public EventOptions(boolean bubbles) {
this.bubbles = bubbles;
}

/**
* Create {@code EventOptions} used to configure the custom event
* published by an exported web component.
*
* @param bubbles
* indicates whether the event bubbles up through the
* DOM or not.
* @param cancelable
* indicates whether the event is cancelable.
* @param composed
* indicates whether or not the event can bubble
* across the boundary between the shadow DOM and the regular DOM.
* @see com.vaadin.flow.component.WebComponentExporter for exporting web
* components
*/
public EventOptions(boolean bubbles, boolean cancelable,
boolean composed) {
this.bubbles = bubbles;
this.cancelable = cancelable;
this.composed = composed;
}

/**
* Can the event bubbles up through the DOM or not.
*
* @return bubbles
*/
public boolean isBubbles() {
return bubbles;
}

/**
* Is the event is cancelable.
*
* @return cancellable
*/
public boolean isCancelable() {
return cancelable;
}

/**
* Can the event bubble across the boundary between the shadow DOM and the
* regular DOM.
*
* @return composed
*/
public boolean isComposed() {
return composed;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* Copyright 2000-2018 Vaadin Ltd.
*
* 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 com.vaadin.flow.component.webcomponent;

import com.vaadin.flow.component.Component;
import com.vaadin.flow.function.SerializableBiConsumer;

/**
* Provides a way to configure the {@link Component} instance created for the
* exported web component embedded onto a website. An implementation of this
* interface is given to
* {@link WebComponentDefinition#setInstanceConfigurator(InstanceConfigurator)},
* which is received by the user's
* {@link com.vaadin.flow.component.WebComponentExporter} implementation.
*
* @param <C> type of the {@code component} exported as a web component
*/
@FunctionalInterface
public interface InstanceConfigurator<C extends Component> extends SerializableBiConsumer<WebComponent<C>, C> {
/**
* If custom initialization for the created {@link Component} instance is
* needed, it can be done here. It is also possible to configure custom
* communication between the {@code component} instance and client-side
* web component using the {@link WebComponent} instance. The {@code
* webComponent} and {@code component} are in 1-to-1 relation.
*
* @param webComponent instance representing the client-side web
* component instance matching the component
* @param component exported component instance
*/
@Override
void accept(WebComponent<C> webComponent, C component);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/*
* Copyright 2000-2018 Vaadin Ltd.
*
* 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 com.vaadin.flow.component.webcomponent;

import java.io.Serializable;

import com.vaadin.flow.component.Component;
import com.vaadin.flow.function.SerializableBiConsumer;

/**
* Interface used to configure a single property on a web component created
* by subclassing {@link com.vaadin.flow.component.WebComponentExporter}.
* Offers a fluent API for configuring the property.
*
* @param <C> type of the {@code component} exported as a web component
* @param <P> type of the property exposed on the web component
*/
public interface PropertyConfiguration<C extends Component, P extends Serializable> extends Serializable {

/**
* Sets a Property change handler. {@code onChange} can only be called
* once - multiple calls will throw an exception.
* <p>
* The {@code onChangeHandler} is called
* when the property's value changes on the client-side. If the property
* value is {@code null} for a property type which should not receive
* null-values, such as {@code double}, the method will be called with
* the property's default value. The default value is set by
* {@link WebComponentDefinition} when {@code addProperty(propertyName,
* defaultValue} is called.
* <p>
* In the following example we export {@code MyComponent} as a web
* component. The {@code MyComponent} class has a method {@code setName}
* which will be called in response to changes to the registered property
* {@code "name"}.
*
* <pre>
* &#064;Tag("my-component")
* public class Exporter implements WebComponentExporter&lt;MyComponent&gt;() {
* // ... define the web component
* &#064;Override
* public void define(WebComponentDefinition&lt;MyComponent&gt;
* definition) {
* definition.addProperty("name", "John Doe")
* .onChange(MyComponent::setName);
* }
* }
* </pre>
*
* @param onChangeHandler {@code component}'s method which is called with
* the property value
* @return this {@code PropertyConfiguration}
*/
PropertyConfiguration<C, P> onChange(
SerializableBiConsumer<C, P> onChangeHandler);

/**
* Mark the property as read-only. It cannot be written to by the client.
*
* @return this {@code PropertyConfiguration}
*/
PropertyConfiguration<C, P> readOnly();
}
Loading

0 comments on commit 0655475

Please sign in to comment.