Skip to content

Commit

Permalink
-XjsInteropMode is not needed anymore in 2.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
manolo committed Oct 29, 2016
1 parent cc4972c commit 0472ecd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
13 changes: 6 additions & 7 deletions lib/com/vaadin/polymer/PolymerWidget.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import com.google.gwt.regexp.shared.MatchResult;
import com.google.gwt.regexp.shared.RegExp;
import com.google.gwt.safehtml.shared.SafeHtml;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.HTMLPanel;
import com.vaadin.polymer.elemental.*;

Expand Down Expand Up @@ -77,15 +76,10 @@ public HandlerRegistration addClickHandler(ClickHandler handler) {
return addDomHandler(handler, ClickEvent.getType());
}

public void ready(Function f) {
public void ready(Function<?, ?> f) {
Polymer.ready(getElement(), f);
}

public void jsinteropError() {
Window.alert(
"GWT-Polymer ERROR: Double check that you are compiling your project with the `-XjsInteropMode JS` flag");
}

public void setClass(String clazz) {
getElement().setClassName(clazz);
}
Expand All @@ -98,6 +92,10 @@ public void setId(String id) {
getElement().setId(id);
}

public String getId() {
return getElement().getId();
}

/**
* Polymer’s custom property shim evaluates and applies custom property values once at element creation time.
* In order to have an element (and its subtree) re- evaluate custom property values due to dynamic changes
Expand All @@ -107,3 +105,4 @@ public void updateStyles() {
((HTMLElement)getElement()).updateStyles();
}
}

7 changes: 1 addition & 6 deletions template/Widget.template
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,7 @@ public class <%= className() %> extends <%= base ? base : 'PolymerWidget' %> {
* Gets a handle to the Polymer object's underlying DOM element.
*/
public <%= elementClassName() %> getPolymerElement() {
try {
return (<%= elementClassName() %>) getElement();
} catch (ClassCastException e) {
jsinteropError();
return null;
}
return (<%= elementClassName() %>) getElement();
}

<% _.forEach(getGettersAndSetters(properties), function(item) { %>
Expand Down

0 comments on commit 0472ecd

Please sign in to comment.