Skip to content

Commit

Permalink
Remove deprecated methods from 3.0
Browse files Browse the repository at this point in the history
Removes or hides remaining API that has been made deprecated in 1.0-2.2.
Only exclusion is @VaadinServletConfiguration, which is kept.

Fixes #6510
  • Loading branch information
pleku committed Jan 10, 2020
1 parent f73d7df commit 139863c
Show file tree
Hide file tree
Showing 19 changed files with 86 additions and 594 deletions.
30 changes: 24 additions & 6 deletions flow-server/src/main/java/com/vaadin/flow/component/Component.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@
import java.util.stream.Stream;
import java.util.stream.Stream.Builder;

import com.vaadin.flow.component.dependency.JavaScript;
import com.vaadin.flow.component.internal.ComponentMetaData;
import com.vaadin.flow.component.polymertemplate.Id;
import com.vaadin.flow.component.polymertemplate.PolymerTemplate;
import com.vaadin.flow.dom.Element;
import com.vaadin.flow.dom.ElementUtil;
import com.vaadin.flow.dom.PropertyChangeListener;
import com.vaadin.flow.dom.ShadowRoot;
import com.vaadin.flow.i18n.I18NProvider;
import com.vaadin.flow.internal.AnnotationReader;
Expand Down Expand Up @@ -70,6 +71,9 @@ public MapToExistingElement(Element element,
private static final PropertyDescriptor<String, Optional<String>> idDescriptor = PropertyDescriptors
.optionalAttributeWithDefault("id", "");

private static final PropertyChangeListener NOOP_PROPERTY_LISTENER = event -> {
};

/**
* Contains information about the element which should be used the next time
* a component class is instantiated.
Expand Down Expand Up @@ -149,11 +153,25 @@ protected Component(Element element) {
* Configures synchronized properties based on given annotations.
*/
private void configureSynchronizedProperties() {
ComponentUtil.getSynchronizedProperties(getClass()).forEach(
info -> getElement().addSynchronizedProperty(info.getProperty(),
info.getUpdateMode()));
ComponentUtil.getSynchronizedPropertyEvents(getClass())
.forEach(getElement()::addSynchronizedPropertyEvent);
ComponentUtil.getSynchronizedProperties(getClass())
.forEach(this::addSynchronizedProperty);
}

private void addSynchronizedProperty(
ComponentMetaData.SynchronizedPropertyInfo info) {
if (info.getUpdateMode() == null) {
throw new IllegalArgumentException(getClass().getName()
+ ": property update control mode for disabled element in @Synchronize annotation must not be null.");
}
info.getEventNames().forEach(eventType -> {
if (eventType == null) {
throw new IllegalArgumentException(getClass().getName()
+ ": event type must not be null for @Synchronize annotation");
}
element.addPropertyChangeListener(info.getProperty(), eventType,
NOOP_PROPERTY_LISTENER)
.setDisabledUpdateMode(info.getUpdateMode());
});
}

private void mapToElement(String tagName) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,6 @@ public boolean isIPad() {
* using IOS or if no information from the browser is present
*/
public boolean isIOS() {
return isIPad() || VaadinSession.getCurrent().getBrowser().isIOS();
return isIPad() || VaadinSession.getCurrent().getBrowser().isIPhone();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public interface Instantiator extends Serializable {
*
* @return a stream of all bootstrap listeners to use, not <code>null</code>
*
* @deprecated This API is deprecated in favor of
* @deprecated Since 3.0, this API is deprecated in favor of
* {@link Instantiator#getIndexHtmlRequestListeners(Stream)}
* when using client-side bootstrapping
*/
Expand Down

0 comments on commit 139863c

Please sign in to comment.