Skip to content

Commit

Permalink
refactor(demo): update demo views to use commons demo annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
paodb authored and javier-godoy committed Apr 17, 2022
1 parent b24c9c0 commit a550ff2
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,19 @@
*/
package com.flowingcode.vaadin.addons.chipfield;

import com.flowingcode.vaadin.addons.demo.DemoSource;
import com.vaadin.flow.component.button.Button;
import com.vaadin.flow.component.notification.Notification;
import com.vaadin.flow.component.notification.Notification.Position;
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
import com.vaadin.flow.data.binder.Binder;
import com.vaadin.flow.router.PageTitle;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

@PageTitle("Binder")
@DemoSource
@SuppressWarnings("serial")
public class BinderDemo extends VerticalLayout {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,32 +31,12 @@
@GithubLink("https://github.com/FlowingCode/ChipFieldAddon")
public class ChipfieldDemoView extends TabbedDemo {

private static final String DATAPROVIDER_DEMO = "Data Provider";
private static final String RESTRICTED_DEMO = "Restricted";
private static final String DISABLED_DEMO = "Disabled";
private static final String BINDER_DEMO = "Binder";
private static final String READONLY_DEMO = "Readonly";
private static final String STYLED_DEMO = "Styled";
private static final String DATAPROVIDER_SOURCE =
"https://github.com/FlowingCode/ChipFieldAddon/blob/master/src/test/java/com/flowingcode/vaadin/addons/chipfield/DataProviderDemo.java";
private static final String RESTRICTED_SOURCE =
"https://github.com/FlowingCode/ChipFieldAddon/blob/master/src/test/java/com/flowingcode/vaadin/addons/chipfield/RestrictedDemo.java";
private static final String DISABLED_SOURCE =
"https://github.com/FlowingCode/ChipFieldAddon/blob/master/src/test/java/com/flowingcode/vaadin/addons/chipfield/DisabledDemo.java";
private static final String BINDER_SOURCE =
"https://github.com/FlowingCode/ChipFieldAddon/blob/master/src/test/java/com/flowingcode/vaadin/addons/chipfield/BinderDemo.java";
private static final String READONLY_SOURCE =
"https://github.com/FlowingCode/ChipFieldAddon/blob/master/src/test/java/com/flowingcode/vaadin/addons/chipfield/ReadonlyDemo.java";
private static final String STYLED_SOURCE =
"https://github.com/FlowingCode/ChipFieldAddon/blob/master/src/test/java/com/flowingcode/vaadin/addons/chipfield/StyledDemo.java";

public ChipfieldDemoView() {

addDemo(new DataProviderDemo(), DATAPROVIDER_DEMO, DATAPROVIDER_SOURCE);
addDemo(new RestrictedDemo(), RESTRICTED_DEMO, RESTRICTED_SOURCE);
addDemo(new DisabledDemo(), DISABLED_DEMO, DISABLED_SOURCE);
addDemo(new BinderDemo(), BINDER_DEMO, BINDER_SOURCE);
addDemo(new ReadonlyDemo(), READONLY_DEMO, READONLY_SOURCE);
addDemo(new StyledDemo(), STYLED_DEMO, STYLED_SOURCE);
public ChipfieldDemoView() {
addDemo(new DataProviderDemo());
addDemo(new RestrictedDemo());
addDemo(new DisabledDemo());
addDemo(new BinderDemo());
addDemo(new ReadonlyDemo());
addDemo(new StyledDemo());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,18 @@
*/
package com.flowingcode.vaadin.addons.chipfield;

import com.flowingcode.vaadin.addons.demo.DemoSource;
import com.vaadin.flow.component.button.Button;
import com.vaadin.flow.component.notification.Notification;
import com.vaadin.flow.component.notification.Notification.Position;
import com.vaadin.flow.component.orderedlayout.HorizontalLayout;
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
import com.vaadin.flow.data.provider.ListDataProvider;
import com.vaadin.flow.router.PageTitle;
import java.util.stream.Collectors;

@PageTitle("Data Provider")
@DemoSource
@SuppressWarnings("serial")
public class DataProviderDemo extends VerticalLayout {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@
*/
package com.flowingcode.vaadin.addons.chipfield;

import com.flowingcode.vaadin.addons.demo.DemoSource;
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
import com.vaadin.flow.router.PageTitle;

@PageTitle("Disabled")
@DemoSource
@SuppressWarnings("serial")
public class DisabledDemo extends VerticalLayout {
public DisabledDemo() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@
*/
package com.flowingcode.vaadin.addons.chipfield;

import com.flowingcode.vaadin.addons.demo.DemoSource;
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
import com.vaadin.flow.router.PageTitle;

@PageTitle("Readonly")
@DemoSource
@SuppressWarnings("serial")
public class ReadonlyDemo extends VerticalLayout {
public ReadonlyDemo() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,13 @@
*/
package com.flowingcode.vaadin.addons.chipfield;

import com.flowingcode.vaadin.addons.demo.DemoSource;
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
import com.vaadin.flow.router.PageTitle;
import java.util.Arrays;

@PageTitle("Restricted")
@DemoSource
@SuppressWarnings("serial")
public class RestrictedDemo extends VerticalLayout {
public RestrictedDemo() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,13 @@
package com.flowingcode.vaadin.addons.chipfield;

import java.util.Arrays;
import com.flowingcode.vaadin.addons.demo.DemoSource;
import com.vaadin.flow.component.dependency.CssImport;
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
import com.vaadin.flow.router.PageTitle;

@PageTitle("Styled")
@DemoSource
@CssImport(value = "./styles/paper-chip-styles.css", themeFor = "paper-chip")
@CssImport(value = "./styles/paper-chip-input-autocomplete-styles.css", themeFor = "paper-chip-input-autocomplete")
public class StyledDemo extends VerticalLayout {
Expand Down

0 comments on commit a550ff2

Please sign in to comment.