Skip to content
This repository has been archived by the owner on Nov 13, 2023. It is now read-only.

Commit

Permalink
Removed Solutions from app to demo
Browse files Browse the repository at this point in the history
  • Loading branch information
lawrencekoehler committed Nov 12, 2023
1 parent a57f70e commit 218a3b5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 17 deletions.
17 changes: 1 addition & 16 deletions vaadin-app/src/main/java/com/example/esde/views/task1/Task1.java
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
package com.example.esde.views.task1;

import com.example.esde.views.MainLayout;
import com.example.esde.views.task2.Task2;
import com.vaadin.flow.component.button.Button;
import com.vaadin.flow.component.button.ButtonVariant;
import com.vaadin.flow.component.html.H2;
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
import com.vaadin.flow.component.textfield.TextField;
import com.vaadin.flow.router.PageTitle;
import com.vaadin.flow.router.Route;
import com.vaadin.flow.theme.Theme;
import com.vaadin.flow.theme.lumo.Lumo;

/**
* This will be a very simple task, change some values, create some objects, and you'll be done!
Expand All @@ -22,15 +18,13 @@ public class Task1 extends VerticalLayout {
private H2 header;
private TextField textfield;
private Button button;
private Button successButton;

public Task1() {
header = createHeader();
button = createButton();
successButton = createSuccessButton();
textfield = null;

add(header, button, successButton);
add(header, button);
}

/**
Expand Down Expand Up @@ -66,14 +60,5 @@ private Button createButton() {
* TODO 4.2: Clicking on the button should navigate to the next task (Task2)
* (Dont forget to add the button to the layout)
*/
private Button createSuccessButton() {
Button button = new Button();
button.setText("Next Task");
button.getStyle().set("background-color","green");
button.addClickListener(buttonClickEvent -> {
getUI().ifPresent(ui -> ui.navigate(Task2.class));
});
return button;
}

}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.example.esde.views.task1;

import com.example.esde.views.MainLayout;
import com.example.esde.views.task2.Task2;
import com.vaadin.flow.component.button.Button;
import com.vaadin.flow.component.html.H2;
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
Expand All @@ -18,13 +19,15 @@ public class Task1 extends VerticalLayout {
private H2 header;
private TextField textfield;
private Button button;
private Button successButton;

public Task1() {
header = createHeader();
button = createButton();
successButton = createSuccessButton();
textfield = null;

add(header, button);
add(header, button, successButton);
}

/**
Expand Down Expand Up @@ -60,5 +63,15 @@ private Button createButton() {
* TODO 4.2: Clicking on the button should navigate to the next task (Task2)
* (Dont forget to add the button to the layout)
*/
private Button createSuccessButton() {
Button button = new Button();
button.setText("Next Task");
button.getStyle().set("background-color","green");
button.addClickListener(buttonClickEvent -> {
getUI().ifPresent(ui -> ui.navigate(Task2.class));
});
return button;
}


}

0 comments on commit 218a3b5

Please sign in to comment.