Skip to content

Commit c7c7b21

Browse files
committed
FIX elements-applogic.html in polymer tutorial
- added some missing imports, HTML imports and @UiField
1 parent 1709267 commit c7c7b21

File tree

1 file changed

+45
-1
lines changed

1 file changed

+45
-1
lines changed

src/main/markdown/doc/latest/polymer-tutorial/elements-applogic.md

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ In this section, we'll learn how to add logic to our UI. We'll touch on very bas
3333
@UiField PaperDrawerPanelElement drawerPanel;
3434
@UiField HTMLElement content;
3535

36+
@UiField PaperFabElement addButton;
3637
@UiField PaperDialogElement addItemDialog;
3738
@UiField PaperInputElement titleInput;
3839
@UiField PaperTextareaElement descriptionInput;
@@ -327,7 +328,50 @@ In this section, we'll learn how to add logic to our UI. We'll touch on very bas
327328
}
328329
}
329330

330-
11. Reload the application
331+
11. Your `TodoList.java` should look like this:
332+
333+
package org.gwtproject.tutorial.client;
334+
335+
import com.google.gwt.core.client.EntryPoint;
336+
import com.google.gwt.user.client.ui.RootPanel;
337+
import com.vaadin.polymer.Polymer;
338+
import com.vaadin.polymer.elemental.Function;
339+
import com.vaadin.polymer.iron.element.IronIconElement;
340+
import com.vaadin.polymer.paper.element.*;
341+
342+
import java.util.Arrays;
343+
344+
public class TodoList implements EntryPoint {
345+
346+
public void onModuleLoad() {
347+
Polymer.importHref(Arrays.asList(
348+
"iron-icons/iron-icons.html",
349+
PaperIconItemElement.SRC,
350+
PaperRippleElement.SRC,
351+
IronIconElement.SRC,
352+
PaperDrawerPanelElement.SRC,
353+
PaperHeaderPanelElement.SRC,
354+
PaperToolbarElement.SRC,
355+
PaperFabElement.SRC,
356+
PaperDialogElement.SRC,
357+
PaperTextareaElement.SRC,
358+
PaperInputElement.SRC,
359+
PaperButtonElement.SRC,
360+
PaperCheckboxElement.SRC
361+
), new Function() {
362+
public Object call(Object arg) {
363+
startApplication();
364+
return null;
365+
}
366+
});
367+
368+
}
369+
370+
private void startApplication() {
371+
RootPanel.get().add(new Main());
372+
}
373+
374+
12. Reload the application
331375

332376
* Add several items
333377
* Mark some of them as done

0 commit comments

Comments
 (0)