diff --git a/advanced-forms/pom.xml b/advanced-forms/pom.xml index 03d11625..4302507a 100644 --- a/advanced-forms/pom.xml +++ b/advanced-forms/pom.xml @@ -1,6 +1,6 @@ - 4.0.0 @@ -15,7 +15,7 @@ - com.google.gwt + org.gwtproject gwt-user provided diff --git a/advanced-forms/src/main/java/org/dominokit/domino/advancedforms/client/views/ui/AdvancedFormsViewImpl.java b/advanced-forms/src/main/java/org/dominokit/domino/advancedforms/client/views/ui/AdvancedFormsViewImpl.java index 1800bfff..5b98216d 100644 --- a/advanced-forms/src/main/java/org/dominokit/domino/advancedforms/client/views/ui/AdvancedFormsViewImpl.java +++ b/advanced-forms/src/main/java/org/dominokit/domino/advancedforms/client/views/ui/AdvancedFormsViewImpl.java @@ -46,6 +46,8 @@ import java.util.Optional; import java.util.function.Consumer; +import static org.dominokit.domino.ui.utils.Domino.*; + @UiView(presentable = AdvancedFormsProxy.class) @SampleClass diff --git a/alerts/pom.xml b/alerts/pom.xml index 90dfaddf..c1a0adc2 100644 --- a/alerts/pom.xml +++ b/alerts/pom.xml @@ -1,5 +1,5 @@ - 4.0.0 @@ -14,7 +14,7 @@ - com.google.gwt + org.gwtproject gwt-user provided diff --git a/alerts/src/main/java/org/dominokit/domino/alerts/client/views/ui/AlertsViewImpl.java b/alerts/src/main/java/org/dominokit/domino/alerts/client/views/ui/AlertsViewImpl.java index 82679e50..80dd53b5 100644 --- a/alerts/src/main/java/org/dominokit/domino/alerts/client/views/ui/AlertsViewImpl.java +++ b/alerts/src/main/java/org/dominokit/domino/alerts/client/views/ui/AlertsViewImpl.java @@ -12,15 +12,10 @@ import org.dominokit.domino.ui.alerts.Alert; import org.dominokit.domino.ui.cards.Card; import org.dominokit.domino.ui.elements.DivElement; -import org.dominokit.domino.ui.grid.flex.FlexDirection; -import org.dominokit.domino.ui.grid.flex.FlexItem; -import org.dominokit.domino.ui.grid.flex.FlexJustifyContent; -import org.dominokit.domino.ui.grid.flex.FlexLayout; -import org.dominokit.domino.ui.style.Color; -import org.dominokit.domino.ui.style.CompositeCssClass; -import org.dominokit.domino.ui.style.DisplayCss; import org.dominokit.domino.ui.typography.BlockHeader; +import static org.dominokit.domino.ui.utils.Domino.*; + @UiView(presentable = AlertsProxy.class) @SampleClass public class AlertsViewImpl extends BaseDemoView implements AlertsView { diff --git a/animation/pom.xml b/animation/pom.xml index 7ac181ba..fc9dc56f 100644 --- a/animation/pom.xml +++ b/animation/pom.xml @@ -1,5 +1,5 @@ - + 4.0.0 domino-ui-demo @@ -15,7 +15,7 @@ - com.google.gwt + org.gwtproject gwt-user provided diff --git a/animation/src/main/java/org/dominokit/domino/animation/client/views/ui/AnimationViewImpl.java b/animation/src/main/java/org/dominokit/domino/animation/client/views/ui/AnimationViewImpl.java index 842df645..52fbff3e 100644 --- a/animation/src/main/java/org/dominokit/domino/animation/client/views/ui/AnimationViewImpl.java +++ b/animation/src/main/java/org/dominokit/domino/animation/client/views/ui/AnimationViewImpl.java @@ -18,11 +18,11 @@ import org.dominokit.domino.ui.elements.DivElement; import org.dominokit.domino.ui.grid.Column; import org.dominokit.domino.ui.grid.Row; -import org.dominokit.domino.ui.style.Color; -import org.dominokit.domino.ui.style.DisplayCss; import org.dominokit.domino.ui.style.Style; import org.dominokit.domino.ui.typography.BlockHeader; +import static org.dominokit.domino.ui.utils.Domino.*; + @UiView(presentable = AnimationProxy.class) @SampleClass public class AnimationViewImpl extends BaseDemoView implements AnimationView { diff --git a/appLayout/pom.xml b/appLayout/pom.xml index 96f2651e..a6f73e32 100644 --- a/appLayout/pom.xml +++ b/appLayout/pom.xml @@ -1,5 +1,5 @@ - + 4.0.0 domino-ui-demo @@ -15,7 +15,7 @@ - com.google.gwt + org.gwtproject gwt-user provided diff --git a/appLayout/src/main/java/org/dominokit/domino/applayout/client/views/ui/AppLayoutViewImpl.java b/appLayout/src/main/java/org/dominokit/domino/applayout/client/views/ui/AppLayoutViewImpl.java index 54dc3a3c..ed9aa70a 100644 --- a/appLayout/src/main/java/org/dominokit/domino/applayout/client/views/ui/AppLayoutViewImpl.java +++ b/appLayout/src/main/java/org/dominokit/domino/applayout/client/views/ui/AppLayoutViewImpl.java @@ -18,13 +18,13 @@ import org.dominokit.domino.ui.layout.NavBar; import org.dominokit.domino.ui.menu.Menu; import org.dominokit.domino.ui.menu.MenuItem; -import org.dominokit.domino.ui.style.ColorsCss; -import org.dominokit.domino.ui.style.SpacingCss; import org.dominokit.domino.ui.thumbnails.Thumbnail; import org.dominokit.domino.ui.typography.BlockHeader; import org.dominokit.domino.ui.utils.PostfixAddOn; import org.dominokit.domino.ui.utils.PrefixAddOn; +import static org.dominokit.domino.ui.utils.Domino.*; + @UiView(presentable = AppLayoutProxy.class) public class AppLayoutViewImpl extends BaseDemoView implements AppLayoutView { private HTMLDivElement element; diff --git a/badges/pom.xml b/badges/pom.xml index 9b035b77..bffded80 100644 --- a/badges/pom.xml +++ b/badges/pom.xml @@ -1,5 +1,5 @@ - 4.0.0 @@ -14,7 +14,7 @@ - com.google.gwt + org.gwtproject gwt-user provided diff --git a/badges/src/main/java/org/dominokit/domino/badges/client/views/ui/BadgesViewImpl.java b/badges/src/main/java/org/dominokit/domino/badges/client/views/ui/BadgesViewImpl.java index bc31a914..cd52c03d 100644 --- a/badges/src/main/java/org/dominokit/domino/badges/client/views/ui/BadgesViewImpl.java +++ b/badges/src/main/java/org/dominokit/domino/badges/client/views/ui/BadgesViewImpl.java @@ -1,6 +1,7 @@ package org.dominokit.domino.badges.client.views.ui; import elemental2.dom.HTMLDivElement; +import static org.dominokit.domino.ui.utils.Domino.*; import org.dominokit.domino.SampleClass; import org.dominokit.domino.SampleMethod; import org.dominokit.domino.api.client.annotations.UiView; diff --git a/basic-forms/pom.xml b/basic-forms/pom.xml index 83c2065c..856e9905 100644 --- a/basic-forms/pom.xml +++ b/basic-forms/pom.xml @@ -1,5 +1,5 @@ - 4.0.0 @@ -13,7 +13,7 @@ - com.google.gwt + org.gwtproject gwt-user provided diff --git a/basic-forms/src/main/java/org/dominokit/domino/basicforms/client/views/ui/BasicFormsViewImpl.java b/basic-forms/src/main/java/org/dominokit/domino/basicforms/client/views/ui/BasicFormsViewImpl.java index 08feccee..d46b12fe 100644 --- a/basic-forms/src/main/java/org/dominokit/domino/basicforms/client/views/ui/BasicFormsViewImpl.java +++ b/basic-forms/src/main/java/org/dominokit/domino/basicforms/client/views/ui/BasicFormsViewImpl.java @@ -1,6 +1,5 @@ package org.dominokit.domino.basicforms.client.views.ui; -import elemental2.dom.DomGlobal; import elemental2.dom.HTMLDivElement; import org.dominokit.domino.SampleClass; import org.dominokit.domino.SampleMethod; @@ -20,10 +19,10 @@ import org.dominokit.domino.ui.forms.suggest.SelectOption; import org.dominokit.domino.ui.grid.Column; import org.dominokit.domino.ui.grid.Row; -import org.dominokit.domino.ui.icons.lib.Icons; -import org.dominokit.domino.ui.icons.lib.IconsMeta; import org.dominokit.domino.ui.icons.LabeledIcon; import org.dominokit.domino.ui.icons.MdiIcon; +import org.dominokit.domino.ui.icons.lib.Icons; +import org.dominokit.domino.ui.icons.lib.IconsMeta; import org.dominokit.domino.ui.menu.CustomMenuItem; import org.dominokit.domino.ui.menu.direction.DropDirection; import org.dominokit.domino.ui.notifications.Notification; @@ -36,6 +35,8 @@ import static org.dominokit.domino.ui.grid.Column.Span._2; import static org.dominokit.domino.ui.grid.Column.Span._6; +import static org.dominokit.domino.ui.utils.Domino.*; +import static org.dominokit.domino.ui.utils.ElementsFactory.elements; @UiView(presentable = BasicFormsProxy.class) @SampleClass @@ -182,6 +183,7 @@ private void initSelectExample() { onComplete.accept(option); select.selectOption(option); popover.close(); + popover.detach(); } })) ) diff --git a/breadcrumb/pom.xml b/breadcrumb/pom.xml index 08336be5..eabfe695 100644 --- a/breadcrumb/pom.xml +++ b/breadcrumb/pom.xml @@ -1,5 +1,5 @@ - 4.0.0 @@ -14,7 +14,7 @@ - com.google.gwt + org.gwtproject gwt-user provided diff --git a/breadcrumb/src/main/java/org/dominokit/domino/breadcrumb/client/views/ui/BreadcrumbViewImpl.java b/breadcrumb/src/main/java/org/dominokit/domino/breadcrumb/client/views/ui/BreadcrumbViewImpl.java index 5d5ac344..4231d01a 100644 --- a/breadcrumb/src/main/java/org/dominokit/domino/breadcrumb/client/views/ui/BreadcrumbViewImpl.java +++ b/breadcrumb/src/main/java/org/dominokit/domino/breadcrumb/client/views/ui/BreadcrumbViewImpl.java @@ -1,6 +1,7 @@ package org.dominokit.domino.breadcrumb.client.views.ui; import elemental2.dom.HTMLDivElement; +import static org.dominokit.domino.ui.utils.Domino.*; import org.dominokit.domino.SampleClass; import org.dominokit.domino.SampleMethod; import org.dominokit.domino.api.client.annotations.UiView; diff --git a/buttons/pom.xml b/buttons/pom.xml index 229816a1..3ffb5116 100644 --- a/buttons/pom.xml +++ b/buttons/pom.xml @@ -14,7 +14,7 @@ - com.google.gwt + org.gwtproject gwt-user provided diff --git a/buttons/src/main/java/org/dominokit/domino/buttons/client/views/ui/ButtonsViewImpl.java b/buttons/src/main/java/org/dominokit/domino/buttons/client/views/ui/ButtonsViewImpl.java index 334ec8f1..f75a478e 100644 --- a/buttons/src/main/java/org/dominokit/domino/buttons/client/views/ui/ButtonsViewImpl.java +++ b/buttons/src/main/java/org/dominokit/domino/buttons/client/views/ui/ButtonsViewImpl.java @@ -3,6 +3,7 @@ import com.google.gwt.core.client.GWT; import com.google.gwt.core.client.RunAsyncCallback; import elemental2.dom.HTMLDivElement; +import static org.dominokit.domino.ui.utils.Domino.*; import org.dominokit.domino.SampleClass; import org.dominokit.domino.SampleMethod; import org.dominokit.domino.api.client.annotations.UiView; diff --git a/cards/pom.xml b/cards/pom.xml index c279b49b..fabdd43f 100644 --- a/cards/pom.xml +++ b/cards/pom.xml @@ -1,5 +1,5 @@ - 4.0.0 @@ -14,7 +14,7 @@ - com.google.gwt + org.gwtproject gwt-user provided diff --git a/cards/src/main/java/org/dominokit/domino/cards/client/views/ui/CardsViewImpl.java b/cards/src/main/java/org/dominokit/domino/cards/client/views/ui/CardsViewImpl.java index 74d99b1f..57ba21a5 100644 --- a/cards/src/main/java/org/dominokit/domino/cards/client/views/ui/CardsViewImpl.java +++ b/cards/src/main/java/org/dominokit/domino/cards/client/views/ui/CardsViewImpl.java @@ -2,6 +2,7 @@ import elemental2.core.JsDate; import elemental2.dom.HTMLDivElement; +import static org.dominokit.domino.ui.utils.Domino.*; import org.dominokit.domino.SampleClass; import org.dominokit.domino.SampleMethod; import org.dominokit.domino.api.client.annotations.UiView; diff --git a/carousel/pom.xml b/carousel/pom.xml index 06d53c2b..5836ae23 100644 --- a/carousel/pom.xml +++ b/carousel/pom.xml @@ -1,5 +1,5 @@ - 4.0.0 @@ -16,7 +16,7 @@ - com.google.gwt + org.gwtproject gwt-user provided diff --git a/carousel/src/main/java/org/dominokit/domino/carousel/client/views/ui/CarouselViewImpl.java b/carousel/src/main/java/org/dominokit/domino/carousel/client/views/ui/CarouselViewImpl.java index 513bc930..8a9112b1 100644 --- a/carousel/src/main/java/org/dominokit/domino/carousel/client/views/ui/CarouselViewImpl.java +++ b/carousel/src/main/java/org/dominokit/domino/carousel/client/views/ui/CarouselViewImpl.java @@ -2,6 +2,7 @@ import com.google.gwt.core.client.GWT; import elemental2.dom.HTMLDivElement; +import static org.dominokit.domino.ui.utils.Domino.*; import org.dominokit.domino.SampleClass; import org.dominokit.domino.SampleMethod; import org.dominokit.domino.api.client.annotations.UiView; diff --git a/chips/pom.xml b/chips/pom.xml index 9a4d7ec1..fdbf9e8c 100644 --- a/chips/pom.xml +++ b/chips/pom.xml @@ -1,5 +1,5 @@ - + 4.0.0 domino-ui-demo @@ -15,7 +15,7 @@ - com.google.gwt + org.gwtproject gwt-user provided diff --git a/chips/src/main/java/org/dominokit/domino/chips/client/views/ui/ChipsViewImpl.java b/chips/src/main/java/org/dominokit/domino/chips/client/views/ui/ChipsViewImpl.java index f6de692c..f2ec56ae 100644 --- a/chips/src/main/java/org/dominokit/domino/chips/client/views/ui/ChipsViewImpl.java +++ b/chips/src/main/java/org/dominokit/domino/chips/client/views/ui/ChipsViewImpl.java @@ -1,6 +1,7 @@ package org.dominokit.domino.chips.client.views.ui; import elemental2.dom.HTMLDivElement; +import static org.dominokit.domino.ui.utils.Domino.*; import org.dominokit.domino.SampleClass; import org.dominokit.domino.SampleMethod; import org.dominokit.domino.api.client.annotations.UiView; diff --git a/collapse/pom.xml b/collapse/pom.xml index d595aea8..f5c092e9 100644 --- a/collapse/pom.xml +++ b/collapse/pom.xml @@ -1,5 +1,5 @@ - 4.0.0 @@ -14,7 +14,7 @@ - com.google.gwt + org.gwtproject gwt-user provided diff --git a/collapse/src/main/java/org/dominokit/domino/collapse/client/views/ui/CollapseViewImpl.java b/collapse/src/main/java/org/dominokit/domino/collapse/client/views/ui/CollapseViewImpl.java index 1068c751..ce5e4bb8 100644 --- a/collapse/src/main/java/org/dominokit/domino/collapse/client/views/ui/CollapseViewImpl.java +++ b/collapse/src/main/java/org/dominokit/domino/collapse/client/views/ui/CollapseViewImpl.java @@ -1,6 +1,7 @@ package org.dominokit.domino.collapse.client.views.ui; import elemental2.dom.HTMLDivElement; +import static org.dominokit.domino.ui.utils.Domino.*; import org.dominokit.domino.SampleClass; import org.dominokit.domino.SampleMethod; import org.dominokit.domino.api.client.annotations.UiView; diff --git a/colors/pom.xml b/colors/pom.xml index 68fdc1ff..0a29c6ca 100644 --- a/colors/pom.xml +++ b/colors/pom.xml @@ -1,5 +1,5 @@ - + 4.0.0 domino-ui-demo @@ -15,7 +15,7 @@ - com.google.gwt + org.gwtproject gwt-user provided diff --git a/colors/src/main/java/org/dominokit/domino/colors/client/views/ui/ColorsViewImpl.java b/colors/src/main/java/org/dominokit/domino/colors/client/views/ui/ColorsViewImpl.java index ebfa5282..b8a92603 100644 --- a/colors/src/main/java/org/dominokit/domino/colors/client/views/ui/ColorsViewImpl.java +++ b/colors/src/main/java/org/dominokit/domino/colors/client/views/ui/ColorsViewImpl.java @@ -12,7 +12,8 @@ import org.dominokit.domino.ui.grid.Row; import org.dominokit.domino.ui.style.Color; import org.dominokit.domino.ui.style.ColorScheme; -import org.dominokit.domino.ui.typography.BlockHeader; + +import static org.dominokit.domino.ui.utils.Domino.*; @UiView(presentable = ColorsProxy.class) diff --git a/component-case/component-case-frontend-ui/pom.xml b/component-case/component-case-frontend-ui/pom.xml index 98e36014..356dae36 100644 --- a/component-case/component-case-frontend-ui/pom.xml +++ b/component-case/component-case-frontend-ui/pom.xml @@ -1,5 +1,5 @@ - 4.0.0 @@ -14,7 +14,7 @@ - com.google.gwt + org.gwtproject gwt-user provided diff --git a/component-case/component-case-frontend-ui/src/main/java/org/dominokit/domino/componentcase/client/ui/views/CodeCard.java b/component-case/component-case-frontend-ui/src/main/java/org/dominokit/domino/componentcase/client/ui/views/CodeCard.java index ea4d46b1..5cbe8f60 100644 --- a/component-case/component-case-frontend-ui/src/main/java/org/dominokit/domino/componentcase/client/ui/views/CodeCard.java +++ b/component-case/component-case-frontend-ui/src/main/java/org/dominokit/domino/componentcase/client/ui/views/CodeCard.java @@ -23,6 +23,8 @@ import java.util.function.Consumer; +import static org.dominokit.domino.ui.utils.Domino.*; + public class CodeCard extends BaseDominoElement { private TextAreaElement copyInput; diff --git a/component-case/component-case-frontend-ui/src/main/java/org/dominokit/domino/componentcase/client/ui/views/LinkToSourceCode.java b/component-case/component-case-frontend-ui/src/main/java/org/dominokit/domino/componentcase/client/ui/views/LinkToSourceCode.java index b6362d1e..5fd39c70 100644 --- a/component-case/component-case-frontend-ui/src/main/java/org/dominokit/domino/componentcase/client/ui/views/LinkToSourceCode.java +++ b/component-case/component-case-frontend-ui/src/main/java/org/dominokit/domino/componentcase/client/ui/views/LinkToSourceCode.java @@ -2,6 +2,7 @@ import elemental2.dom.DomGlobal; import elemental2.dom.HTMLDivElement; +import static org.dominokit.domino.ui.utils.Domino.*; import org.dominokit.domino.ui.elements.DivElement; import org.dominokit.domino.ui.icons.lib.Icons; import org.dominokit.domino.ui.style.Elevation; diff --git a/component-case/component-case-frontend/pom.xml b/component-case/component-case-frontend/pom.xml index 8eacc570..92014e5a 100644 --- a/component-case/component-case-frontend/pom.xml +++ b/component-case/component-case-frontend/pom.xml @@ -1,5 +1,5 @@ - 4.0.0 @@ -14,7 +14,7 @@ - com.google.gwt + org.gwtproject gwt-user provided diff --git a/datatable/pom.xml b/datatable/pom.xml index e4c59cfe..4c7b594d 100644 --- a/datatable/pom.xml +++ b/datatable/pom.xml @@ -1,5 +1,5 @@ - 4.0.0 @@ -16,7 +16,7 @@ - com.google.gwt + org.gwtproject gwt-user provided diff --git a/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/BasicDataTableViewImpl.java b/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/BasicDataTableViewImpl.java index e7a9e628..93a575d7 100644 --- a/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/BasicDataTableViewImpl.java +++ b/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/BasicDataTableViewImpl.java @@ -1,6 +1,7 @@ package org.dominokit.domino.datatable.client.views.ui; import elemental2.dom.HTMLDivElement; +import static org.dominokit.domino.ui.utils.Domino.*; import org.dominokit.domino.SampleClass; import org.dominokit.domino.SampleMethod; import org.dominokit.domino.api.client.annotations.UiView; diff --git a/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/ColumnResizePluginViewImpl.java b/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/ColumnResizePluginViewImpl.java index 1fc721c6..c41694f5 100644 --- a/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/ColumnResizePluginViewImpl.java +++ b/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/ColumnResizePluginViewImpl.java @@ -1,6 +1,7 @@ package org.dominokit.domino.datatable.client.views.ui; import elemental2.dom.HTMLDivElement; +import static org.dominokit.domino.ui.utils.Domino.*; import org.dominokit.domino.SampleClass; import org.dominokit.domino.SampleMethod; import org.dominokit.domino.api.client.annotations.UiView; diff --git a/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/ColumnsGroupsViewImpl.java b/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/ColumnsGroupsViewImpl.java index ff96aa86..d014f4c0 100644 --- a/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/ColumnsGroupsViewImpl.java +++ b/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/ColumnsGroupsViewImpl.java @@ -1,6 +1,7 @@ package org.dominokit.domino.datatable.client.views.ui; import elemental2.dom.HTMLDivElement; +import static org.dominokit.domino.ui.utils.Domino.*; import org.dominokit.domino.SampleClass; import org.dominokit.domino.SampleMethod; import org.dominokit.domino.api.client.annotations.UiView; diff --git a/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/ContactDetails.java b/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/ContactDetails.java index b8e598c4..4112850f 100644 --- a/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/ContactDetails.java +++ b/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/ContactDetails.java @@ -1,6 +1,7 @@ package org.dominokit.domino.datatable.client.views.ui; import elemental2.dom.HTMLDivElement; +import static org.dominokit.domino.ui.utils.Domino.*; import org.dominokit.domino.datatable.client.views.model.Contact; import org.dominokit.domino.ui.datatable.CellRenderer; import org.dominokit.domino.ui.datatable.TableRow; diff --git a/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/DataTableViewImpl.java b/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/DataTableViewImpl.java deleted file mode 100644 index 12a5435f..00000000 --- a/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/DataTableViewImpl.java +++ /dev/null @@ -1,1738 +0,0 @@ -package org.dominokit.domino.datatable.client.views.ui; - -import elemental2.dom.HTMLDivElement; -import org.dominokit.domino.SampleClass; -import org.dominokit.domino.api.client.annotations.UiView; -import org.dominokit.domino.componentcase.client.ui.views.BaseDemoView; -import org.dominokit.domino.datatable.client.presenters.DatatableProxy; -import org.dominokit.domino.datatable.client.views.DatatableView; - -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -//@UiView(presentable = DatatableProxy.class) -//@SampleClass -public class DataTableViewImpl extends BaseDemoView implements DatatableView { - - private HTMLDivElement element; -// private List contactListParseHandlers = new ArrayList<>(); - private Random random = new Random(); - - @Override - protected HTMLDivElement init() { - element = div().element(); - -// uiHandlers.startLoading(); -// element.appendChild(LinkToSourceCode.create("datatable", this.getClass()).element()); -// element.appendChild(BlockHeader.create("DATA TABLES", "For detailed demo code please visit: ") -// .appendChild(a().attr("href", "https://github.com/DominoKit/domino-ui-demo/tree/master/datatable") -// .attr("target", "_blank") -// .textContent("Data table demo source code").element()) -// .element()); - -// basicTable(); -// element.appendChild(CodeCard.createLazyCodeCard(CodeResource.INSTANCE.basicTable()).element()); -// -// editableTable(); -// element.appendChild(CodeCard.createLazyCodeCard(CodeResource.INSTANCE.editableTable()).element()); - -// basicFixedTable(); -// element.appendChild(CodeCard.createLazyCodeCard(CodeResource.INSTANCE.basicFixedTable()).element()); - -// singleSelectionPlugin(); -// element.appendChild(CodeCard.createLazyCodeCard(CodeResource.INSTANCE.singleSelectionPlugin()).element()); -// -// multiSelectionPlugin(); -// element.appendChild(CodeCard.createLazyCodeCard(CodeResource.INSTANCE.multiSelectionPlugin()).element()); -// -// markerPlugin(); -// element.appendChild(CodeCard.createLazyCodeCard(CodeResource.INSTANCE.markerPlugin()).element()); -// -// recordDetailsPlugin(); -// element.appendChild(CodeCard.createLazyCodeCard(CodeResource.INSTANCE.recordDetailsPlugin()).element()); -// -// tableHeaderBarPlugin(); -// element.appendChild(CodeCard.createLazyCodeCard(CodeResource.INSTANCE.tableHeaderBarPlugin()).element()); -// -// sortAndSearch(); -// element.appendChild(CodeCard.createLazyCodeCard(CodeResource.INSTANCE.sortAndSearch()).element()); -// -// simplePagination(); -// element.appendChild(CodeCard.createLazyCodeCard(CodeResource.INSTANCE.simplePagination()).element()); -// -// scrollingPagination(); -// element.appendChild(CodeCard.createLazyCodeCard(CodeResource.INSTANCE.scrollingPagination()).element()); -// -// advancedPagination(); -// element.appendChild(CodeCard.createLazyCodeCard(CodeResource.INSTANCE.advancedPagination()).element()); -// -// scrollableTable(); -// element.appendChild(CodeCard.createLazyCodeCard(CodeResource.INSTANCE.scrollableTable()).element()); -// -// topPanelPlugin(); -// element.appendChild(CodeCard.createLazyCodeCard(CodeResource.INSTANCE.topPanelPlugin()).element()); -// -// groupingTable(); -// element.appendChild(CodeCard.createLazyCodeCard(CodeResource.INSTANCE.groupingTable()).element()); -// -// treeGridFullParentSpan(); -// element.appendChild(CodeCard.createLazyCodeCard(CodeResource.INSTANCE.treeGridFullParentSpan()).element()); -// -// treeGridParentColumns(); -// element.appendChild(CodeCard.createLazyCodeCard(CodeResource.INSTANCE.treeGridParentColumns()).element()); -// -// allInOne(); -// element.appendChild(CodeCard.createLazyCodeCard(CodeResource.INSTANCE.allInOne()).element()); - - -// initData(); - - return element; - } - -// private void initData() { -// try { -// JsonResource.INSTANCE.generatedJson().getText(new ResourceCallback() { -// @Override -// public void onError(ResourceException e) { -// DomGlobal.console.error("could not load json", e); -// } -// -// @Override -// public void onSuccess(TextResource resource) { -// ContactList contactList = ContactList.MAPPER.read(resource.getText()); -// List contacts = contactList.getContacts(); -// List level1 = addFriends(contacts, contacts.subList(0, 20)); -// List level2 = addFriends(contacts, level1); -// addFriends(contacts, level2); -// contactListParseHandlers.forEach(contactListParseHandler -> -// contactListParseHandler.onContactsParsed(contacts)); -// uiHandlers.stopLoading(); -// } -// }); -// } catch (ResourceException e) { -// DomGlobal.console.error("could not load json", e); -// } -// } -// -// private List addFriends(List pool, List contacts) { -// List result = new ArrayList<>(); -// for (int i = 0; i < contacts.size(); i++) { -// int start = random.nextInt(20); -// List friends = pool.subList(start, start + random.nextInt(5)) -// .stream() -// .map(Contact::new) -// .collect(Collectors.toList()); -// -// contacts.forEach(c -> c.setFriends(friends)); -// result.addAll(friends); -// } -// -// return result; -// } -// -// @SampleMethod -// private void treeGridFullParentSpan() { -// -// TableConfig tableConfig = new TableConfig<>(); -// tableConfig -// .addColumn(ColumnConfig.create("id", "#") -// .textAlign("right") -// .asHeader() -// .setCellRenderer(cell -> TextNode.of(cell.getTableRow().getRecord().getIndex() + 1 + ""))) -// -// .addColumn(ColumnConfig.create("status", "Status") -// .textAlign("center") -// .setCellRenderer(cell -> { -// if (cell.getTableRow().getRecord().isActive()) { -// return Style.of(Icons.check_circle()).setColor(Color.GREEN_DARKEN_3.getHex()).element(); -// } else { -// return Style.of(Icons.close_circle()).setColor(Color.RED_DARKEN_3.getHex()).element(); -// } -// })) -// .addColumn(ColumnConfig.create("gender", "Gender") -// .setCellRenderer(cell -> ContactUiUtils.getGenderElement(cell.getRecord())) -// .textAlign("center")) -// -// .addColumn(ColumnConfig.create("eyeColor", "Eye color") -// .setCellRenderer(cell -> ContactUiUtils.getEyeColorElement(cell.getRecord())) -// .textAlign("center")) -// -// .addColumn(ColumnConfig.create("balance", "Balance") -// .setCellRenderer(cellInfo -> ContactUiUtils.getBalanceElement(cellInfo.getRecord()))) -// -// .addColumn(ColumnConfig.create("email", "Email") -// .setCellRenderer(cell -> TextNode.of(cell.getTableRow().getRecord().getEmail()))) -// -// .addColumn(ColumnConfig.create("phone", "Phone") -// .setCellRenderer(cell -> TextNode.of(cell.getTableRow().getRecord().getPhone()))) -// -// .addColumn(ColumnConfig.create("badges", "Badges") -// .setCellRenderer(cell -> { -// if (cell.getTableRow().getRecord().getAge() < 35) { -// return Badge.create("Young") -// .setBackground(ColorScheme.GREEN.color()).element(); -// } -// return TextNode.of(""); -// })) -// .onUtilityColumn(utilityColumn -> { -// utilityColumn -// .setTitle("First name") -// .setSortable(true, "id"); -// }) -// .setMultiSelect(true) -// .addPlugin(new SortPlugin<>()) -// .addPlugin(new SelectionPlugin<>()) -// .addPlugin(new RecordDetailsPlugin<>(cell -> new ContactDetails(cell).element())) -// .addPlugin(new RowMarkerPlugin<>(tableCellInfo -> ContactUiUtils.getBalanceColor(tableCellInfo.getRecord()))) -// .addPlugin(new TreeGridPlugin((parent, itemsConsumer) -> { -// itemsConsumer.accept(Optional.ofNullable(parent.getFriends())); -// }) -// .setIndentColumnElementSupplier(tableRow -> Paragraph.create(tableRow.getRecord().getName()).setMarginBottom("0").element()) -// .setParentRowCellsSupplier((dataTable, tableRow) -> { -// HTMLTableCellElement cellElement = DominoElement.of(td()) -// .setAttribute("colspan", "8") -// .element(); -// RowCell rowCell = -// new RowCell<>(new CellRenderer.CellInfo<>(tableRow, cellElement), dataTable.getTableConfig().getColumnByName("id")); -// return Collections.singletonList(rowCell); -// }) -// .setIndent(60)); -// -// LocalListDataStore localListDataStore = new LocalListDataStore<>(); -// DataTable table = new DataTable<>(tableConfig, localListDataStore); -// -// element.appendChild(Card.create("TREE GRID PLUGIN - Full PARENT SPAN", "Render records in tree style with expand and collapse features") -// .setCollapsible() -// .appendChild(new TableStyleActions(table)) -// .appendChild(table) -// .element()); -// -// contactListParseHandlers.add(contacts -> { -// localListDataStore.setData(contacts.subList(0, 25)); -// table.load(); -// }); -// } -// -// @SampleMethod -// private void treeGridParentColumns() { -// -// TableConfig tableConfig = new TableConfig<>(); -// tableConfig -// .addColumn(ColumnConfig.create("id", "#") -// .textAlign("right") -// .asHeader() -// .setCellRenderer(cell -> TextNode.of(cell.getTableRow().getRecord().getIndex() + 1 + ""))) -// -// .addColumn(ColumnConfig.create("status", "Status") -// .textAlign("center") -// .setCellRenderer(cell -> { -// if (cell.getTableRow().getRecord().isActive()) { -// return Style.of(Icons.check_circle()).setColor(Color.GREEN_DARKEN_3.getHex()).element(); -// } else { -// return Style.of(Icons.close_circle()).setColor(Color.RED_DARKEN_3.getHex()).element(); -// } -// })) -// .addColumn(ColumnConfig.create("gender", "Gender") -// .setCellRenderer(cell -> ContactUiUtils.getGenderElement(cell.getRecord())) -// .textAlign("center")) -// -// .addColumn(ColumnConfig.create("eyeColor", "Eye color") -// .setCellRenderer(cell -> ContactUiUtils.getEyeColorElement(cell.getRecord())) -// .textAlign("center")) -// -// .addColumn(ColumnConfig.create("balance", "Balance") -// .setCellRenderer(cellInfo -> ContactUiUtils.getBalanceElement(cellInfo.getRecord()))) -// -// .addColumn(ColumnConfig.create("email", "Email") -// .setCellRenderer(cell -> TextNode.of(cell.getTableRow().getRecord().getEmail()))) -// -// .addColumn(ColumnConfig.create("phone", "Phone") -// .setCellRenderer(cell -> TextNode.of(cell.getTableRow().getRecord().getPhone()))) -// -// .addColumn(ColumnConfig.create("badges", "Badges") -// .setCellRenderer(cell -> { -// if (cell.getTableRow().getRecord().getAge() < 35) { -// return Badge.create("Young") -// .setBackground(ColorScheme.GREEN.color()).element(); -// } -// return TextNode.of(""); -// })) -// .onUtilityColumn(utilityColumn -> { -// utilityColumn -// .setSortable(true, "id") -// .setTitle("First name"); -// }) -// .setMultiSelect(true) -// .addPlugin(new SortPlugin<>()) -// .addPlugin(new SelectionPlugin<>()) -// .addPlugin(new RecordDetailsPlugin<>(cell -> new ContactDetails(cell).element())) -// .addPlugin(new RowMarkerPlugin<>(tableCellInfo -> ContactUiUtils.getBalanceColor(tableCellInfo.getRecord()))) -// .addPlugin(new TreeGridPlugin((parent, itemsConsumer) -> itemsConsumer.accept(Optional.ofNullable(parent.getFriends()))) -// .setIndentColumnElementSupplier(tableRow -> Paragraph.create(tableRow.getRecord().getName()).setMarginBottom("0").element()) -// .setIndent(60)); -// -// LocalListDataStore localListDataStore = new LocalListDataStore<>(); -// DataTable table = new DataTable<>(tableConfig, localListDataStore); -// -// element.appendChild(Card.create("TREE GRID PLUGIN - PARENT WITH COLUMNS", "Render records in tree style with expand and collapse features") -// .setCollapsible() -// .appendChild(new TableStyleActions(table)) -// .appendChild(table) -// .element()); -// -// contactListParseHandlers.add(contacts -> { -// localListDataStore.setData(contacts.subList(0, 25)); -// table.load(); -// }); -// } -// -// private void sortChildren(TreeGridSample item, Comparator comparator) { -// item.getItems().sort(comparator); -// for (TreeGridSample itemItem : item.getItems()) { -// sortChildren(itemItem, comparator); -// } -// } -// -// @SampleMethod -// private void groupingTable() { -// TableConfig tableConfig = new TableConfig<>(); -// tableConfig -// .addColumn(ColumnConfig.create("id", "#") -// .textAlign("right") -// .asHeader() -// .setCellRenderer(cell -> TextNode.of(cell.getTableRow().getRecord().getIndex() + 1 + ""))) -// -// .addColumn(ColumnConfig.create("status", "Status") -// .textAlign("center") -// .setCellRenderer(cell -> { -// if (cell.getTableRow().getRecord().isActive()) { -// return Style.of(Icons.check_circle()).setColor(Color.GREEN_DARKEN_3.getHex()).element(); -// } else { -// return Style.of(Icons.close_circle()).setColor(Color.RED_DARKEN_3.getHex()).element(); -// } -// })) -// .addColumn(ColumnConfig.create("firstName", "First name") -// .setCellRenderer(cell -> TextNode.of(cell.getTableRow().getRecord().getName()))) -// -// -// .addColumn(ColumnConfig.create("gender", "Gender") -// .setCellRenderer(cell -> ContactUiUtils.getGenderElement(cell.getRecord())) -// .textAlign("center")) -// -// .addColumn(ColumnConfig.create("eyeColor", "Eye color") -// .setCellRenderer(cell -> ContactUiUtils.getEyeColorElement(cell.getRecord())) -// .textAlign("center")) -// -// .addColumn(ColumnConfig.create("balance", "Balance") -// .setCellRenderer(cellInfo1 -> ContactUiUtils.getBalanceElement(cellInfo1.getRecord()))) -// -// .addColumn(ColumnConfig.create("email", "Email") -// .setCellRenderer(cell -> TextNode.of(cell.getTableRow().getRecord().getEmail()))) -// -// .addColumn(ColumnConfig.create("phone", "Phone") -// .setCellRenderer(cell -> TextNode.of(cell.getTableRow().getRecord().getPhone()))) -// -// .addColumn(ColumnConfig.create("badges", "Badges") -// .setCellRenderer(cell -> { -// if (cell.getTableRow().getRecord().getAge() < 35) { -// return Badge.create("Young") -// .setBackground(ColorScheme.GREEN.color()).element(); -// } -// return TextNode.of(""); -// })); -// tableConfig.addPlugin(new GroupingPlugin<>(tableRow -> tableRow.getRecord().getGender().toString(), -// cellInfo -> { -// DominoElement.of(cellInfo.getElement()) -// .style() -// .setCssProperty("border-bottom", "1px solid #afafaf") -// .setPadding(px.of(5)) -// .addCss(ColorScheme.INDIGO.lighten_5().getBackground()); -// return TextNode.of(cellInfo.getRecord().getGender().getLabel()); -// })); -// LocalListDataStore localListDataStore = new LocalListDataStore<>(); -// DataTable table = new DataTable<>(tableConfig, localListDataStore); -// -// element.appendChild(Card.create("GROUPING PLUGIN", "The plugin allows splitting the table data into different groups.") -// .setCollapsible() -// .appendChild(new TableStyleActions(table)) -// .appendChild(table) -// .element()); -// -// contactListParseHandlers.add(contacts -> { -// localListDataStore.setData(subList(contacts)); -// table.load(); -// }); -// -// -// } -// -// private List subList(List contacts) { -// return subList(contacts, 0, 15); -// } -// -// private List subList(List contacts, int from, int to) { -// return contacts.subList(from, to).stream().map(Contact::new).collect(Collectors.toList()); -// } -// -// @SampleMethod -// private void basicTable() { -// TableConfig tableConfig = new TableConfig<>(); -// tableConfig -// .addColumn(ColumnConfig.create("id", "#") -// .textAlign("right") -// .asHeader() -// .setCellRenderer(cell -> TextNode.of(cell.getTableRow().getRecord().getIndex() + 1 + ""))) -// -// .addColumn(ColumnConfig.create("status", "Status") -// .textAlign("center") -// .setCellRenderer(cell -> { -// if (cell.getTableRow().getRecord().isActive()) { -// return Style.of(Icons.check_circle()).setColor(Color.GREEN_DARKEN_3.getHex()).element(); -// } else { -// return Style.of(Icons.close_circle()).setColor(Color.RED_DARKEN_3.getHex()).element(); -// } -// })) -// .addColumn(ColumnConfig.create("firstName", "First name") -// .setCellRenderer(cell -> TextNode.of(cell.getTableRow().getRecord().getName()))) -// -// .addColumn(ColumnConfig.create("gender", "Gender") -// .setCellRenderer(cell -> ContactUiUtils.getGenderElement(cell.getRecord())) -// .textAlign("center")) -// -// .addColumn(ColumnConfig.create("eyeColor", "Eye color") -// .setCellRenderer(cell -> ContactUiUtils.getEyeColorElement(cell.getRecord())) -// .textAlign("center")) -// -// .addColumn(ColumnConfig.create("balance", "Balance") -// .setCellRenderer(cellInfo -> ContactUiUtils.getBalanceElement(cellInfo.getRecord()))) -// -// .addColumn(ColumnConfig.create("email", "Email") -// .setCellRenderer(cell -> TextNode.of(cell.getTableRow().getRecord().getEmail()))) -// -// .addColumn(ColumnConfig.create("phone", "Phone") -// .setCellRenderer(cell -> TextNode.of(cell.getTableRow().getRecord().getPhone()))) -// -// .addColumn(ColumnConfig.create("badges", "Badges") -// .setCellRenderer(cell -> { -// if (cell.getTableRow().getRecord().getAge() < 35) { -// return Badge.create("Young") -// .setBackground(ColorScheme.GREEN.color()).element(); -// } -// return TextNode.of(""); -// })); -// -// LocalListDataStore localListDataStore = new LocalListDataStore<>(); -// DataTable table = new DataTable<>(tableConfig, localListDataStore); -// -// element.appendChild(Card.create("BASIC TABLE", "By default a table will auto fit columns and allow custom cell content") -// .setCollapsible() -// .appendChild(new TableStyleActions(table)) -// .appendChild(table) -// .element()); -// -// contactListParseHandlers.add(contacts -> { -// localListDataStore.setData(subList(contacts)); -// table.load(); -// }); -// } -// -// @SampleMethod -// private void editableTable() { -// TableConfig tableConfig = new TableConfig<>(); -// tableConfig -// .addColumn(ColumnConfig.create("edit_save", "") -// .styleCell(element -> element.style.setProperty("vertical-align", "top")) -// .setCellRenderer(cell -> Icons.pencil() -// .clickable() -// .setTooltip("Edit") -// .addClickListener(evt -> cell.getTableRow().edit()) -// .element() -// ) -// .setEditableCellRenderer(cell -> Icons.content_save() -// .clickable() -// .setTooltip("Save") -// .addClickListener(evt -> { -// if (cell.getTableRow().validate().isValid()) { -// cell.getTableRow().save(); -// } -// }) -// .element()) -// ) -// .addColumn(ColumnConfig.create("id", "#") -// .styleCell(element -> { -// element.style.setProperty("vertical-align", "top"); -// }) -// .textAlign("right") -// .asHeader() -// .setCellRenderer(cell -> TextNode.of(cell.getTableRow().getRecord().getIndex() + 1 + "")) -// ) -// .addColumn(ColumnConfig.create("status", "Status") -// .styleCell(element -> { -// element.style.setProperty("vertical-align", "top"); -// }) -// .textAlign("center") -// .setCellRenderer(cell -> { -// if (cell.getTableRow().getRecord().isActive()) { -// return Style.of(Icons.check_circle()).setColor(Color.GREEN_DARKEN_3.getHex()).element(); -// } else { -// return Style.of(Icons.close_circle()).setColor(Color.RED_DARKEN_3.getHex()).element(); -// } -// }) -// .setEditableCellRenderer(cell -> { -// CheckBox activeCheckBox = CheckBox.create("") -// .setFieldStyle(FieldStyle.ROUNDED) -// .value(cell.getRecord().isActive()); -// cell.setDirtyRecordHandler(dirty -> dirty.setActive(activeCheckBox.getValue())); -// return activeCheckBox.element(); -// }) -// ) -// .addColumn(ColumnConfig.create("firstName", "First name") -// .styleCell(element -> { -// element.style.setProperty("vertical-align", "top"); -// }) -// .setCellRenderer(cell -> TextNode.of(cell.getTableRow().getRecord().getName())) -// .setEditableCellRenderer(cell -> { -// TextBox nameBox = TextBox.create() -// .setFieldStyle(FieldStyle.ROUNDED) -// .value(cell.getRecord().getName()); -// -// cell.setDirtyRecordHandler(dirty -> dirty.setName(nameBox.getValue())); -// return nameBox.element(); -// }) -// ) -// .addColumn(ColumnConfig.create("gender", "Gender") -// .styleCell(element -> { -// element.style.setProperty("vertical-align", "top"); -// }) -// .setCellRenderer(cell -> ContactUiUtils.getGenderElement(cell.getRecord())) -// .setEditableCellRenderer(cell -> { -// Select genderSelect = Select.create() -// .styler(style -> style.setMinWidth("100px")) -// .setFieldStyle(FieldStyle.ROUNDED) -// .appendChild(SelectOption.create(Gender.male, "Male", "Male")) -// .appendChild(SelectOption.create(Gender.female, "female", "female")) -// .value(cell.getRecord().getGender()); -// cell.setDirtyRecordHandler(dirty -> dirty.setGender(genderSelect.getValue())); -// return genderSelect.element(); -// }) -// .textAlign("center")) -// -// .addColumn(ColumnConfig.create("eyeColor", "Eye color") -// .styleCell(element -> { -// element.style.setProperty("vertical-align", "top"); -// }) -// .setCellRenderer(cell -> ContactUiUtils.getEyeColorElement(cell.getRecord())) -// .setEditableCellRenderer(cell -> { -// Select eyeColorSelect = Select.create() -// .setFieldStyle(FieldStyle.ROUNDED) -// .appendChild(SelectOption.create(EyeColor.blue, "Blue", "Blue")) -// .appendChild(SelectOption.create(EyeColor.brown, "Brown", "Brown")) -// .appendChild(SelectOption.create(EyeColor.green, "Green", "Green")) -// .value(cell.getRecord().getEyeColor()); -// cell.setDirtyRecordHandler(dirty -> dirty.setEyeColor(eyeColorSelect.getValue())); -// return eyeColorSelect.element(); -// }) -// .textAlign("center")) -// .addColumn(ColumnConfig.create("balance", "Balance") -// .styleCell(element -> { -// element.style.setProperty("vertical-align", "top"); -// }) -// .setCellRenderer(cell -> ContactUiUtils.getBalanceElement(cell.getRecord())) -// .setEditableCellRenderer(cell -> { -// DoubleBox doubleBox = DoubleBox.create() -// .setFieldStyle(FieldStyle.ROUNDED) -// .setMaxValue(4000.0) -// .value(cell.getRecord().getBalance()); -// cell.setDirtyRecordHandler(dirty -> dirty.setBalance(doubleBox.getValue().doubleValue())); -// cell.setCellValidator(doubleBox::validate); -// return doubleBox.element(); -// }) -// ) -// .addColumn(ColumnConfig.create("email", "Email") -// .styleCell(element -> { -// element.style.setProperty("vertical-align", "top"); -// }) -// .setCellRenderer(cell -> TextNode.of(cell.getTableRow().getRecord().getEmail())) -// .setEditableCellRenderer(cell -> { -// EmailBox emailBox = EmailBox.create() -// .setFieldStyle(FieldStyle.ROUNDED) -// .value(cell.getRecord().getEmail()); -// cell.setDirtyRecordHandler(dirty -> dirty.setEmail(emailBox.getValue())); -// return emailBox.element(); -// }) -// ) -// .addColumn(ColumnConfig.create("phone", "Phone") -// .styleCell(element -> { -// element.style.setProperty("vertical-align", "top"); -// }) -// .setCellRenderer(cell -> TextNode.of(cell.getTableRow().getRecord().getPhone())) -// .setEditableCellRenderer(cell -> { -// TelephoneBox telephoneBox = TelephoneBox.create() -// .setFieldStyle(FieldStyle.ROUNDED) -// .value(cell.getRecord().getPhone()); -// -// cell.setDirtyRecordHandler(dirty -> dirty.setPhone(telephoneBox.getValue())); -// return telephoneBox.element(); -// }) -// ) -// .addColumn(ColumnConfig.create("badges", "Badges") -// .styleCell(element -> { -// element.style.setProperty("vertical-align", "top"); -// }) -// .setCellRenderer(cell -> { -// if (cell.getTableRow().getRecord().getAge() < 35) { -// return Badge.create("Young") -// .setBackground(ColorScheme.GREEN.color()).element(); -// } -// return TextNode.of(""); -// }) -// ) -// .setDirtyRecordHandlers(Contact::new, (originalRecord, dirtyRecord) -> { -// originalRecord.setActive(dirtyRecord.isActive()); -// originalRecord.setPhone(dirtyRecord.getPhone()); -// originalRecord.setEmail(dirtyRecord.getEmail()); -// originalRecord.setBalance(dirtyRecord.getBalance()); -// originalRecord.setEyeColor(dirtyRecord.getEyeColor()); -// originalRecord.setGender(dirtyRecord.getGender()); -// originalRecord.setName(dirtyRecord.getName()); -// }); -// -// LocalListDataStore localListDataStore = new LocalListDataStore<>(); -// DataTable table = new DataTable<>(tableConfig, localListDataStore); -// -// element.appendChild(Card.create("EDITABLE TABLE", "Render cells as editable fields and save the row data.") -// .setCollapsible() -// .appendChild(new TableStyleActions(table)) -// .appendChild(table) -// .apply(self -> { -// self.appendChild(Button.create("readd").addClickListener(evt -> { -// self.getBody().clearElement(); -// DataTable newtable = new DataTable<>(tableConfig, localListDataStore); -// self.appendChild(newtable); -// })); -// }) -// -// .element()); -// -// contactListParseHandlers.add(contacts -> { -// localListDataStore.setData(subList(contacts)); -// }); -// } -// -// @SampleMethod -// private void basicFixedTable() { -// TableConfig tableConfig = new TableConfig<>(); -// tableConfig -// .setFixed(true) -// .addColumn(ColumnConfig.create("id", "#") -// .textAlign("right") -// .setCellRenderer(cell -> TextNode.of(cell.getTableRow().getRecord().getIndex() + 1 + ""))) -// -// .addColumn(ColumnConfig.create("status", "Status") -// .textAlign("center") -// .setCellRenderer(cell -> { -// if (cell.getTableRow().getRecord().isActive()) { -// return Style.of(Icons.check_circle()).setColor(Color.GREEN_DARKEN_3.getHex()).element(); -// } else { -// return Style.of(Icons.close_circle()).setColor(Color.RED_DARKEN_3.getHex()).element(); -// } -// })) -// .addColumn(ColumnConfig.create("firstName", "First name") -// .setWidth("200px") -// .setCellRenderer(cell -> TextNode.of(cell.getTableRow().getRecord().getName()))) -// -// .addColumn(ColumnConfig.create("gender", "Gender") -// .setCellRenderer(cell -> ContactUiUtils.getGenderElement(cell.getRecord())) -// .textAlign("center")) -// -// .addColumn(ColumnConfig.create("eyeColor", "Eye color") -// .setCellRenderer(cell -> ContactUiUtils.getEyeColorElement(cell.getRecord())) -// .textAlign("center")) -// -// .addColumn(ColumnConfig.create("balance", "Balance") -// .setWidth("250px") -// .setCellRenderer(cellInfo -> ContactUiUtils.getBalanceElement(cellInfo.getRecord()))) -// -// .addColumn(ColumnConfig.create("email", "Email") -// .setWidth("300px") -// .setCellRenderer(cell -> TextNode.of(cell.getTableRow().getRecord().getEmail()))) -// -// .addColumn(ColumnConfig.create("phone", "Phone") -// .setWidth("150px") -// .setCellRenderer(cell -> TextNode.of(cell.getTableRow().getRecord().getPhone()))) -// -// .addColumn(ColumnConfig.create("badges", "Badges") -// .setCellRenderer(cell -> { -// if (cell.getTableRow().getRecord().getAge() < 35) { -// return Badge.create("Young") -// .setBackground(ColorScheme.GREEN.color()).element(); -// } -// return TextNode.of(""); -// })) -// .addPlugin(new SortPlugin<>()) -// .addPlugin(ColumnLockPlugin.create(2)); -// LocalListDataStore localListDataStore = new LocalListDataStore<>(); -// DataTable defaultTable = new DataTable<>(tableConfig, localListDataStore); -// -// element.appendChild(Card.create("BASIC TABLE - FIXED", "Fixed tables will use the specified column width and will have scrolls when elements exceeds the body height. ") -// .setCollapsible() -// .appendChild(new TableStyleActions(defaultTable)) -// .appendChild(defaultTable) -// .apply(self -> { -// self.appendChild(Button.create("Redraw") -// .addClickListener(evt -> { -// self.remove(); -// basicFixedTable(); -// initData(); -// }) -// ); -// }) -// .element()); -// -// contactListParseHandlers.add(contacts -> { -// localListDataStore.setData(subList(contacts)); -// defaultTable.load(); -// }); -// -// -// } -// -// private List subList(List contacts, int size) { -// return subList(contacts, 0, size); -// } -// -// @SampleMethod -// private void singleSelectionPlugin() { -// TableConfig singleSelectionTableConfig = new TableConfig<>(); -// singleSelectionTableConfig -// .addColumn(ColumnConfig.create("id", "#") -// .textAlign("right") -// .asHeader() -// .setCellRenderer(cell1 -> TextNode.of(cell1.getTableRow().getRecord().getIndex() + 1 + ""))) -// -// .addColumn(ColumnConfig.create("status", "Status") -// .textAlign("center") -// .setCellRenderer(cell1 -> { -// if (cell1.getTableRow().getRecord().isActive()) { -// return Style.of(Icons.check_circle()).setColor(Color.GREEN_DARKEN_3.getHex()).element(); -// } else { -// return Style.of(Icons.close_circle()).setColor(Color.RED_DARKEN_3.getHex()).element(); -// } -// })) -// .addColumn(ColumnConfig.create("firstName", "First name") -// .setCellRenderer(cell1 -> TextNode.of(cell1.getTableRow().getRecord().getName()))) -// -// -// .addColumn(ColumnConfig.create("gender", "Gender") -// .setCellRenderer(cell1 -> ContactUiUtils.getGenderElement(cell1.getRecord())) -// .textAlign("center")) -// -// .addColumn(ColumnConfig.create("eyeColor", "Eye color") -// .setCellRenderer(cell1 -> ContactUiUtils.getEyeColorElement(cell1.getRecord())) -// .textAlign("center")) -// -// .addColumn(ColumnConfig.create("balance", "Balance") -// .setCellRenderer(cellInfo1 -> ContactUiUtils.getBalanceElement(cellInfo1.getRecord()))) -// -// .addColumn(ColumnConfig.create("email", "Email") -// .setCellRenderer(cell1 -> TextNode.of(cell1.getTableRow().getRecord().getEmail()))) -// -// .addColumn(ColumnConfig.create("phone", "Phone") -// .setCellRenderer(cell1 -> TextNode.of(cell1.getTableRow().getRecord().getPhone()))) -// -// .addColumn(ColumnConfig.create("badges", "Badges") -// .setCellRenderer(cell1 -> { -// if (cell1.getTableRow().getRecord().getAge() < 35) { -// return Badge.create("Young") -// .setBackground(ColorScheme.GREEN.color()).element(); -// } -// return TextNode.of(""); -// })); -// singleSelectionTableConfig.setMultiSelect(false); -// singleSelectionTableConfig.addPlugin(new SelectionPlugin<>(ColorScheme.LIGHT_BLUE)); -// LocalListDataStore singleLocalStore = new LocalListDataStore<>(); -// DataTable singleSelectionTable = new DataTable<>(singleSelectionTableConfig, singleLocalStore); -// singleSelectionTable.addSelectionListener((selectedTableRows, selectedRecords) -> { -// Notification.create(selectedRecords.size() + "").show(); -// }); -// -// element.appendChild(Card.create("SELECTION PLUGIN", "Enable row selection by adding the selection plugin, pass different selection style colors in the constructor.") -// .setCollapsible() -// .appendChild(BlockHeader.create("SINGLE SELECTION")) -// .appendChild(new TableStyleActions(singleSelectionTable)) -// .appendChild(singleSelectionTable.element()) -// .element()); -// -// contactListParseHandlers.add(contacts -> { -// singleLocalStore.setData(subList(contacts)); -// singleLocalStore.load(); -// }); -// -// -// } -// -// @SampleMethod -// private void multiSelectionPlugin() { -// -// TableConfig tableConfig = new TableConfig<>(); -// tableConfig -// .addColumn(ColumnConfig.create("id", "#") -// .textAlign("right") -// .asHeader() -// .setCellRenderer(cell -> TextNode.of(cell.getTableRow().getRecord().getIndex() + 1 + ""))) -// -// .addColumn(ColumnConfig.create("status", "Status") -// .textAlign("center") -// .setCellRenderer(cell -> { -// if (cell.getTableRow().getRecord().isActive()) { -// return Style.of(Icons.check_circle()).setColor(Color.GREEN_DARKEN_3.getHex()).element(); -// } else { -// return Style.of(Icons.close_circle()).setColor(Color.RED_DARKEN_3.getHex()).element(); -// } -// })) -// .addColumn(ColumnConfig.create("firstName", "First name") -// .setCellRenderer(cell -> TextNode.of(cell.getTableRow().getRecord().getName()))) -// -// -// .addColumn(ColumnConfig.create("gender", "Gender") -// .setCellRenderer(cell -> ContactUiUtils.getGenderElement(cell.getRecord())) -// .textAlign("center")) -// -// .addColumn(ColumnConfig.create("eyeColor", "Eye color") -// .setCellRenderer(cell -> ContactUiUtils.getEyeColorElement(cell.getRecord())) -// .textAlign("center")) -// -// .addColumn(ColumnConfig.create("balance", "Balance") -// .setCellRenderer(cellInfo -> ContactUiUtils.getBalanceElement(cellInfo.getRecord()))) -// -// .addColumn(ColumnConfig.create("email", "Email") -// .setCellRenderer(cell -> TextNode.of(cell.getTableRow().getRecord().getEmail()))) -// -// .addColumn(ColumnConfig.create("phone", "Phone") -// .setCellRenderer(cell -> TextNode.of(cell.getTableRow().getRecord().getPhone()))) -// -// .addColumn(ColumnConfig.create("badges", "Badges") -// .setCellRenderer(cell -> { -// if (cell.getTableRow().getRecord().getAge() < 35) { -// return Badge.create("Young") -// .setBackground(ColorScheme.GREEN.color()).element(); -// } -// return TextNode.of(""); -// })); -// tableConfig.addPlugin(new SelectionPlugin<>(ColorScheme.LIGHT_BLUE)); -// LocalListDataStore multiLocalStore = new LocalListDataStore<>(); -// DataTable multiSelectionTable = new DataTable<>(tableConfig, multiLocalStore); -// multiSelectionTable.addSelectionListener((selectedTableRows, selectedRecords) -> { -// Notification.create(selectedRecords.size() + "").show(); -// }); -// -// -// element.appendChild(Card.create("SELECTION PLUGIN", "Enable row selection by adding the selection plugin, pass different selection style colors in the constructor.") -// .setCollapsible() -// .appendChild(BlockHeader.create("MULTI SELECTION")) -// .appendChild(new TableStyleActions(multiSelectionTable)) -// .appendChild(multiSelectionTable) -// .element()); -// -// contactListParseHandlers.add(contacts -> { -// multiLocalStore.setData(subList(contacts)); -// multiSelectionTable.load(); -// }); -// -// -// } -// -// @SampleMethod -// private void markerPlugin() { -// TableConfig tableConfig = new TableConfig<>(); -// tableConfig -// .addColumn(ColumnConfig.create("id", "#") -// .textAlign("right") -// .asHeader() -// .setCellRenderer(cell -> TextNode.of(cell.getTableRow().getRecord().getIndex() + 1 + ""))) -// -// .addColumn(ColumnConfig.create("status", "Status") -// .textAlign("center") -// .setCellRenderer(cell -> { -// if (cell.getTableRow().getRecord().isActive()) { -// return Style.of(Icons.check_circle()).setColor(Color.GREEN_DARKEN_3.getHex()).element(); -// } else { -// return Style.of(Icons.close_circle()).setColor(Color.RED_DARKEN_3.getHex()).element(); -// } -// })) -// .addColumn(ColumnConfig.create("firstName", "First name") -// .setCellRenderer(cell -> TextNode.of(cell.getTableRow().getRecord().getName()))) -// -// -// .addColumn(ColumnConfig.create("gender", "Gender") -// .setCellRenderer(cell -> ContactUiUtils.getGenderElement(cell.getRecord())) -// .textAlign("center")) -// -// .addColumn(ColumnConfig.create("eyeColor", "Eye color") -// .setCellRenderer(cell -> ContactUiUtils.getEyeColorElement(cell.getRecord())) -// .textAlign("center")) -// -// .addColumn(ColumnConfig.create("balance", "Balance") -// .setCellRenderer(cellInfo -> ContactUiUtils.getBalanceElement(cellInfo.getRecord()))) -// -// .addColumn(ColumnConfig.create("email", "Email") -// .setCellRenderer(cell -> TextNode.of(cell.getTableRow().getRecord().getEmail()))) -// -// .addColumn(ColumnConfig.create("phone", "Phone") -// .setCellRenderer(cell -> TextNode.of(cell.getTableRow().getRecord().getPhone()))) -// -// .addColumn(ColumnConfig.create("badges", "Badges") -// .setCellRenderer(cell -> { -// if (cell.getTableRow().getRecord().getAge() < 35) { -// return Badge.create("Young") -// .setBackground(ColorScheme.GREEN.color()).element(); -// } -// return TextNode.of(""); -// })); -// -// tableConfig.addPlugin(new RowMarkerPlugin<>(tableCellInfo -> ContactUiUtils.getBalanceColor(tableCellInfo.getRecord()))); -// LocalListDataStore localListDataStore = new LocalListDataStore<>(); -// DataTable defaultTable = new DataTable<>(tableConfig, localListDataStore); -// -// element.appendChild(Card.create("MARKER PLUGIN", "Mark the left side of the row with custom colors") -// .setCollapsible() -// .appendChild(new TableStyleActions(defaultTable)) -// .appendChild(defaultTable) -// .element()); -// -// contactListParseHandlers.add(contacts -> { -// localListDataStore.setData(subList(contacts)); -// defaultTable.load(); -// }); -// -// } -// -// @SampleMethod -// private void recordDetailsPlugin() { -// TableConfig tableConfig = new TableConfig<>(); -// tableConfig -// .addColumn(ColumnConfig.create("id", "#") -// .textAlign("right") -// .asHeader() -// .setCellRenderer(cell1 -> TextNode.of(cell1.getTableRow().getRecord().getIndex() + 1 + ""))) -// -// .addColumn(ColumnConfig.create("status", "Status") -// .textAlign("center") -// .setCellRenderer(cell1 -> { -// if (cell1.getTableRow().getRecord().isActive()) { -// return Style.of(Icons.check_circle()).setColor(Color.GREEN_DARKEN_3.getHex()).element(); -// } else { -// return Style.of(Icons.close_circle()).setColor(Color.RED_DARKEN_3.getHex()).element(); -// } -// })) -// .addColumn(ColumnConfig.create("firstName", "First name") -// .setCellRenderer(cell1 -> TextNode.of(cell1.getTableRow().getRecord().getName()))) -// -// -// .addColumn(ColumnConfig.create("gender", "Gender") -// .setCellRenderer(cell1 -> ContactUiUtils.getGenderElement(cell1.getRecord())) -// .textAlign("center")) -// -// .addColumn(ColumnConfig.create("eyeColor", "Eye color") -// .setCellRenderer(cell1 -> ContactUiUtils.getEyeColorElement(cell1.getRecord())) -// .textAlign("center")) -// -// .addColumn(ColumnConfig.create("balance", "Balance") -// .setCellRenderer(cellInfo -> ContactUiUtils.getBalanceElement(cellInfo.getRecord()))) -// -// .addColumn(ColumnConfig.create("email", "Email") -// .setCellRenderer(cell1 -> TextNode.of(cell1.getTableRow().getRecord().getEmail()))) -// -// .addColumn(ColumnConfig.create("phone", "Phone") -// .setCellRenderer(cell1 -> TextNode.of(cell1.getTableRow().getRecord().getPhone()))) -// -// .addColumn(ColumnConfig.create("badges", "Badges") -// .setCellRenderer(cell1 -> { -// if (cell1.getTableRow().getRecord().getAge() < 35) { -// return Badge.create("Young") -// .setBackground(ColorScheme.GREEN.color()).element(); -// } -// return TextNode.of(""); -// })); -// -// tableConfig.addPlugin(new RecordDetailsPlugin<>(cell -> new ContactDetails(cell).element())); -// LocalListDataStore localListDataStore = new LocalListDataStore<>(); -// DataTable defaultTable = new DataTable<>(tableConfig, localListDataStore); -// -// element.appendChild(Card.create("RECORD DETAILS PLUGIN", "Enable inline record details for rows.") -// .setCollapsible() -// .appendChild(new TableStyleActions(defaultTable)) -// .appendChild(defaultTable) -// .element()); -// -// contactListParseHandlers.add(contacts -> { -// localListDataStore.setData(subList(contacts)); -// defaultTable.load(); -// }); -// -// -// } -// -// @SampleMethod -// private void tableHeaderBarPlugin() { -// TableConfig tableConfig = new TableConfig<>(); -// tableConfig -// .addColumn(ColumnConfig.create("id", "#") -// .textAlign("right") -// .asHeader() -// .setCellRenderer(cell -> TextNode.of(cell.getTableRow().getRecord().getIndex() + 1 + ""))) -// -// .addColumn(ColumnConfig.create("status", "Status") -// .textAlign("center") -// .setCellRenderer(cell -> { -// if (cell.getTableRow().getRecord().isActive()) { -// return Style.of(Icons.check_circle()).setColor(Color.GREEN_DARKEN_3.getHex()).element(); -// } else { -// return Style.of(Icons.close_circle()).setColor(Color.RED_DARKEN_3.getHex()).element(); -// } -// })) -// .addColumn(ColumnConfig.create("firstName", "First name") -// .setCellRenderer(cell -> TextNode.of(cell.getTableRow().getRecord().getName()))) -// -// -// .addColumn(ColumnConfig.create("gender", "Gender") -// .setCellRenderer(cell -> ContactUiUtils.getGenderElement(cell.getRecord())) -// .textAlign("center")) -// -// .addColumn(ColumnConfig.create("eyeColor", "Eye color") -// .setCellRenderer(cell -> ContactUiUtils.getEyeColorElement(cell.getRecord())) -// .textAlign("center")) -// -// .addColumn(ColumnConfig.create("balance", "Balance") -// .setCellRenderer(cellInfo -> ContactUiUtils.getBalanceElement(cellInfo.getRecord()))) -// -// .addColumn(ColumnConfig.create("email", "Email") -// .setCellRenderer(cell -> TextNode.of(cell.getTableRow().getRecord().getEmail()))) -// -// .addColumn(ColumnConfig.create("phone", "Phone") -// .setCellRenderer(cell -> TextNode.of(cell.getTableRow().getRecord().getPhone()))) -// -// .addColumn(ColumnConfig.create("badges", "Badges") -// .setCellRenderer(cell -> { -// if (cell.getTableRow().getRecord().getAge() < 35) { -// return Badge.create("Young") -// .setBackground(ColorScheme.GREEN.color()).element(); -// } -// return TextNode.of(""); -// })); -// -// tableConfig.addPlugin(new SelectionPlugin<>()); -// tableConfig.addPlugin(new HeaderBarPlugin("Demo table", "this a sample table with all features") -// .addActionElement(dataTable -> { -// MdiIcon selectInactiveIcon = Icons.close_circle() -// .clickable() -// .setTooltip("Select Inactive") -// .addClickListener(evt -> -// dataTable.getRows().forEach(item -> { -// if (!item.getRecord().isActive()) { -// item.select(); -// } else { -// item.deselect(); -// } -// })); -// -// return a().add(selectInactiveIcon).element(); -// }) -// .addActionElement(dataTable -> { -// MdiIcon selectInactiveIcon = Icons.check_circle() -// .clickable() -// .setTooltip("Select Active") -// .addClickListener(evt -> -// dataTable.getRows().forEach(tableRow -> { -// if (tableRow.getRecord().isActive()) { -// tableRow.select(); -// } else { -// tableRow.deselect(); -// } -// })); -// -// return a().add(selectInactiveIcon).element(); -// -// })); -// -// LocalListDataStore localListDataStore = new LocalListDataStore<>(); -// DataTable defaultTable = new DataTable<>(tableConfig, localListDataStore); -// -// element.appendChild(Card.create("HEADER BAR PLUGIN", "Adds a title and description for the table, and allow adding elements to the top right side of the table") -// .setCollapsible() -// .appendChild(new TableStyleActions(defaultTable)) -// .appendChild(defaultTable) -// .element()); -// -// contactListParseHandlers.add(contacts -> { -// localListDataStore.setData(subList(contacts)); -// defaultTable.load(); -// }); -// -// -// } -// -// @SampleMethod -// private void sortAndSearch() { -// TableConfig tableConfig = new TableConfig<>(); -// tableConfig -// .addColumn(ColumnConfig.create("id", "#") -// .textAlign("right") -// .asHeader() -// .sortable() -// .setCellRenderer(cell -> TextNode.of(cell.getTableRow().getRecord().getIndex() + 1 + ""))) -// -// .addColumn(ColumnConfig.create("status", "Status") -// .textAlign("center") -// .setCellRenderer(cell -> { -// if (cell.getTableRow().getRecord().isActive()) { -// return Style.of(Icons.check_circle()).setColor(Color.GREEN_DARKEN_3.getHex()).element(); -// } else { -// return Style.of(Icons.close_circle()).setColor(Color.RED_DARKEN_3.getHex()).element(); -// } -// })) -// .addColumn(ColumnConfig.create("firstName", "First name") -// .sortable() -// .setCellRenderer(cell -> TextNode.of(cell.getTableRow().getRecord().getName()))) -// -// -// .addColumn(ColumnConfig.create("gender", "Gender") -// .setCellRenderer(cell -> ContactUiUtils.getGenderElement(cell.getRecord())) -// .textAlign("center")) -// -// .addColumn(ColumnConfig.create("eyeColor", "Eye color") -// .setCellRenderer(cell -> ContactUiUtils.getEyeColorElement(cell.getRecord())) -// .textAlign("center")) -// -// .addColumn(ColumnConfig.create("balance", "Balance") -// .sortable() -// .setCellRenderer(cellInfo -> ContactUiUtils.getBalanceElement(cellInfo.getRecord()))) -// -// .addColumn(ColumnConfig.create("email", "Email") -// .setCellRenderer(cell -> TextNode.of(cell.getTableRow().getRecord().getEmail()))) -// -// .addColumn(ColumnConfig.create("phone", "Phone") -// .setCellRenderer(cell -> TextNode.of(cell.getTableRow().getRecord().getPhone()))) -// -// .addColumn(ColumnConfig.create("badges", "Badges") -// .setCellRenderer(cell -> { -// if (cell.getTableRow().getRecord().getAge() < 35) { -// return Badge.create("Young") -// .setBackground(ColorScheme.GREEN.color()).element(); -// } -// return TextNode.of(""); -// })); -// -// ColumnHeaderFilterPlugin contactColumnHeaderFilterPlugin = ColumnHeaderFilterPlugin.create(); -// tableConfig -// .addPlugin(new SortPlugin<>()) -// .addPlugin(new HeaderBarPlugin("Demo table", "this a sample table with all features") -// .addActionElement(new HeaderBarPlugin.ClearSearch<>()) -// .addActionElement(new HeaderBarPlugin.SearchTableAction<>()) -// .addActionElement(dataTable -> Icons.filter_menu_outline() -// .clickable() -// .addClickListener(evt -> contactColumnHeaderFilterPlugin.getFiltersRowElement() -// .toggleDisplay()) -// .element()) -// ) -// .addPlugin(contactColumnHeaderFilterPlugin -// .addHeaderFilter("firstName", TextHeaderFilter.create()) -// .addHeaderFilter("email", TextHeaderFilter.create()) -// .addHeaderFilter("phone", TextHeaderFilter.create()) -// .addHeaderFilter("status", BooleanHeaderFilter.create("Active", "Inactive", "Both")) -// .addHeaderFilter("gender", EnumHeaderFilter.create(Gender.values())) -// .addHeaderFilter("balance", DoubleHeaderFilter.create()) -// .addHeaderFilter("eyeColor", SelectHeaderFilter.create() -// .appendChild(SelectOption.create("blue", "Blue")) -// .appendChild(SelectOption.create("brown", "Brown")) -// .appendChild(SelectOption.create("green", "Green")) -// ) -// ); -// LocalListDataStore listStore = new LocalListDataStore<>(); -// listStore.setRecordsSorter(new ContactSorter()); -// listStore.setSearchFilter(new ContactSearchFilter()); -// DataTable table = new DataTable<>(tableConfig, listStore); -// -// element.appendChild(Card.create("SORT PLUGIN & SEARCH HEADER ACTION", "Allows the table to fire events useful for datasource to sort and search the data") -// .setCollapsible() -// .appendChild(new TableStyleActions(table)) -// .appendChild(table) -// .element()); -// -// contactListParseHandlers.add(contacts -> { -// listStore.setData(subList(contacts)); -// table.load(); -// }); -// } -// -// @SampleMethod -// private void simplePagination() { -// SimplePaginationPlugin simplePaginationPlugin = new SimplePaginationPlugin<>(10);//page size -// TableConfig tableConfig = new TableConfig<>(); -// tableConfig -// .addColumn(ColumnConfig.create("id", "#") -// .textAlign("right") -// .asHeader() -// .sortable() -// .setCellRenderer(cell -> TextNode.of(cell.getTableRow().getRecord().getIndex() + 1 + ""))) -// -// .addColumn(ColumnConfig.create("status", "Status") -// .textAlign("center") -// .setCellRenderer(cell -> { -// if (cell.getTableRow().getRecord().isActive()) { -// return Style.of(Icons.check_circle()).setColor(Color.GREEN_DARKEN_3.getHex()).element(); -// } else { -// return Style.of(Icons.close_circle()).setColor(Color.RED_DARKEN_3.getHex()).element(); -// } -// })) -// .addColumn(ColumnConfig.create("firstName", "First name") -// .sortable() -// .setCellRenderer(cell -> TextNode.of(cell.getTableRow().getRecord().getName()))) -// -// -// .addColumn(ColumnConfig.create("gender", "Gender") -// .setCellRenderer(cell -> ContactUiUtils.getGenderElement(cell.getRecord())) -// .textAlign("center")) -// -// .addColumn(ColumnConfig.create("eyeColor", "Eye color") -// .setCellRenderer(cell -> ContactUiUtils.getEyeColorElement(cell.getRecord())) -// .textAlign("center")) -// -// .addColumn(ColumnConfig.create("balance", "Balance") -// .sortable() -// .setCellRenderer(cellInfo -> ContactUiUtils.getBalanceElement(cellInfo.getRecord()))) -// -// .addColumn(ColumnConfig.create("email", "Email") -// .setCellRenderer(cell -> TextNode.of(cell.getTableRow().getRecord().getEmail()))) -// -// .addColumn(ColumnConfig.create("phone", "Phone") -// .setCellRenderer(cell -> TextNode.of(cell.getTableRow().getRecord().getPhone()))) -// -// .addColumn(ColumnConfig.create("badges", "Badges") -// .setCellRenderer(cell -> { -// if (cell.getTableRow().getRecord().getAge() < 35) { -// return Badge.create("Young") -// .setBackground(ColorScheme.GREEN.color()).element(); -// } -// return TextNode.of(""); -// })); -// -// tableConfig -// .addPlugin(new SortPlugin<>()) -// .addPlugin(new HeaderBarPlugin("Demo table", "this a sample table with all features") -// .addActionElement(new HeaderBarPlugin.ClearSearch<>()) -// .addActionElement(new HeaderBarPlugin.SearchTableAction<>()) -// ) -// .addPlugin(simplePaginationPlugin); -// -// LocalListDataStore localListDataStore = new LocalListDataStore<>(); -// localListDataStore.setRecordsSorter(new ContactSorter()); -// localListDataStore.setSearchFilter(new ContactSearchFilter()); -// localListDataStore.setPagination(simplePaginationPlugin.getSimplePagination()); -// DataTable table = new DataTable<>(tableConfig, localListDataStore); -// -// element.appendChild(Card.create("SIMPLE PAGINATION", "Simple pagination plugin allows the table to fire pagination events helpful for the datasource") -// .setCollapsible() -// .appendChild(new TableStyleActions(table)) -// .appendChild(table) -// .element()); -// -// contactListParseHandlers.add(contacts -> { -// localListDataStore.setData(subList(contacts, 0, 100)); -// table.load(); -// }); -// -// -// } -// -// @SampleMethod -// private void scrollingPagination() { -// ScrollingPaginationPlugin scrollingPagination = new ScrollingPaginationPlugin<>(10, 5);//page size -// TableConfig tableConfig = new TableConfig<>(); -// tableConfig -// .addColumn(ColumnConfig.create("id", "#") -// .textAlign("right") -// .asHeader() -// .sortable() -// .setCellRenderer(cell -> TextNode.of(cell.getTableRow().getRecord().getIndex() + 1 + ""))) -// -// .addColumn(ColumnConfig.create("status", "Status") -// .textAlign("center") -// .setCellRenderer(cell -> { -// if (cell.getTableRow().getRecord().isActive()) { -// return Style.of(Icons.check_circle()).setColor(Color.GREEN_DARKEN_3.getHex()).element(); -// } else { -// return Style.of(Icons.close_circle()).setColor(Color.RED_DARKEN_3.getHex()).element(); -// } -// })) -// .addColumn(ColumnConfig.create("firstName", "First name") -// .sortable() -// .setCellRenderer(cell -> TextNode.of(cell.getTableRow().getRecord().getName()))) -// -// -// .addColumn(ColumnConfig.create("gender", "Gender") -// .setCellRenderer(cell -> ContactUiUtils.getGenderElement(cell.getRecord())) -// .textAlign("center")) -// -// .addColumn(ColumnConfig.create("eyeColor", "Eye color") -// .setCellRenderer(cell -> ContactUiUtils.getEyeColorElement(cell.getRecord())) -// .textAlign("center")) -// -// .addColumn(ColumnConfig.create("balance", "Balance") -// .sortable() -// .setCellRenderer(cellInfo -> ContactUiUtils.getBalanceElement(cellInfo.getRecord()))) -// -// .addColumn(ColumnConfig.create("email", "Email") -// .setCellRenderer(cell -> TextNode.of(cell.getTableRow().getRecord().getEmail()))) -// -// .addColumn(ColumnConfig.create("phone", "Phone") -// .setCellRenderer(cell -> TextNode.of(cell.getTableRow().getRecord().getPhone()))) -// -// .addColumn(ColumnConfig.create("badges", "Badges") -// .setCellRenderer(cell -> { -// if (cell.getTableRow().getRecord().getAge() < 35) { -// return Badge.create("Young") -// .setBackground(ColorScheme.GREEN.color()).element(); -// } -// return TextNode.of(""); -// })); -// -// tableConfig -// .addPlugin(new SortPlugin<>()) -// .addPlugin(new HeaderBarPlugin("Demo table", "this a sample table with all features") -// .addActionElement(new HeaderBarPlugin.ClearSearch<>()) -// .addActionElement(new HeaderBarPlugin.SearchTableAction<>()) -// ) -// .addPlugin(scrollingPagination); -// -// LocalListDataStore localListDataStore = new LocalListDataStore<>(); -// localListDataStore.setRecordsSorter(new ContactSorter()); -// localListDataStore.setSearchFilter(new ContactSearchFilter()); -// localListDataStore.setPagination(scrollingPagination.getPagination()); -// DataTable table = new DataTable<>(tableConfig, localListDataStore); -// -// element.appendChild(Card.create("SCROLLING PAGINATION", "Scrolling pagination plugin allows navigation through a set of page at a time in datatable") -// .setCollapsible() -// .appendChild(new TableStyleActions(table)) -// .appendChild(table) -// .element()); -// -// contactListParseHandlers.add(contacts -> { -// localListDataStore.setData(subList(contacts, 0, 100)); -// table.load(); -// }); -// -// -// } -// -// @SampleMethod -// private void advancedPagination() { -// AdvancedPaginationPlugin advancedPagination = new AdvancedPaginationPlugin<>(10);//page size -// TableConfig tableConfig = new TableConfig<>(); -// tableConfig -// .addColumn(ColumnConfig.create("id", "#") -// .textAlign("right") -// .asHeader() -// .sortable() -// .setCellRenderer(cell -> TextNode.of(cell.getTableRow().getRecord().getIndex() + 1 + ""))) -// -// .addColumn(ColumnConfig.create("status", "Status") -// .textAlign("center") -// .setCellRenderer(cell -> { -// if (cell.getTableRow().getRecord().isActive()) { -// return Style.of(Icons.check_circle()).setColor(Color.GREEN_DARKEN_3.getHex()).element(); -// } else { -// return Style.of(Icons.close_circle()).setColor(Color.RED_DARKEN_3.getHex()).element(); -// } -// })) -// .addColumn(ColumnConfig.create("firstName", "First name") -// .sortable() -// .setCellRenderer(cell -> TextNode.of(cell.getTableRow().getRecord().getName()))) -// -// -// .addColumn(ColumnConfig.create("gender", "Gender") -// .setCellRenderer(cell -> ContactUiUtils.getGenderElement(cell.getRecord())) -// .textAlign("center")) -// -// .addColumn(ColumnConfig.create("eyeColor", "Eye color") -// .setCellRenderer(cell -> ContactUiUtils.getEyeColorElement(cell.getRecord())) -// .textAlign("center")) -// -// .addColumn(ColumnConfig.create("balance", "Balance") -// .sortable() -// .setCellRenderer(cellInfo -> ContactUiUtils.getBalanceElement(cellInfo.getRecord()))) -// -// .addColumn(ColumnConfig.create("email", "Email") -// .setCellRenderer(cell -> TextNode.of(cell.getTableRow().getRecord().getEmail()))) -// -// .addColumn(ColumnConfig.create("phone", "Phone") -// .setCellRenderer(cell -> TextNode.of(cell.getTableRow().getRecord().getPhone()))) -// -// .addColumn(ColumnConfig.create("badges", "Badges") -// .setCellRenderer(cell -> { -// if (cell.getTableRow().getRecord().getAge() < 35) { -// return Badge.create("Young") -// .setBackground(ColorScheme.GREEN.color()).element(); -// } -// return TextNode.of(""); -// })); -// -// tableConfig -// .addPlugin(new SortPlugin<>()) -// .addPlugin(new HeaderBarPlugin("Demo table", "this a sample table with all features") -// .addActionElement(new HeaderBarPlugin.ClearSearch<>()) -// .addActionElement(new HeaderBarPlugin.SearchTableAction<>()) -// ) -// .addPlugin(advancedPagination); -// -// LocalListDataStore localListDataStore = new LocalListDataStore<>(); -// localListDataStore.setRecordsSorter(new ContactSorter()); -// localListDataStore.setSearchFilter(new ContactSearchFilter()); -// localListDataStore.setPagination(advancedPagination.getPagination()); -// DataTable table = new DataTable<>(tableConfig, localListDataStore); -// -// element.appendChild(Card.create("ADVANCED PAGINATION", "Advanced pagination plugin allows navigation through pages from a dropdown list") -// .setCollapsible() -// .appendChild(new TableStyleActions(table)) -// .appendChild(table) -// .element()); -// -// contactListParseHandlers.add(contacts -> { -// localListDataStore.setData(subList(contacts, 0, 100)); -// table.load(); -// }); -// -// -// } -// -// @SampleMethod -// private void scrollableTable() { -// -// TableConfig tableConfig = new TableConfig<>(); -// tableConfig -// .setFixed(true) -// .addColumn(ColumnConfig.create("id", "#") -// .sortable() -// .styleCell(cellElement -> Style.of(cellElement).setCssProperty("vertical-align", "middle")) -// .textAlign("right") -// .asHeader() -// .setCellRenderer(cell -> TextNode.of(cell.getTableRow().getRecord().getIndex() + 1 + ""))) -// .addColumn(ColumnConfig.create("status", "Status") -// .textAlign("center") -// .setCellRenderer(cell -> { -// if (cell.getTableRow().getRecord().isActive()) { -// return Style.of(Icons.check_circle()).setColor(Color.GREEN_DARKEN_3.getHex()).element(); -// } else { -// return Style.of(Icons.close_circle()).setColor(Color.RED_DARKEN_3.getHex()).element(); -// } -// })) -// .addColumn(ColumnConfig.create("firstName", "First name") -// .sortable() -// .setCellRenderer(cell -> TextNode.of(cell.getTableRow().getRecord().getName())) -// .setWidth("200px")) -// .addColumn(ColumnConfig.create("gender", "Gender") -// .setCellRenderer(cell -> ContactUiUtils.getGenderElement(cell.getRecord())) -// .textAlign("center")) -// .addColumn(ColumnConfig.create("eyeColor", "Eye color") -// .styleHeader(head -> Style.of(head).setWidth("100px")) -// .setCellRenderer(cell -> ContactUiUtils.getEyeColorElement(cell.getRecord())) -// .textAlign("center")) -// .addColumn(ColumnConfig.create("balance", "Balance") -// .sortable() -// .setCellRenderer(cellInfo -> ContactUiUtils.getBalanceElement(cellInfo.getRecord())) -// .setWidth("250px")) -// .addColumn(ColumnConfig.create("email", "Email") -// .setWidth("250px") -// .setCellRenderer(cell -> TextNode.of(cell.getTableRow().getRecord().getEmail()))) -// .addColumn(ColumnConfig.create("phone", "Phone") -// .setWidth("150px") -// .setCellRenderer(cell -> TextNode.of(cell.getTableRow().getRecord().getPhone()))) -// .addColumn(ColumnConfig.create("badges", "Badges") -// .setCellRenderer(cell -> { -// if (cell.getTableRow().getRecord().getAge() < 35) { -// return Badge.create("Young") -// .setBackground(ColorScheme.GREEN.color()).element(); -// } -// return TextNode.of(""); -// })) -// .addPlugin(new BodyScrollPlugin<>()) -// .addPlugin(new HeaderBarPlugin("Demo table", "this a sample table with all features") -// .addActionElement(new HeaderBarPlugin.SearchTableAction<>()) -// ) -// -// .addPlugin(new SortPlugin<>()); -// -// LocalListScrollingDataSource scrollingDataSource = new LocalListScrollingDataSource(10) -// .setSearchFilter(new ContactSearchFilter()) -// .setRecordsSorter(new ContactSorter()); -// -// DataTable table = new DataTable<>(tableConfig, scrollingDataSource); -// -// element.appendChild(Card.create("SCROLL LOADING", "Scroll loading requires the table to be fixed. use the Body scroll plugin to fire scroll events.") -// .setCollapsible() -// .appendChild(new TableStyleActions(table)) -// .appendChild(table) -// .element()); -// -// contactListParseHandlers.add(contacts -> { -// scrollingDataSource.setData(contacts.subList(0, 100)); -// table.load(); -// }); -// -// -// } -// -// @SampleMethod -// private void topPanelPlugin() { -// ContactsTopPanel topPanel = new ContactsTopPanel<>(); -// TableConfig tableConfig = new TableConfig<>(); -// tableConfig -// .setFixed(true) -// .addColumn(ColumnConfig.create("id", "#") -// .sortable() -// .styleCell(cellElement -> Style.of(cellElement).setCssProperty("vertical-align", "middle")) -// .textAlign("right") -// .asHeader() -// .setCellRenderer(cell -> TextNode.of(cell.getTableRow().getRecord().getIndex() + 1 + ""))) -// .addColumn(ColumnConfig.create("status", "Status") -// .textAlign("center") -// .setCellRenderer(cell -> { -// if (cell.getTableRow().getRecord().isActive()) { -// return Style.of(Icons.check_circle().element()).setColor(Color.GREEN_DARKEN_3.getHex()).element(); -// } else { -// return Style.of(Icons.close_circle().element()).setColor(Color.RED_DARKEN_3.getHex()).element(); -// } -// })) -// .addColumn(ColumnConfig.create("firstName", "First name") -// .sortable() -// .setCellRenderer(cell -> TextNode.of(cell.getTableRow().getRecord().getName())) -// .setWidth("200px")) -// .addColumn(ColumnConfig.create("gender", "Gender") -// .setCellRenderer(cell -> ContactUiUtils.getGenderElement(cell.getRecord())) -// .textAlign("center")) -// .addColumn(ColumnConfig.create("eyeColor", "Eye color") -// .styleHeader(head -> Style.of(head).setWidth("100px")) -// .setCellRenderer(cell -> ContactUiUtils.getEyeColorElement(cell.getRecord())) -// .textAlign("center")) -// .addColumn(ColumnConfig.create("balance", "Balance") -// .sortable() -// .setCellRenderer(cellInfo -> ContactUiUtils.getBalanceElement(cellInfo.getRecord())) -// .setWidth("250px")) -// .addColumn(ColumnConfig.create("email", "Email") -// .setWidth("300px") -// .setCellRenderer(cell -> TextNode.of(cell.getTableRow().getRecord().getEmail()))) -// .addColumn(ColumnConfig.create("phone", "Phone") -// .setWidth("150px") -// .setCellRenderer(cell -> TextNode.of(cell.getTableRow().getRecord().getPhone()))) -// .addColumn(ColumnConfig.create("badges", "Badges") -// .setCellRenderer(cell -> { -// if (cell.getTableRow().getRecord().getAge() < 35) { -// return Badge.create("Young") -// .setBackground(ColorScheme.GREEN.color()).element(); -// } -// return TextNode.of(""); -// })) -// .addPlugin(new BodyScrollPlugin<>()) -// .addPlugin(new TopPanelPlugin() { -// -// @Override -// public HTMLElement element() { -// return topPanel.element(); -// } -// -// @Override -// public void handleEvent(TableEvent event) { -// if (TableDataUpdatedEvent.DATA_UPDATED.equals(event.getType())) { -// topPanel.update((TableDataUpdatedEvent) event); -// } -// } -// }) -// .addPlugin(new HeaderBarPlugin("Demo table", "this a sample table with all features") -// .addActionElement(new HeaderBarPlugin.SearchTableAction<>()) -// ) -// -// .addPlugin(new SortPlugin<>()); -// -// LocalListScrollingDataSource scrollingDataSource = new LocalListScrollingDataSource(10) -// .setSearchFilter(new ContactSearchFilter()) -// .setRecordsSorter(new ContactSorter()); -// -// DataTable table = new DataTable<>(tableConfig, scrollingDataSource); -// -// element.appendChild(Card.create("TOP PANEL PLUGIN", "A simple panel that listens to datatable events and update its content accordingly.") -// .setCollapsible() -// .appendChild(new TableStyleActions(table)) -// .appendChild(table) -// .element()); -// -// contactListParseHandlers.add(contacts -> { -// List data = subList(contacts, 0, 100); -// scrollingDataSource.setData(data); -// table.load(); -// topPanel.update(data); -// }); -// -// -// } -// -// @SampleMethod -// private void allInOne() { -// ContactsTopPanel topPanel = new ContactsTopPanel<>(); -// ScrollingPaginationPlugin scrollingPaginationPlugin = new ScrollingPaginationPlugin<>(10, 5); -// TableConfig tableConfig = new TableConfig<>(); -// tableConfig -// .addColumn(ColumnConfig.create("id", "#") -// .sortable() -// .styleCell(cellElement -> Style.of(cellElement).setCssProperty("vertical-align", "middle")) -// .textAlign("right") -// .asHeader() -// .setCellRenderer(cell -> TextNode.of(cell.getTableRow().getRecord().getIndex() + 1 + "")) -// .setWidth("70px")) -// .addColumn(ColumnConfig.create("status", "Status") -// .setWidth("80px") -// .textAlign("center") -// .setCellRenderer(cell -> { -// if (cell.getTableRow().getRecord().isActive()) { -// return Style.of(Icons.check_circle().element()).setColor(Color.GREEN_DARKEN_3.getHex()).element(); -// } else { -// return Style.of(Icons.close_circle().element()).setColor(Color.RED_DARKEN_3.getHex()).element(); -// } -// })) -// .addColumn(ColumnConfig.create("firstName", "First name") -// .sortable() -// .setCellRenderer(cell -> TextNode.of(cell.getTableRow().getRecord().getName())) -// .setWidth("200px")) -// .addColumn(ColumnConfig.create("gender", "Gender") -// .setWidth("100px") -// .setCellRenderer(cell -> ContactUiUtils.getGenderElement(cell.getRecord())) -// .textAlign("center")) -// .addColumn(ColumnConfig.create("eyeColor", "Eye color") -// .styleHeader(head -> Style.of(head).setWidth("100px")) -// .setCellRenderer(cell -> ContactUiUtils.getEyeColorElement(cell.getRecord())) -// .textAlign("center") -// .maxWidth("120px")) -// .addColumn(ColumnConfig.create("balance", "Balance") -// .sortable() -// .setCellRenderer(cellInfo -> ContactUiUtils.getBalanceElement(cellInfo.getRecord())) -// .setWidth("200px")) -// .addColumn(ColumnConfig.create("email", "Email") -// .setWidth("250px") -// .setCellRenderer(cell -> TextNode.of(cell.getTableRow().getRecord().getEmail()))) -// .addColumn(ColumnConfig.create("phone", "Phone") -// .setWidth("200px") -// .setCellRenderer(cell -> TextNode.of(cell.getTableRow().getRecord().getPhone()))) -// .addColumn(ColumnConfig.create("badges", "Badges") -// .setCellRenderer(cell -> { -// if (cell.getTableRow().getRecord().getAge() < 35) { -// return Badge.create("Young") -// .setBackground(ColorScheme.GREEN.color()).element(); -// } -// return TextNode.of(""); -// })) -// .addPlugin(scrollingPaginationPlugin) -// .addPlugin(new TopPanelPlugin() { -// -// @Override -// public HTMLElement element() { -// return topPanel.element(); -// } -// -// @Override -// public void handleEvent(TableEvent event) { -// if (TableDataUpdatedEvent.DATA_UPDATED.equals(event.getType())) { -// topPanel.update((TableDataUpdatedEvent) event); -// } -// } -// }) -// .addPlugin(new HeaderBarPlugin("Demo table", "this a sample table with all features") -// .addActionElement(dataTable -> { -// MdiIcon selectInactiveIcon = Icons.close_circle() -// .clickable() -// .setTooltip("Select Inactive") -// .addClickListener(evt -> -// dataTable.getRows().forEach(item -> { -// if (!item.getRecord().isActive()) { -// item.select(); -// } else { -// item.deselect(); -// } -// })); -// -// return a().add(selectInactiveIcon).element(); -// }) -// .addActionElement(dataTable -> { -// MdiIcon selectInactiveIcon = Icons.check_circle() -// .clickable() -// .setTooltip("Select Active") -// .addClickListener(evt -> -// dataTable.getRows().forEach(tableRow -> { -// if (tableRow.getRecord().isActive()) { -// tableRow.select(); -// } else { -// tableRow.deselect(); -// } -// })); -// -// return a().add(selectInactiveIcon).element(); -// -// }) -// .addActionElement(new HeaderBarPlugin.ClearSearch<>()) -// .addActionElement(new HeaderBarPlugin.SearchTableAction<>()) -// .addActionElement(new HeaderBarPlugin.ShowHideColumnsAction<>()) -// ) -// .addPlugin(new RecordDetailsPlugin<>(cell -> new ContactDetails(cell).element())) -// .addPlugin(new SelectionPlugin<>(ColorScheme.BLUE)) -// .addPlugin(new RowMarkerPlugin<>(cellInfo -> ContactUiUtils.getBalanceColor(cellInfo.getRecord()))) -// .addPlugin(new SortPlugin<>()) -// .addPlugin(ColumnHeaderFilterPlugin.create() -// .addHeaderFilter("firstName", TextHeaderFilter.create()) -// .addHeaderFilter("email", TextHeaderFilter.create()) -// .addHeaderFilter("phone", TextHeaderFilter.create()) -// .addHeaderFilter("status", BooleanHeaderFilter.create("Active", "Inactive", "Both")) -// .addHeaderFilter("gender", EnumHeaderFilter.create(Gender.values())) -// .addHeaderFilter("balance", DoubleHeaderFilter.create()) -// .addHeaderFilter("eyeColor", SelectHeaderFilter.create() -// .appendChild(SelectOption.create("blue", "Blue")) -// .appendChild(SelectOption.create("brown", "Brown")) -// .appendChild(SelectOption.create("green", "Green")) -// ) -// ) -// .addPlugin(new GroupingPlugin<>(tableRow -> tableRow.getRecord().getGender().toString(), -// cellInfo -> { -// DominoElement.of(cellInfo.getElement()) -// .style() -// .setCssProperty("border-bottom", "1px solid #afafaf") -// .setPadding(px.of(5)) -// .addCss(ColorScheme.INDIGO.lighten_5().getBackground()); -// return TextNode.of(cellInfo.getRecord().getGender().getLabel()); -// })); -// -// LocalListDataStore localListDataSource = new LocalListDataStore() -// .setSearchFilter(new ContactSearchFilter()) -// .setRecordsSorter(new ContactSorter()) -// .setPagination(scrollingPaginationPlugin.getPagination()); -// -// DataTable table = new DataTable<>(tableConfig, localListDataSource); -// -// element.appendChild(Card.create("ALL IN ONE", "Try all plugins and feature works together.") -// .setCollapsible() -// .appendChild(new TableStyleActions(table)) -// .appendChild(table) -// .element()); -// -// contactListParseHandlers.add(contacts -> { -// List data = subList(contacts, 0, 100); -// localListDataSource.setData(data); -// table.load(); -// topPanel.update(data); -// }); -// -// -// } -// -// public interface ContactListParseHandler { -// void onContactsParsed(List contacts); -// } -} diff --git a/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/DragAndDropPluginViewImpl.java b/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/DragAndDropPluginViewImpl.java index ebbf9039..5fe250ef 100644 --- a/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/DragAndDropPluginViewImpl.java +++ b/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/DragAndDropPluginViewImpl.java @@ -1,6 +1,7 @@ package org.dominokit.domino.datatable.client.views.ui; import elemental2.dom.HTMLDivElement; +import static org.dominokit.domino.ui.utils.Domino.*; import org.dominokit.domino.SampleClass; import org.dominokit.domino.SampleMethod; import org.dominokit.domino.api.client.annotations.UiView; diff --git a/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/EditableDataTableViewImpl.java b/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/EditableDataTableViewImpl.java index a31fc527..5862dcab 100644 --- a/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/EditableDataTableViewImpl.java +++ b/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/EditableDataTableViewImpl.java @@ -1,6 +1,7 @@ package org.dominokit.domino.datatable.client.views.ui; import elemental2.dom.HTMLDivElement; +import static org.dominokit.domino.ui.utils.Domino.*; import org.dominokit.domino.SampleClass; import org.dominokit.domino.SampleMethod; import org.dominokit.domino.api.client.annotations.UiView; diff --git a/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/EmptyStatePluginViewImpl.java b/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/EmptyStatePluginViewImpl.java index f8c61171..efcdc009 100644 --- a/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/EmptyStatePluginViewImpl.java +++ b/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/EmptyStatePluginViewImpl.java @@ -1,6 +1,7 @@ package org.dominokit.domino.datatable.client.views.ui; import elemental2.dom.HTMLDivElement; +import static org.dominokit.domino.ui.utils.Domino.*; import org.dominokit.domino.SampleClass; import org.dominokit.domino.SampleMethod; import org.dominokit.domino.api.client.annotations.UiView; diff --git a/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/FixedDataTableViewImpl.java b/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/FixedDataTableViewImpl.java index fa494a1b..2357c106 100644 --- a/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/FixedDataTableViewImpl.java +++ b/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/FixedDataTableViewImpl.java @@ -1,6 +1,7 @@ package org.dominokit.domino.datatable.client.views.ui; import elemental2.dom.HTMLDivElement; +import static org.dominokit.domino.ui.utils.Domino.*; import org.dominokit.domino.SampleClass; import org.dominokit.domino.SampleMethod; import org.dominokit.domino.api.client.annotations.UiView; diff --git a/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/GroupingPluginViewImpl.java b/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/GroupingPluginViewImpl.java index bea2e310..88018145 100644 --- a/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/GroupingPluginViewImpl.java +++ b/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/GroupingPluginViewImpl.java @@ -1,6 +1,7 @@ package org.dominokit.domino.datatable.client.views.ui; import elemental2.dom.HTMLDivElement; +import static org.dominokit.domino.ui.utils.Domino.*; import org.dominokit.domino.SampleClass; import org.dominokit.domino.SampleMethod; import org.dominokit.domino.api.client.annotations.UiView; diff --git a/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/HeaderBarPluginViewImpl.java b/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/HeaderBarPluginViewImpl.java index d1aced8d..081ae8f0 100644 --- a/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/HeaderBarPluginViewImpl.java +++ b/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/HeaderBarPluginViewImpl.java @@ -1,6 +1,7 @@ package org.dominokit.domino.datatable.client.views.ui; import elemental2.dom.HTMLDivElement; +import static org.dominokit.domino.ui.utils.Domino.*; import org.dominokit.domino.SampleClass; import org.dominokit.domino.SampleMethod; import org.dominokit.domino.api.client.annotations.UiView; diff --git a/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/MarkerPluginViewImpl.java b/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/MarkerPluginViewImpl.java index 180705c2..147332d6 100644 --- a/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/MarkerPluginViewImpl.java +++ b/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/MarkerPluginViewImpl.java @@ -1,6 +1,7 @@ package org.dominokit.domino.datatable.client.views.ui; import elemental2.dom.HTMLDivElement; +import static org.dominokit.domino.ui.utils.Domino.*; import org.dominokit.domino.SampleClass; import org.dominokit.domino.SampleMethod; import org.dominokit.domino.api.client.annotations.UiView; diff --git a/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/PaginationPluginViewImpl.java b/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/PaginationPluginViewImpl.java index ea333101..e42d3a73 100644 --- a/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/PaginationPluginViewImpl.java +++ b/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/PaginationPluginViewImpl.java @@ -1,6 +1,7 @@ package org.dominokit.domino.datatable.client.views.ui; import elemental2.dom.HTMLDivElement; +import static org.dominokit.domino.ui.utils.Domino.*; import org.dominokit.domino.SampleClass; import org.dominokit.domino.SampleMethod; import org.dominokit.domino.api.client.annotations.UiView; diff --git a/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/PinColumnsPluginViewImpl.java b/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/PinColumnsPluginViewImpl.java index cc1ac0bc..e87be733 100644 --- a/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/PinColumnsPluginViewImpl.java +++ b/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/PinColumnsPluginViewImpl.java @@ -1,6 +1,7 @@ package org.dominokit.domino.datatable.client.views.ui; import elemental2.dom.HTMLDivElement; +import static org.dominokit.domino.ui.utils.Domino.*; import org.dominokit.domino.SampleClass; import org.dominokit.domino.SampleMethod; import org.dominokit.domino.api.client.annotations.UiView; diff --git a/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/PluginsMixViewImpl.java b/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/PluginsMixViewImpl.java index b3e8171d..f82d6ac6 100644 --- a/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/PluginsMixViewImpl.java +++ b/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/PluginsMixViewImpl.java @@ -1,6 +1,7 @@ package org.dominokit.domino.datatable.client.views.ui; import elemental2.dom.HTMLDivElement; +import static org.dominokit.domino.ui.utils.Domino.*; import elemental2.dom.HTMLElement; import org.dominokit.domino.SampleClass; import org.dominokit.domino.SampleMethod; diff --git a/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/RecordDetailsPluginViewImpl.java b/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/RecordDetailsPluginViewImpl.java index f1f99f94..d4eb18aa 100644 --- a/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/RecordDetailsPluginViewImpl.java +++ b/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/RecordDetailsPluginViewImpl.java @@ -1,6 +1,7 @@ package org.dominokit.domino.datatable.client.views.ui; import elemental2.dom.HTMLDivElement; +import static org.dominokit.domino.ui.utils.Domino.*; import org.dominokit.domino.SampleClass; import org.dominokit.domino.SampleMethod; import org.dominokit.domino.api.client.annotations.UiView; diff --git a/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/RowMenuViewImpl.java b/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/RowMenuViewImpl.java index 374cc7ee..b0422d81 100644 --- a/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/RowMenuViewImpl.java +++ b/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/RowMenuViewImpl.java @@ -1,6 +1,7 @@ package org.dominokit.domino.datatable.client.views.ui; import elemental2.dom.HTMLDivElement; +import static org.dominokit.domino.ui.utils.Domino.*; import org.dominokit.domino.SampleClass; import org.dominokit.domino.SampleMethod; import org.dominokit.domino.api.client.annotations.UiView; diff --git a/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/ScrollLoadingDatatableViewImpl.java b/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/ScrollLoadingDatatableViewImpl.java index 484af861..433a3894 100644 --- a/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/ScrollLoadingDatatableViewImpl.java +++ b/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/ScrollLoadingDatatableViewImpl.java @@ -1,6 +1,7 @@ package org.dominokit.domino.datatable.client.views.ui; import elemental2.dom.HTMLDivElement; +import static org.dominokit.domino.ui.utils.Domino.*; import org.dominokit.domino.SampleClass; import org.dominokit.domino.SampleMethod; import org.dominokit.domino.api.client.annotations.UiView; diff --git a/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/SelectionPluginViewImpl.java b/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/SelectionPluginViewImpl.java index 667051ef..9a5feacd 100644 --- a/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/SelectionPluginViewImpl.java +++ b/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/SelectionPluginViewImpl.java @@ -1,6 +1,5 @@ package org.dominokit.domino.datatable.client.views.ui; -import elemental2.dom.DomGlobal; import elemental2.dom.HTMLDivElement; import org.dominokit.domino.SampleClass; import org.dominokit.domino.SampleMethod; @@ -18,7 +17,6 @@ import org.dominokit.domino.ui.datatable.ColumnConfig; import org.dominokit.domino.ui.datatable.DataTable; import org.dominokit.domino.ui.datatable.TableConfig; -import org.dominokit.domino.ui.datatable.events.SelectAllEvent; import org.dominokit.domino.ui.datatable.plugins.header.HeaderBarPlugin; import org.dominokit.domino.ui.datatable.plugins.selection.SelectionPlugin; import org.dominokit.domino.ui.datatable.store.LocalListDataStore; @@ -27,6 +25,8 @@ import org.dominokit.domino.ui.notifications.Notification; import org.dominokit.domino.ui.typography.BlockHeader; +import static org.dominokit.domino.ui.utils.Domino.*; + @UiView(presentable = SelectionPluginProxy.class) @SampleClass(includeClassName = true) public class SelectionPluginViewImpl extends BaseDemoView implements DatatableView { diff --git a/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/SortAndSearchPluginViewImpl.java b/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/SortAndSearchPluginViewImpl.java index 575bc5ea..7854b429 100644 --- a/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/SortAndSearchPluginViewImpl.java +++ b/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/SortAndSearchPluginViewImpl.java @@ -1,6 +1,7 @@ package org.dominokit.domino.datatable.client.views.ui; import elemental2.dom.HTMLDivElement; +import static org.dominokit.domino.ui.utils.Domino.*; import org.dominokit.domino.SampleClass; import org.dominokit.domino.SampleMethod; import org.dominokit.domino.api.client.annotations.UiView; @@ -20,6 +21,7 @@ import org.dominokit.domino.ui.datatable.ColumnConfig; import org.dominokit.domino.ui.datatable.DataTable; import org.dominokit.domino.ui.datatable.TableConfig; +import org.dominokit.domino.ui.datatable.events.SortEvent; import org.dominokit.domino.ui.datatable.plugins.header.HeaderBarPlugin; import org.dominokit.domino.ui.datatable.plugins.column.ColumnFilterMeta; import org.dominokit.domino.ui.datatable.plugins.column.ColumnHeaderFilterPlugin; @@ -29,6 +31,7 @@ import org.dominokit.domino.ui.elements.DivElement; import org.dominokit.domino.ui.forms.suggest.SelectOption; import org.dominokit.domino.ui.icons.lib.Icons; +import org.dominokit.domino.ui.notifications.Notification; import org.dominokit.domino.ui.typography.BlockHeader; @UiView(presentable = SortAndSearchPluginsProxy.class) diff --git a/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/SummaryPluginViewImpl.java b/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/SummaryPluginViewImpl.java index 5153ae1f..da5f6ae7 100644 --- a/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/SummaryPluginViewImpl.java +++ b/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/SummaryPluginViewImpl.java @@ -1,6 +1,7 @@ package org.dominokit.domino.datatable.client.views.ui; import elemental2.dom.HTMLDivElement; +import static org.dominokit.domino.ui.utils.Domino.*; import org.dominokit.domino.SampleClass; import org.dominokit.domino.SampleMethod; import org.dominokit.domino.api.client.annotations.UiView; diff --git a/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/TableStyleActions.java b/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/TableStyleActions.java index c02559e4..ceaf2c75 100644 --- a/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/TableStyleActions.java +++ b/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/TableStyleActions.java @@ -1,6 +1,7 @@ package org.dominokit.domino.datatable.client.views.ui; import elemental2.dom.HTMLDivElement; +import static org.dominokit.domino.ui.utils.Domino.*; import org.dominokit.domino.ui.datatable.DataTable; import org.dominokit.domino.ui.elements.DivElement; import org.dominokit.domino.ui.icons.lib.Icons; diff --git a/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/TopPanelPluginViewImpl.java b/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/TopPanelPluginViewImpl.java index eff8d36b..02438af1 100644 --- a/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/TopPanelPluginViewImpl.java +++ b/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/TopPanelPluginViewImpl.java @@ -1,6 +1,7 @@ package org.dominokit.domino.datatable.client.views.ui; import elemental2.dom.HTMLDivElement; +import static org.dominokit.domino.ui.utils.Domino.*; import elemental2.dom.HTMLElement; import org.dominokit.domino.SampleClass; import org.dominokit.domino.SampleMethod; diff --git a/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/TreeGridEagerPluginViewImpl.java b/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/TreeGridEagerPluginViewImpl.java index 470db304..4edc3286 100644 --- a/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/TreeGridEagerPluginViewImpl.java +++ b/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/TreeGridEagerPluginViewImpl.java @@ -1,6 +1,7 @@ package org.dominokit.domino.datatable.client.views.ui; import elemental2.dom.HTMLDivElement; +import static org.dominokit.domino.ui.utils.Domino.*; import org.dominokit.domino.SampleClass; import org.dominokit.domino.SampleMethod; import org.dominokit.domino.api.client.annotations.UiView; diff --git a/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/TreeGridLazyPluginViewImpl.java b/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/TreeGridLazyPluginViewImpl.java index 18ce2669..dea361f0 100644 --- a/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/TreeGridLazyPluginViewImpl.java +++ b/datatable/src/main/java/org/dominokit/domino/datatable/client/views/ui/TreeGridLazyPluginViewImpl.java @@ -1,6 +1,7 @@ package org.dominokit.domino.datatable.client.views.ui; import elemental2.dom.HTMLDivElement; +import static org.dominokit.domino.ui.utils.Domino.*; import elemental2.dom.HTMLTableCellElement; import org.dominokit.domino.SampleClass; import org.dominokit.domino.SampleMethod; diff --git a/datepicker/pom.xml b/datepicker/pom.xml index 7c8b93fc..3a03a6c4 100644 --- a/datepicker/pom.xml +++ b/datepicker/pom.xml @@ -1,5 +1,5 @@ - 4.0.0 @@ -16,7 +16,7 @@ - com.google.gwt + org.gwtproject gwt-user provided diff --git a/datepicker/src/main/java/org/dominokit/domino/datepicker/client/views/ui/DatePickerViewImpl.java b/datepicker/src/main/java/org/dominokit/domino/datepicker/client/views/ui/DatePickerViewImpl.java index 38efed50..cd472757 100644 --- a/datepicker/src/main/java/org/dominokit/domino/datepicker/client/views/ui/DatePickerViewImpl.java +++ b/datepicker/src/main/java/org/dominokit/domino/datepicker/client/views/ui/DatePickerViewImpl.java @@ -1,6 +1,7 @@ package org.dominokit.domino.datepicker.client.views.ui; import elemental2.dom.HTMLDivElement; +import static org.dominokit.domino.ui.utils.Domino.*; import org.dominokit.domino.SampleClass; import org.dominokit.domino.SampleMethod; import org.dominokit.domino.api.client.annotations.UiView; diff --git a/demomenu/demomenu-frontend/pom.xml b/demomenu/demomenu-frontend/pom.xml index 6201538c..09f81fdb 100644 --- a/demomenu/demomenu-frontend/pom.xml +++ b/demomenu/demomenu-frontend/pom.xml @@ -1,5 +1,5 @@ - 4.0.0 @@ -14,7 +14,7 @@ - com.google.gwt + org.gwtproject gwt-user provided diff --git a/demomenu/demomenu-frontend/src/main/java/org/dominokit/domino/demomenu/client/views/ui/DemoMenuViewImpl.java b/demomenu/demomenu-frontend/src/main/java/org/dominokit/domino/demomenu/client/views/ui/DemoMenuViewImpl.java index 538522bb..fa713d32 100644 --- a/demomenu/demomenu-frontend/src/main/java/org/dominokit/domino/demomenu/client/views/ui/DemoMenuViewImpl.java +++ b/demomenu/demomenu-frontend/src/main/java/org/dominokit/domino/demomenu/client/views/ui/DemoMenuViewImpl.java @@ -2,13 +2,12 @@ import elemental2.core.Global; import elemental2.dom.HTMLDivElement; -import elemental2.dom.URL; import org.dominokit.domino.api.client.annotations.UiView; import org.dominokit.domino.demomenu.client.presenters.DemoMenuProxy; import org.dominokit.domino.demomenu.client.views.DemoMenuView; +import org.dominokit.domino.ui.icons.ToggleMdiIcon; import org.dominokit.domino.ui.icons.lib.Icons; import org.dominokit.domino.ui.icons.lib.MdiTags; -import org.dominokit.domino.ui.icons.ToggleMdiIcon; import org.dominokit.domino.ui.mediaquery.MediaQuery; import org.dominokit.domino.ui.notifications.Notification; import org.dominokit.domino.ui.style.SpacingCss; @@ -19,6 +18,9 @@ import org.dominokit.domino.ui.utils.PostfixAddOn; import org.dominokit.domino.view.BaseElementView; +import static org.dominokit.domino.ui.utils.Domino.dui_h_12; +import static org.dominokit.domino.ui.utils.Domino.dui_order_20; + @UiView(presentable = DemoMenuProxy.class) public class DemoMenuViewImpl extends BaseElementView implements DemoMenuView { diff --git a/dialogs/pom.xml b/dialogs/pom.xml index ac283aae..8d770984 100644 --- a/dialogs/pom.xml +++ b/dialogs/pom.xml @@ -1,5 +1,5 @@ - + 4.0.0 domino-ui-demo @@ -15,7 +15,7 @@ - com.google.gwt + org.gwtproject gwt-user provided diff --git a/dialogs/src/main/java/org/dominokit/domino/dialogs/client/views/ui/DialogsViewImpl.java b/dialogs/src/main/java/org/dominokit/domino/dialogs/client/views/ui/DialogsViewImpl.java index da8c2e7f..019d1630 100644 --- a/dialogs/src/main/java/org/dominokit/domino/dialogs/client/views/ui/DialogsViewImpl.java +++ b/dialogs/src/main/java/org/dominokit/domino/dialogs/client/views/ui/DialogsViewImpl.java @@ -2,6 +2,7 @@ import com.google.gwt.core.client.GWT; import elemental2.dom.HTMLDivElement; +import static org.dominokit.domino.ui.utils.Domino.*; import org.dominokit.domino.SampleClass; import org.dominokit.domino.SampleMethod; import org.dominokit.domino.api.client.annotations.UiView; diff --git a/dnd/pom.xml b/dnd/pom.xml index f1d3690a..902cb6b2 100644 --- a/dnd/pom.xml +++ b/dnd/pom.xml @@ -1,5 +1,5 @@ - 4.0.0 @@ -14,7 +14,7 @@ - com.google.gwt + org.gwtproject gwt-user provided diff --git a/dnd/src/main/java/org/dominokit/domino/dnd/client/views/ui/DndViewImpl.java b/dnd/src/main/java/org/dominokit/domino/dnd/client/views/ui/DndViewImpl.java index 752df3fd..7feb46a3 100644 --- a/dnd/src/main/java/org/dominokit/domino/dnd/client/views/ui/DndViewImpl.java +++ b/dnd/src/main/java/org/dominokit/domino/dnd/client/views/ui/DndViewImpl.java @@ -1,6 +1,7 @@ package org.dominokit.domino.dnd.client.views.ui; import elemental2.dom.HTMLDivElement; +import static org.dominokit.domino.ui.utils.Domino.*; import org.dominokit.domino.SampleClass; import org.dominokit.domino.SampleMethod; import org.dominokit.domino.api.client.annotations.UiView; diff --git a/flexlayout/pom.xml b/flexlayout/pom.xml index d87ea63a..286cfd4c 100644 --- a/flexlayout/pom.xml +++ b/flexlayout/pom.xml @@ -1,5 +1,5 @@ - + 4.0.0 domino-ui-demo @@ -15,7 +15,7 @@ - com.google.gwt + org.gwtproject gwt-user provided diff --git a/flexlayout/src/main/java/org/dominokit/domino/flexlayout/client/views/ui/FlexLayoutViewImpl.java b/flexlayout/src/main/java/org/dominokit/domino/flexlayout/client/views/ui/FlexLayoutViewImpl.java index a6533a0e..f147d3c2 100644 --- a/flexlayout/src/main/java/org/dominokit/domino/flexlayout/client/views/ui/FlexLayoutViewImpl.java +++ b/flexlayout/src/main/java/org/dominokit/domino/flexlayout/client/views/ui/FlexLayoutViewImpl.java @@ -1,6 +1,7 @@ package org.dominokit.domino.flexlayout.client.views.ui; import elemental2.dom.HTMLDivElement; +import static org.dominokit.domino.ui.utils.Domino.*; import org.dominokit.domino.SampleClass; import org.dominokit.domino.SampleMethod; import org.dominokit.domino.api.client.annotations.UiView; diff --git a/formsamples/pom.xml b/formsamples/pom.xml deleted file mode 100644 index 41512d80..00000000 --- a/formsamples/pom.xml +++ /dev/null @@ -1,98 +0,0 @@ - - - 4.0.0 - - domino-ui-demo - org.dominokit - HEAD-SNAPSHOT - - - formsamples - gwt-lib - - formsamples - http://maven.apache.org - - - - com.google.gwt - gwt-user - provided - - - org.dominokit - domino-mvp-api-shared - - - org.dominokit - domino-mvp-api-client - - - org.dominokit - domino-mvp-api-client - sources - - - org.dominokit - domino-slf4j-logger - - - org.dominokit - domino-mvp-apt-client - provided - - - org.dominokit - domino-mvp-client-test - test - - - - org.dominokit - domino-jackson - - - org.dominokit - domino-jackson-processor - provided - - - - org.dominokit - component-case-frontend-ui - ${project.version} - - - org.dominokit - sample-processor - ${project.version} - provided - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - -Xlint:all - true - true - - - - net.ltgt.gwt.maven - gwt-maven-plugin - true - - org.dominokit.domino.formsamples.FormSamplesClientModule - - - - org.apache.maven.plugins - maven-source-plugin - - - - diff --git a/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/AddLCImportComponent.java b/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/AddLCImportComponent.java deleted file mode 100644 index 2c1c1b1d..00000000 --- a/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/AddLCImportComponent.java +++ /dev/null @@ -1,149 +0,0 @@ -package org.dominokit.domino.formsamples.client.views.ui; - -import elemental2.dom.HTMLDivElement; -import org.dominokit.domino.formsamples.client.views.FormSamplesView; -import org.dominokit.domino.formsamples.client.views.ui.section.ApplicantSection; -import org.dominokit.domino.formsamples.client.views.ui.section.AuthorizationSection; -import org.dominokit.domino.formsamples.client.views.ui.section.BeneficiarySection; -import org.dominokit.domino.formsamples.client.views.ui.section.ConfirmationInstructionsSection; -import org.dominokit.domino.formsamples.client.views.ui.section.CorrespondentChargesInstructionsSection; -import org.dominokit.domino.formsamples.client.views.ui.section.CreditAmountAndToleranceSection; -import org.dominokit.domino.formsamples.client.views.ui.section.DocumentsRequiredSection; -import org.dominokit.domino.formsamples.client.views.ui.section.GeneralSection; -import org.dominokit.domino.formsamples.client.views.ui.section.GoodsDescriptionSection; -import org.dominokit.domino.formsamples.client.views.ui.section.IssuerBankSection; -import org.dominokit.domino.formsamples.client.views.ui.section.PaymentScheduleSection; -import org.dominokit.domino.formsamples.client.views.ui.section.ShipmentDetailsSection; -import org.dominokit.domino.formsamples.client.views.ui.section.ValiditySection; -import org.dominokit.domino.formsamples.shared.model.Bank; -import org.dominokit.domino.formsamples.shared.model.Beneficiary; -import org.dominokit.domino.formsamples.shared.model.CorporateProfile; -import org.dominokit.domino.formsamples.shared.model.Country; -import org.dominokit.domino.formsamples.shared.model.CurrencyData; -import org.dominokit.domino.formsamples.shared.model.LetterOfCredit; -import org.dominokit.domino.ui.button.Button; -import org.dominokit.domino.ui.elements.DivElement; -import org.dominokit.domino.ui.grid.Column; -import org.dominokit.domino.ui.grid.Row; -import org.dominokit.domino.ui.utils.BaseDominoElement; - -import java.util.List; - -public class AddLCImportComponent extends BaseDominoElement { - - private DivElement element = div(); - - private CorporateProfile corporateProfile; - private List countries; - private List beneficiaries; - private List banks; - private List currencies; - private GeneralSection generalSection; - private IssuerBankSection issuerBankSection; - private AuthorizationSection authorizationSection; - private ApplicantSection applicantSection; - private BeneficiarySection beneficiarySection; - private CreditAmountAndToleranceSection creditAmountAndToleranceSection; - private PaymentScheduleSection paymentScheduleSection; - private ValiditySection validitySection; - private ShipmentDetailsSection shipmentDetailsSection; - private DocumentsRequiredSection documentsRequiredSection; - private GoodsDescriptionSection goodsDescriptionSection; - private ConfirmationInstructionsSection confirmationInstructionsSection; - private CorrespondentChargesInstructionsSection correspondentChargesInstructionsSection; - private FormSamplesView.FormSamplesUIHandlers uiHandlers; - - public AddLCImportComponent(CorporateProfile corporateProfile, List countries, List beneficiaries, List banks, List currencies) { - this.corporateProfile = corporateProfile; - this.countries = countries; - this.beneficiaries = beneficiaries; - this.banks = banks; - this.currencies = currencies; - generalSection = new GeneralSection(this.corporateProfile); - issuerBankSection = new IssuerBankSection(this.corporateProfile); - authorizationSection = new AuthorizationSection(); - applicantSection = new ApplicantSection(this.corporateProfile); - beneficiarySection = new BeneficiarySection(this.beneficiaries); - creditAmountAndToleranceSection = new CreditAmountAndToleranceSection(this.currencies); - paymentScheduleSection = new PaymentScheduleSection(); - validitySection = new ValiditySection(this.countries); - shipmentDetailsSection = new ShipmentDetailsSection(); - documentsRequiredSection = new DocumentsRequiredSection(this.banks, this.countries); - goodsDescriptionSection = new GoodsDescriptionSection(); - confirmationInstructionsSection = new ConfirmationInstructionsSection(this.corporateProfile); - correspondentChargesInstructionsSection = new CorrespondentChargesInstructionsSection(this.corporateProfile); - - element.appendChild(generalSection.element()); - element.appendChild(issuerBankSection.element()); - element.appendChild(authorizationSection.element()); - element.appendChild(applicantSection.element()); - element.appendChild(beneficiarySection.element()); - element.appendChild(creditAmountAndToleranceSection.element()); - element.appendChild(paymentScheduleSection.element()); - element.appendChild(validitySection.element()); - element.appendChild(shipmentDetailsSection.element()); - element.appendChild(documentsRequiredSection.element()); - element.appendChild(goodsDescriptionSection.element()); - element.appendChild(BlockHeader.create("Instructions").element()); - element.appendChild(confirmationInstructionsSection.element()); - element.appendChild(correspondentChargesInstructionsSection.element()); - - element.appendChild(Row.create() - .style() - .setMarginBottom("50px") - .get() - .addColumn(Column.span6() - .appendChild(Button.createPrimary("Submit") - .addClickListener(evt -> { - if (isFormValid()) { - uiHandlers.onCreate(createLetterOfCredit()); - } - }) - .style() - .setMinWidth("120px").get())) - .element()); - } - - public boolean isFormValid() { - return correspondentChargesInstructionsSection.validate() & - confirmationInstructionsSection.validate() & - goodsDescriptionSection.validate() & - documentsRequiredSection.validate() & - shipmentDetailsSection.validate() & - validitySection.validate() & - paymentScheduleSection.validate() & - creditAmountAndToleranceSection.validate() & - beneficiarySection.validate() & - applicantSection.validate() & - authorizationSection.validate() & - issuerBankSection.validate() & - generalSection.validate(); - } - - private LetterOfCredit createLetterOfCredit() { - LetterOfCredit letterOfCredit = new LetterOfCredit(); - generalSection.collect(letterOfCredit); - issuerBankSection.collect(letterOfCredit); - authorizationSection.collect(letterOfCredit); - applicantSection.collect(letterOfCredit); - beneficiarySection.collect(letterOfCredit); - creditAmountAndToleranceSection.collect(letterOfCredit); - paymentScheduleSection.collect(letterOfCredit); - validitySection.collect(letterOfCredit); - shipmentDetailsSection.collect(letterOfCredit); - documentsRequiredSection.collect(letterOfCredit); - goodsDescriptionSection.collect(letterOfCredit); - confirmationInstructionsSection.collect(letterOfCredit); - correspondentChargesInstructionsSection.collect(letterOfCredit); - return letterOfCredit; - } - - public void setUiHandlers(FormSamplesView.FormSamplesUIHandlers uiHandlers) { - this.uiHandlers = uiHandlers; - } - - @Override - public HTMLDivElement element() { - return element; - } -} diff --git a/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/FormSamplesViewImpl.java b/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/FormSamplesViewImpl.java deleted file mode 100644 index 02c40f45..00000000 --- a/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/FormSamplesViewImpl.java +++ /dev/null @@ -1,2103 +0,0 @@ -package org.dominokit.domino.formsamples.client.views.ui; - -import com.google.gwt.core.client.Scheduler; -import elemental2.dom.HTMLDivElement; -import org.dominokit.domino.api.client.annotations.UiView; -import org.dominokit.domino.componentcase.client.ui.views.LinkToSourceCode; -import org.dominokit.domino.formsamples.client.presenters.FormSamplesProxy; -import org.dominokit.domino.formsamples.client.views.FormSamplesView; -import org.dominokit.domino.formsamples.shared.model.Bank; -import org.dominokit.domino.formsamples.shared.model.Beneficiary; -import org.dominokit.domino.formsamples.shared.model.CorporateProfile; -import org.dominokit.domino.formsamples.shared.model.Countries; -import org.dominokit.domino.formsamples.shared.model.Country; -import org.dominokit.domino.formsamples.shared.model.Currencies; -import org.dominokit.domino.formsamples.shared.model.CurrencyData; -import org.dominokit.domino.formsamples.shared.model.LetterOfCredit; -import org.dominokit.domino.ui.dialogs.MessageDialog; -import org.dominokit.domino.ui.utils.ElementUtil; -import org.dominokit.domino.view.BaseElementView; - -import java.util.Arrays; -import java.util.List; - -import static org.jboss.elemento.Elements.div; - -@UiView(presentable = FormSamplesProxy.class) -public class FormSamplesViewImpl extends BaseElementView implements FormSamplesView, FormSamplesView.FormSamplesUIHandlers { - - - //TODO move to server side - private static final String BANKS_JSON = "[\n" + - " {\n" + - " \"name\": \"Bank XYZ\",\n" + - " \"swiftCode\": \"ABCDEFGHIXXX\",\n" + - " \"shortName\": \"A.B.C.D\",\n" + - " \"address\": {\n" + - " \"countryISOCode\": \"OM\",\n" + - " \"city\": \"City Y\",\n" + - " \"street\": \"Street ABC\",\n" + - " \"apartment\": \"Building XYZ\",\n" + - " \"zipCode\": \"123\",\n" + - " \"mailBox\": \"PO Box 123\",\n" + - " \"phoneNumber\": \"+900 12345678\",\n" + - " \"faxNumber\": \"+900 12345678\"\n" + - " },\n" + - " \"contactPerson\": {\n" + - " \"name\": \"\\tMr Noman person\",\n" + - " \"contactNumber\": \"+900 12345678\",\n" + - " \"email\": \"xyz@abcdefghi.com\",\n" + - " \"address\": {\n" + - " \"countryISOCode\": \"OM\",\n" + - " \"city\": \"City x\",\n" + - " \"street\": \"ABC Street\",\n" + - " \"apartment\": \"Building XYZ\",\n" + - " \"zipCode\": \"123\",\n" + - " \"mailBox\": \"PO Box 123\",\n" + - " \"phoneNumber\": \"+900 12345678\",\n" + - " \"faxNumber\": \"+900 12345678\"\n" + - " }\n" + - " }\n" + - " }\n" + - "]"; - private static final String BENEFICIARIES_JSON = "[\n" + - " {\n" + - " \"id\": \"71328a43-d119-4e99-8bd0-629c9fa39415\",\n" + - " \"processInstanceId\": \"39\",\n" + - " \"tenantId\": \"corpay\",\n" + - " \"createdDate\": 1532217600000,\n" + - " \"createdBy\": \"1\",\n" + - " \"updatedDate\": null,\n" + - " \"updatedBy\": null,\n" + - " \"name\": \"Corp. ABC\",\n" + - " \"profileType\": \"bank\",\n" + - " \"description\": null,\n" + - " \"address\": {\n" + - " \"id\": \"4658f7d3-b94c-4875-af45-41fc41b774e8\",\n" + - " \"processInstanceId\": null,\n" + - " \"tenantId\": null,\n" + - " \"createdDate\": null,\n" + - " \"createdBy\": null,\n" + - " \"updatedDate\": null,\n" + - " \"updatedBy\": null,\n" + - " \"countryIsoCode\": \"JOR\",\n" + - " \"city\": \"Amman\",\n" + - " \"street\": null,\n" + - " \"apartment\": null,\n" + - " \"zipCode\": null,\n" + - " \"mailBox\": null\n" + - " },\n" + - " \"email\": null,\n" + - " \"poBox\": null,\n" + - " \"phone\": null,\n" + - " \"fax\": null,\n" + - " \"contactPerson\": {\n" + - " \"id\": \"1d8577a5-e332-498a-b1fc-11ef936dc997\",\n" + - " \"processInstanceId\": null,\n" + - " \"tenantId\": null,\n" + - " \"createdDate\": null,\n" + - " \"createdBy\": null,\n" + - " \"updatedDate\": null,\n" + - " \"updatedBy\": null,\n" + - " \"name\": \"Noman person\",\n" + - " \"contactNumber\": \"07896654545\",\n" + - " \"address\": null,\n" + - " \"email\": null\n" + - " },\n" + - " \"startingDate\": 1532217600000,\n" + - " \"expiryDate\": 1847836800000,\n" + - " \"state\": \"ACTIVE\",\n" + - " \"accounts\": [\n" + - " {\n" + - " \"id\": \"1\",\n" + - " \"processInstanceId\": null,\n" + - " \"tenantId\": null,\n" + - " \"createdDate\": null,\n" + - " \"createdBy\": null,\n" + - " \"updatedDate\": null,\n" + - " \"updatedBy\": null,\n" + - " \"iban\": \"AB89ABCD0000000000009235351490\",\n" + - " \"accountAlias\": \"current account\",\n" + - " \"accountNumber\": \"009235351490\",\n" + - " \"country\": \"Kuwait\",\n" + - " \"bank\": \"Bank XYZ\",\n" + - " \"bicCode\": \"XYZ\",\n" + - " \"currency\": \"JOD\",\n" + - " \"accountState\": \"ACTIVE\"\n" + - " },\n" + - " {\n" + - " \"id\": \"2\",\n" + - " \"processInstanceId\": null,\n" + - " \"tenantId\": null,\n" + - " \"createdDate\": null,\n" + - " \"createdBy\": null,\n" + - " \"updatedDate\": null,\n" + - " \"updatedBy\": null,\n" + - " \"iban\": \"AB62ABCD0000000000009235351491\",\n" + - " \"accountAlias\": \"main account\",\n" + - " \"accountNumber\": \"123456789123\",\n" + - " \"country\": \"Jordan\",\n" + - " \"bank\": \"Bank CBA\",\n" + - " \"bicCode\": \"CBA\",\n" + - " \"currency\": \"JOD\",\n" + - " \"accountState\": \"ACTIVE\"\n" + - " }\n" + - " ],\n" + - " \"agreements\": []\n" + - " }\n" + - "]"; - private static final String COUNTRIES_JSON = "{\n" + - " \"countries\": [\n" + - " {\n" + - " \"iso\": \"AND\",\n" + - " \"code\": \"AD\",\n" + - " \"name\": \"Andorra\",\n" + - " \"cities\": [\n" + - " \"Andorra la Vella\",\n" + - " \"Canillo\",\n" + - " \"Encamp\",\n" + - " \"La Massana\",\n" + - " \"Escaldes-Engordany\",\n" + - " \"Ordino\",\n" + - " \"Sant Julia de Loria\"\n" + - " ]\n" + - " },\n" + - " {\n" + - " \"iso\": \"ARE\",\n" + - " \"code\": \"AE\",\n" + - " \"name\": \"United Arab Emirates\",\n" + - " \"cities\": [\n" + - " \"Abu Dhabi\",\n" + - " \"'Ajman\",\n" + - " \"Al Fujayrah\",\n" + - " \"Ash Shariqah (Sharjah)\",\n" + - " \"Dubayy (Dubai)\",\n" + - " \"Ra's al Khaymah\",\n" + - " \"Umm al Qaywayn\"\n" + - " ]\n" + - " },\n" + - " {\n" + - " \"iso\": \"AFG\",\n" + - " \"code\": \"AF\",\n" + - " \"name\": \"Afghanistan\",\n" + - " \"cities\": [\n" + - " \"Kabul\",\n" + - " \"Badakhshan\",\n" + - " \"Badghis\",\n" + - " \"Baghlan\",\n" + - " \"Balkh\",\n" + - " \"Bamian\",\n" + - " \"Farah\",\n" + - " \"Faryab\",\n" + - " \"Ghazni\",\n" + - " \"Ghowr\",\n" + - " \"Helmand\",\n" + - " \"Herat\",\n" + - " \"Jowzjan\",\n" + - " \"Kabol\",\n" + - " \"Kandahar\",\n" + - " \"Kapisa\",\n" + - " \"Khowst\",\n" + - " \"Konar\",\n" + - " \"Kondoz\",\n" + - " \"Laghman\",\n" + - " \"Lowgar\",\n" + - " \"Nangarhar\",\n" + - " \"Nimruz\",\n" + - " \"Nurestan\",\n" + - " \"Oruzgan\",\n" + - " \"Paktia\",\n" + - " \"Paktika\",\n" + - " \"Parvan\",\n" + - " \"Samangan\",\n" + - " \"Sar-e Pol\",\n" + - " \"Takhar\",\n" + - " \"Vardak\",\n" + - " \"Zabol\"\n" + - " ]\n" + - " },\n" + - " {\n" + - " \"iso\": \"AIA\",\n" + - " \"code\": \"AI\",\n" + - " \"name\": \"Anguilla\",\n" + - " \"cities\": [\n" + - " \"The Valley\"\n" + - " ]\n" + - " },\n" + - " {\n" + - " \"iso\": \"ALB\",\n" + - " \"code\": \"AL\",\n" + - " \"name\": \"Albania\",\n" + - " \"cities\": [\n" + - " \"Tirana\",\n" + - " \"Berat\",\n" + - " \"Bulqize\",\n" + - " \"Delvine\",\n" + - " \"Devoll\",\n" + - " \"Diber\",\n" + - " \"Durres\",\n" + - " \"Elbasan\",\n" + - " \"Fier\",\n" + - " \"Gjirokaster\",\n" + - " \"Gramsh\",\n" + - " \"Has\",\n" + - " \"Kavaje\",\n" + - " \"Kolonje\",\n" + - " \"Korce\",\n" + - " \"Kruje\",\n" + - " \"Kucove\",\n" + - " \"Kukes\",\n" + - " \"Kurbin\",\n" + - " \"Lezhe\",\n" + - " \"Librazhd\",\n" + - " \"Lushnje\",\n" + - " \"Malesi e Madhe\",\n" + - " \"Mallakaster\",\n" + - " \"Mat\",\n" + - " \"Mirdite\",\n" + - " \"Peqin\",\n" + - " \"Permet\",\n" + - " \"Pogradec\",\n" + - " \"Puke\",\n" + - " \"Sarande\",\n" + - " \"Shkoder\",\n" + - " \"Skrapar\",\n" + - " \"Tepelene\",\n" + - " \"Tirane\",\n" + - " \"Tropoje\",\n" + - " \"Vlore\"\n" + - " ]\n" + - " },\n" + - " {\n" + - " \"iso\": \"ARM\",\n" + - " \"code\": \"AM\",\n" + - " \"name\": \"Armenia\",\n" + - " \"cities\": [\n" + - " \"Yerevan\",\n" + - " \"Aragatsotn\",\n" + - " \"Ararat\",\n" + - " \"Armavir\",\n" + - " \"Geghark'unik'\",\n" + - " \"Kotayk'\",\n" + - " \"Lorri\",\n" + - " \"Shirak\",\n" + - " \"Syunik'\",\n" + - " \"Tavush\",\n" + - " \"Vayots' Dzor\"\n" + - " ]\n" + - " },\n" + - " {\n" + - " \"iso\": \"ANT\",\n" + - " \"code\": \"AN\",\n" + - " \"name\": \"Netherlands Antilles\",\n" + - " \"cities\": [\n" + - " \"Willemstad\"\n" + - " ]\n" + - " },\n" + - " {\n" + - " \"iso\": \"AGO\",\n" + - " \"code\": \"AO\",\n" + - " \"name\": \"Angola\",\n" + - " \"cities\": [\n" + - " \"Luanda\",\n" + - " \"Bengo\",\n" + - " \"Benguela\",\n" + - " \"Bie\",\n" + - " \"Cabinda\",\n" + - " \"Cuando Cubango\",\n" + - " \"Cuanza Norte\",\n" + - " \"Cuanza Sul\",\n" + - " \"Cunene\",\n" + - " \"Huambo\",\n" + - " \"Huila\",\n" + - " \"Lunda Norte\",\n" + - " \"Lunda Sul\",\n" + - " \"Malanje\",\n" + - " \"Moxico\",\n" + - " \"Namibe\",\n" + - " \"Uige\",\n" + - " \"Zaire\"\n" + - " ]\n" + - " },\n" + - " {\n" + - " \"iso\": \"ARG\",\n" + - " \"code\": \"AR\",\n" + - " \"name\": \"Argentina\",\n" + - " \"cities\": [\n" + - " \"Buenos Aires\",\n" + - " \"Catamarca\",\n" + - " \"Chaco\",\n" + - " \"Chubut\",\n" + - " \"Cordoba\",\n" + - " \"Corrientes\",\n" + - " \"Entre Rios\",\n" + - " \"Formosa\",\n" + - " \"Jujuy\",\n" + - " \"La Pampa\",\n" + - " \"La Rioja\",\n" + - " \"Mendoza\",\n" + - " \"Misiones\",\n" + - " \"Neuquen\",\n" + - " \"Rio Negro\",\n" + - " \"Salta\",\n" + - " \"San Juan\",\n" + - " \"San Luis\",\n" + - " \"Santa Cruz\",\n" + - " \"Santa Fe\",\n" + - " \"Santiago del Estero\",\n" + - " \"Tucuman\"\n" + - " ]\n" + - " },\n" + - " {\n" + - " \"iso\": \"AUT\",\n" + - " \"code\": \"AT\",\n" + - " \"name\": \"Austria\",\n" + - " \"cities\": [\n" + - " \"Vienna\",\n" + - " \"Burgenland\",\n" + - " \"Kaernten\",\n" + - " \"Niederoesterreich\",\n" + - " \"Oberoesterreich\",\n" + - " \"Salzburg\",\n" + - " \"Steiermark\",\n" + - " \"Tirol\",\n" + - " \"Vorarlberg\",\n" + - " \"Wien\"\n" + - " ]\n" + - " },\n" + - " {\n" + - " \"iso\": \"AUS\",\n" + - " \"code\": \"AU\",\n" + - " \"name\": \"Australia\",\n" + - " \"cities\": [\n" + - " \"Canberra\",\n" + - " \"Australian Capital Territory\",\n" + - " \"New South Wales\",\n" + - " \"Northern Territory\",\n" + - " \"Queensland\",\n" + - " \"South Australia\",\n" + - " \"Tasmania\",\n" + - " \"Victoria\",\n" + - " \"Western Australia\"\n" + - " ]\n" + - " },\n" + - " {\n" + - " \"iso\": \"ABW\",\n" + - " \"code\": \"AW\",\n" + - " \"name\": \"Aruba\",\n" + - " \"cities\": [\n" + - " \"Oranjestad\"\n" + - " ]\n" + - " },\n" + - " {\n" + - " \"iso\": \"AZE\",\n" + - " \"code\": \"AZ\",\n" + - " \"name\": \"Azerbaijan\",\n" + - " \"cities\": [\n" + - " \"Baku (Baki)\",\n" + - " \"Abseron\",\n" + - " \"Agcabadi\",\n" + - " \"Agdam\",\n" + - " \"Agdas\",\n" + - " \"Agstafa\",\n" + - " \"Agsu\",\n" + - " \"Ali Bayramli\",\n" + - " \"Astara\",\n" + - " \"Balakan\",\n" + - " \"Barda\",\n" + - " \"Beylaqan\",\n" + - " \"Bilasuvar\",\n" + - " \"Cabrayil\",\n" + - " \"Calilabad\",\n" + - " \"Daskasan\",\n" + - " \"Davaci\",\n" + - " \"Fuzuli\",\n" + - " \"Gadabay\",\n" + - " \"Ganca\",\n" + - " \"Goranboy\",\n" + - " \"Goycay\",\n" + - " \"Haciqabul\",\n" + - " \"Imisli\",\n" + - " \"Ismayilli\",\n" + - " \"Kalbacar\",\n" + - " \"Kurdamir\",\n" + - " \"Lacin\",\n" + - " \"Lankaran\",\n" + - " \"Lankaran\",\n" + - " \"Lerik\",\n" + - " \"Masalli\",\n" + - " \"Mingacevir\",\n" + - " \"Naftalan\",\n" + - " \"Naxcivan\",\n" + - " \"Neftcala\",\n" + - " \"Oguz\",\n" + - " \"Qabala\",\n" + - " \"Qax\",\n" + - " \"Qazax\",\n" + - " \"Qobustan\",\n" + - " \"Quba\",\n" + - " \"Qubadli\",\n" + - " \"Qusar\",\n" + - " \"Saatli\",\n" + - " \"Sabirabad\",\n" + - " \"Saki\",\n" + - " \"Saki\",\n" + - " \"Salyan\",\n" + - " \"Samaxi\",\n" + - " \"Samkir\",\n" + - " \"Samux\",\n" + - " \"Siyazan\",\n" + - " \"Sumqayit\",\n" + - " \"Susa\",\n" + - " \"Susa\",\n" + - " \"Tartar\",\n" + - " \"Tovuz\",\n" + - " \"Ucar\",\n" + - " \"Xacmaz\",\n" + - " \"Xankandi\",\n" + - " \"Xanlar\",\n" + - " \"Xizi\",\n" + - " \"Xocali\",\n" + - " \"Xocavand\",\n" + - " \"Yardimli\",\n" + - " \"Yevlax\",\n" + - " \"Yevlax\",\n" + - " \"Zangilan\",\n" + - " \"Zaqatala\",\n" + - " \"Zardab\"\n" + - " ]\n" + - " },\n" + - " {\n" + - " \"iso\": \"BRB\",\n" + - " \"code\": \"BB\",\n" + - " \"name\": \"Barbados\",\n" + - " \"cities\": [\n" + - " \"Bridgetown\",\n" + - " \"Christ Church\",\n" + - " \"Saint Andrew\",\n" + - " \"Saint George\",\n" + - " \"Saint James\",\n" + - " \"Saint John\",\n" + - " \"Saint Joseph\",\n" + - " \"Saint Lucy\",\n" + - " \"Saint Michael\",\n" + - " \"Saint Peter\",\n" + - " \"Saint Philip\",\n" + - " \"Saint Thomas\"\n" + - " ]\n" + - " },\n" + - " {\n" + - " \"iso\": \"BGD\",\n" + - " \"code\": \"BD\",\n" + - " \"name\": \"Bangladesh\",\n" + - " \"cities\": [\n" + - " \"Dhaka\",\n" + - " \"Barisal\",\n" + - " \"Chittagong\",\n" + - " \"Khulna\",\n" + - " \"Rajshahi\",\n" + - " \"Sylhet\"\n" + - " ]\n" + - " },\n" + - " {\n" + - " \"iso\": \"BEL\",\n" + - " \"code\": \"BE\",\n" + - " \"name\": \"Belgium\",\n" + - " \"cities\": [\n" + - " \"Brussels\",\n" + - " \"Antwerpen\",\n" + - " \"Brabant Wallon\",\n" + - " \"Brussels (Bruxelles)\",\n" + - " \"Hainaut\",\n" + - " \"Liege\",\n" + - " \"Limburg\",\n" + - " \"Luxembourg\",\n" + - " \"Namur\",\n" + - " \"Oost-Vlaanderen\",\n" + - " \"Vlaams-Brabant\",\n" + - " \"West-Vlaanderen\"\n" + - " ]\n" + - " },\n" + - " {\n" + - " \"iso\": \"BFA\",\n" + - " \"code\": \"BF\",\n" + - " \"name\": \"Burkina Faso\",\n" + - " \"cities\": [\n" + - " \"Ouagadougou\",\n" + - " \"Bale\",\n" + - " \"Bam\",\n" + - " \"Banwa\",\n" + - " \"Bazega\",\n" + - " \"Bougouriba\",\n" + - " \"Boulgou\",\n" + - " \"Boulkiemde\",\n" + - " \"Comoe\",\n" + - " \"Ganzourgou\",\n" + - " \"Gnagna\",\n" + - " \"Gourma\",\n" + - " \"Houet\",\n" + - " \"Ioba\",\n" + - " \"Kadiogo\",\n" + - " \"Kenedougou\",\n" + - " \"Komandjari\",\n" + - " \"Kompienga\",\n" + - " \"Kossi\",\n" + - " \"Koupelogo\",\n" + - " \"Kouritenga\",\n" + - " \"Kourweogo\",\n" + - " \"Leraba\",\n" + - " \"Loroum\",\n" + - " \"Mouhoun\",\n" + - " \"Nahouri\",\n" + - " \"Namentenga\",\n" + - " \"Nayala\",\n" + - " \"Naumbiel\",\n" + - " \"Oubritenga\",\n" + - " \"Oudalan\",\n" + - " \"Passore\",\n" + - " \"Poni\",\n" + - " \"Samentenga\",\n" + - " \"Sanguie\",\n" + - " \"Seno\",\n" + - " \"Sissili\",\n" + - " \"Soum\",\n" + - " \"Sourou\",\n" + - " \"Tapoa\",\n" + - " \"Tuy\",\n" + - " \"Yagha\",\n" + - " \"Yatenga\",\n" + - " \"Ziro\",\n" + - " \"Zondomo\",\n" + - " \"Zoundweogo\"\n" + - " ]\n" + - " },\n" + - " {\n" + - " \"iso\": \"BGR\",\n" + - " \"code\": \"BG\",\n" + - " \"name\": \"Bulgaria\",\n" + - " \"cities\": [\n" + - " \"Sofiya\",\n" + - " \"Blagoevgrad\",\n" + - " \"Burgas\",\n" + - " \"Dobrich\",\n" + - " \"Gabrovo\",\n" + - " \"Khaskovo\",\n" + - " \"Kurdzhali\",\n" + - " \"Kyustendil\",\n" + - " \"Lovech\",\n" + - " \"Montana\",\n" + - " \"Pazardzhik\",\n" + - " \"Pernik\",\n" + - " \"Pleven\",\n" + - " \"Plovdiv\",\n" + - " \"Razgrad\",\n" + - " \"Ruse\",\n" + - " \"Shumen\",\n" + - " \"Silistra\",\n" + - " \"Sliven\",\n" + - " \"Smolyan\",\n" + - " \"Sofiya-Grad\",\n" + - " \"Stara Zagora\",\n" + - " \"Turgovishte\",\n" + - " \"Varna\",\n" + - " \"Veliko Turnovo\",\n" + - " \"Vidin\",\n" + - " \"Vratsa\",\n" + - " \"Yambol\"\n" + - " ]\n" + - " },\n" + - " {\n" + - " \"iso\": \"BHR\",\n" + - " \"code\": \"BH\",\n" + - " \"name\": \"Bahrain\",\n" + - " \"cities\": [\n" + - " \"Manama\",\n" + - " \"Al Hadd\",\n" + - " \"Al Manamah\",\n" + - " \"Al Mintaqah al Gharbiyah\",\n" + - " \"Al Mintaqah al Wusta\",\n" + - " \"Al Mintaqah ash Shamaliyah\",\n" + - " \"Al Muharraq\",\n" + - " \"Ar Rifa' wa al Mintaqah al Janubiyah\",\n" + - " \"Jidd Hafs\",\n" + - " \"Madinat Hamad\",\n" + - " \"Madinat 'Isa\",\n" + - " \"Juzur Hawar\",\n" + - " \"Sitrah\"\n" + - " ]\n" + - " },\n" + - " {\n" + - " \"iso\": \"BDI\",\n" + - " \"code\": \"BI\",\n" + - " \"name\": \"Burundi\",\n" + - " \"cities\": [\n" + - " \"Bujumbura\",\n" + - " \"Bubanza\",\n" + - " \"Bujumbura\",\n" + - " \"Bururi\",\n" + - " \"Cankuzo\",\n" + - " \"Cibitoke\",\n" + - " \"Gitega\",\n" + - " \"Karuzi\",\n" + - " \"Kayanza\",\n" + - " \"Kirundo\",\n" + - " \"Makamba\",\n" + - " \"Muramvya\",\n" + - " \"Muyinga\",\n" + - " \"Mwaro\",\n" + - " \"Ngozi\",\n" + - " \"Rutana\",\n" + - " \"Ruyigi\"\n" + - " ]\n" + - " },\n" + - " {\n" + - " \"iso\": \"BEN\",\n" + - " \"code\": \"BJ\",\n" + - " \"name\": \"Benin\",\n" + - " \"cities\": [\n" + - " \"Porto-Novo\",\n" + - " \"Alibori\",\n" + - " \"Atakora\",\n" + - " \"Atlantique\",\n" + - " \"Borgou\",\n" + - " \"Collines\",\n" + - " \"Couffo\",\n" + - " \"Donga\",\n" + - " \"Littoral\",\n" + - " \"Mono\",\n" + - " \"Oueme\",\n" + - " \"Plateau\",\n" + - " \"Zou\"\n" + - " ]\n" + - " },\n" + - " {\n" + - " \"iso\": \"BMU\",\n" + - " \"code\": \"BM\",\n" + - " \"name\": \"Bermuda\",\n" + - " \"cities\": [\n" + - " \"Hamilton\",\n" + - " \"Devonshire\",\n" + - " \"Hamilton\",\n" + - " \"Hamilton\",\n" + - " \"Paget\",\n" + - " \"Pembroke\",\n" + - " \"Saint George\",\n" + - " \"Saint George's\",\n" + - " \"Sandys\",\n" + - " \"Smith's\",\n" + - " \"Southampton\",\n" + - " \"Warwick\"\n" + - " ]\n" + - " },\n" + - " {\n" + - " \"iso\": \"BRN\",\n" + - " \"code\": \"BN\",\n" + - " \"name\": \"Brunei\",\n" + - " \"cities\": [\n" + - " \"Bandar Seri Begawan\",\n" + - " \"Belait\",\n" + - " \"Brunei/Muara\",\n" + - " \"Temburong\",\n" + - " \"Tutong\"\n" + - " ]\n" + - " },\n" + - " {\n" + - " \"iso\": \"BOL\",\n" + - " \"code\": \"BO\",\n" + - " \"name\": \"Bolivia\",\n" + - " \"cities\": [\n" + - " \"La Paz\",\n" + - " \"Sucre\",\n" + - " \"Chuquisaca\",\n" + - " \"Cochabamba\",\n" + - " \"Beni\",\n" + - " \"Oruro\",\n" + - " \"Pando\",\n" + - " \"Potosi\",\n" + - " \"Santa Cruz\",\n" + - " \"Tarija\"\n" + - " ]\n" + - " },\n" + - " {\n" + - " \"iso\": \"BRA\",\n" + - " \"code\": \"BR\",\n" + - " \"name\": \"Brazil\",\n" + - " \"cities\": [\n" + - " \"Brasilia\",\n" + - " \"Acre\",\n" + - " \"Alagoas\",\n" + - " \"Amapa\",\n" + - " \"Amazonas\",\n" + - " \"Bahia\",\n" + - " \"Ceara\",\n" + - " \"Distrito Federal\",\n" + - " \"Espirito Santo\",\n" + - " \"Goias\",\n" + - " \"Maranhao\",\n" + - " \"Mato Grosso\",\n" + - " \"Mato Grosso do Sul\",\n" + - " \"Minas Gerais\",\n" + - " \"Para\",\n" + - " \"Paraiba\",\n" + - " \"Parana\",\n" + - " \"Pernambuco\",\n" + - " \"Piaui\",\n" + - " \"Rio de Janeiro\",\n" + - " \"Rio Grande do Norte\",\n" + - " \"Rio Grande do Sul\",\n" + - " \"Rondonia\",\n" + - " \"Roraima\",\n" + - " \"Santa Catarina\",\n" + - " \"Sao Paulo\",\n" + - " \"Sergipe\",\n" + - " \"Tocantins\"\n" + - " ]\n" + - " },\n" + - " {\n" + - " \"iso\": \"BHS\",\n" + - " \"code\": \"BS\",\n" + - " \"name\": \"Bahamas\",\n" + - " \"cities\": [\n" + - " \"Nassau\",\n" + - " \"Acklins/Crooked Islands\",\n" + - " \"Bimini\",\n" + - " \"Cat Island\",\n" + - " \"Exuma\",\n" + - " \"Freeport\",\n" + - " \"Fresh Creek\",\n" + - " \"Governor's Harbour\",\n" + - " \"Green Turtle Cay\",\n" + - " \"Harbour Island\",\n" + - " \"High Rock\",\n" + - " \"Inagua\",\n" + - " \"Kemps Bay\",\n" + - " \"Long Island\",\n" + - " \"Marsh Harbour\",\n" + - " \"Mayaguana\",\n" + - " \"New Providence\",\n" + - " \"Nichollstown/Berry Islands\",\n" + - " \"Ragged Island\",\n" + - " \"Rock Sound\",\n" + - " \"Sandy Point\",\n" + - " \"San Salvador/Rum Cay\"\n" + - " ]\n" + - " },\n" + - " {\n" + - " \"iso\": \"BTN\",\n" + - " \"code\": \"BT\",\n" + - " \"name\": \"Bhutan\",\n" + - " \"cities\": [\n" + - " \"Thimphu\",\n" + - " \"Bumthang\",\n" + - " \"Chhukha\",\n" + - " \"Chirang\",\n" + - " \"Dagana\",\n" + - " \"Gasa\",\n" + - " \"Geylegphug\",\n" + - " \"Ha\",\n" + - " \"Lhuntshi\",\n" + - " \"Mongar\",\n" + - " \"Paro\",\n" + - " \"Pemagatsel\",\n" + - " \"Punakha\",\n" + - " \"Samchi\",\n" + - " \"Samdrup Jongkhar\",\n" + - " \"Shemgang\",\n" + - " \"Tashigang\",\n" + - " \"Tongsa\",\n" + - " \"Wangdi Phodrang\",\n" + - " \"Yangtse\"\n" + - " ]\n" + - " },\n" + - " {\n" + - " \"iso\": \"BWA\",\n" + - " \"code\": \"BW\",\n" + - " \"name\": \"Botswana\",\n" + - " \"cities\": [\n" + - " \"Gaborone\",\n" + - " \"Central\",\n" + - " \"Chobe\",\n" + - " \"Francistown\",\n" + - " \"Ghanzi\",\n" + - " \"Kgalagadi\",\n" + - " \"Kgatleng\",\n" + - " \"Kweneng\",\n" + - " \"Lobatse\",\n" + - " \"Ngamiland\",\n" + - " \"North-East\",\n" + - " \"Selebi-Pikwe\",\n" + - " \"South-East\",\n" + - " \"Southern\"\n" + - " ]\n" + - " },\n" + - " {\n" + - " \"iso\": \"BLR\",\n" + - " \"code\": \"BY\",\n" + - " \"name\": \"Belarus\",\n" + - " \"cities\": [\n" + - " \"Minsk\",\n" + - " \"Brest\",\n" + - " \"Homyel'\",\n" + - " \"Horad Minsk\",\n" + - " \"Hrodna\",\n" + - " \"Mahilyow\",\n" + - " \"Vitsyebsk\"\n" + - " ]\n" + - " },\n" + - " {\n" + - " \"iso\": \"BLZ\",\n" + - " \"code\": \"BZ\",\n" + - " \"name\": \"Belize\",\n" + - " \"cities\": [\n" + - " \"Belmopan\",\n" + - " \"Belize\",\n" + - " \"Cayo\",\n" + - " \"Corozal\",\n" + - " \"Orange Walk\",\n" + - " \"Stann Creek\",\n" + - " \"Toledo\"\n" + - " ]\n" + - " },\n" + - " {\n" + - " \"iso\": \"CAN\",\n" + - " \"code\": \"CA\",\n" + - " \"name\": \"Canada\",\n" + - " \"cities\": [\n" + - " \"Ottawa\",\n" + - " \"Alberta\",\n" + - " \"British Columbia\",\n" + - " \"Manitoba\",\n" + - " \"New Brunswick\",\n" + - " \"Newfoundland and Labrador\",\n" + - " \"Northwest Territories\",\n" + - " \"Nova Scotia\",\n" + - " \"Nunavut\",\n" + - " \"Ontario\",\n" + - " \"Prince Edward Island\",\n" + - " \"Quebec\",\n" + - " \"Saskatchewan\",\n" + - " \"Yukon Territory\"\n" + - " ]\n" + - " },\n" + - " {\n" + - " \"iso\": \"CAF\",\n" + - " \"code\": \"CF\",\n" + - " \"name\": \"Central African Republic\",\n" + - " \"cities\": [\n" + - " \"Bangui\",\n" + - " \"Bamingui-Bangoran\",\n" + - " \"Basse-Kotto\",\n" + - " \"Gribingui\",\n" + - " \"Haute-Kotto\",\n" + - " \"Haute-Sangha\",\n" + - " \"Haut-Mbomou\",\n" + - " \"Kemo-Gribingui\",\n" + - " \"Lobaye\",\n" + - " \"Mbomou\",\n" + - " \"Nana-Mambere\",\n" + - " \"Ombella-Mpoko\",\n" + - " \"Ouaka\",\n" + - " \"Ouham\",\n" + - " \"Ouham-Pende\",\n" + - " \"Sangha\",\n" + - " \"Vakaga\"\n" + - " ]\n" + - " },\n" + - " {\n" + - " \"iso\": \"CHE\",\n" + - " \"code\": \"CH\",\n" + - " \"name\": \"Switzerland\",\n" + - " \"cities\": [\n" + - " \"Bern\",\n" + - " \"Aargau\",\n" + - " \"Appenzell Ausser-Rhoden\",\n" + - " \"Appenzell Inner-Rhoden\",\n" + - " \"Basel-Landschaft\",\n" + - " \"Basel-Stadt\",\n" + - " \"Fribourg\",\n" + - " \"Geneve\",\n" + - " \"Glarus\",\n" + - " \"Graubunden\",\n" + - " \"Jura\",\n" + - " \"Luzern\",\n" + - " \"Neuchatel\",\n" + - " \"Nidwalden\",\n" + - " \"Obwalden\",\n" + - " \"Sankt Gallen\",\n" + - " \"Schaffhausen\",\n" + - " \"Schwyz\",\n" + - " \"Solothurn\",\n" + - " \"Thurgau\",\n" + - " \"Ticino\",\n" + - " \"Uri\",\n" + - " \"Valais\",\n" + - " \"Vaud\",\n" + - " \"Zug\",\n" + - " \"Zurich\"\n" + - " ]\n" + - " },\n" + - " {\n" + - " \"iso\": \"CHL\",\n" + - " \"code\": \"CL\",\n" + - " \"name\": \"Chile\",\n" + - " \"cities\": [\n" + - " \"Santiago\",\n" + - " \"Antofagasta\",\n" + - " \"Araucania\",\n" + - " \"Atacama\",\n" + - " \"Bio-Bio\",\n" + - " \"Coquimbo\",\n" + - " \"Los Lagos\",\n" + - " \"Maule\",\n" + - " \"Tarapaca\",\n" + - " \"Valparaiso\"\n" + - " ]\n" + - " },\n" + - " {\n" + - " \"iso\": \"CMR\",\n" + - " \"code\": \"CM\",\n" + - " \"name\": \"Cameroon\",\n" + - " \"cities\": [\n" + - " \"Yaounde\",\n" + - " \"Adamaoua\",\n" + - " \"Centre\",\n" + - " \"Est\",\n" + - " \"Extreme-Nord\",\n" + - " \"Littoral\",\n" + - " \"Nord\",\n" + - " \"Nord-Ouest\",\n" + - " \"Ouest\",\n" + - " \"Sud\",\n" + - " \"Sud-Ouest\"\n" + - " ]\n" + - " },\n" + - " {\n" + - " \"iso\": \"CHN\",\n" + - " \"code\": \"CN\",\n" + - " \"name\": \"China\",\n" + - " \"cities\": [\n" + - " \"Beijing\",\n" + - " \"Anhui\",\n" + - " \"Chongqing\",\n" + - " \"Fujian\",\n" + - " \"Gansu\",\n" + - " \"Guangdong\",\n" + - " \"Guangxi\",\n" + - " \"Guizhou\",\n" + - " \"Hainan\",\n" + - " \"Hebei\",\n" + - " \"Heilongjiang\",\n" + - " \"Henan\",\n" + - " \"Hubei\",\n" + - " \"Hunan\",\n" + - " \"Jiangsu\",\n" + - " \"Jiangxi\",\n" + - " \"Jilin\",\n" + - " \"Liaoning\",\n" + - " \"Nei Mongol\",\n" + - " \"Ningxia\",\n" + - " \"Qinghai\",\n" + - " \"Shaanxi\",\n" + - " \"Shandong\",\n" + - " \"Shanghai\",\n" + - " \"Shanxi\",\n" + - " \"Sichuan\",\n" + - " \"Tianjin\",\n" + - " \"Xinjiang\",\n" + - " \"Xizang (Tibet)\",\n" + - " \"Yunnan\",\n" + - " \"Zhejiang\"\n" + - " ]\n" + - " },\n" + - " {\n" + - " \"iso\": \"COL\",\n" + - " \"code\": \"CO\",\n" + - " \"name\": \"Colombia\",\n" + - " \"cities\": [\n" + - " \"Bogota\",\n" + - " \"Amazonas\",\n" + - " \"Antioquia\",\n" + - " \"Arauca\",\n" + - " \"Atlantico\",\n" + - " \"Bolivar\",\n" + - " \"Boyaca\",\n" + - " \"Caldas\",\n" + - " \"Caqueta\",\n" + - " \"Casanare\",\n" + - " \"Cauca\",\n" + - " \"Cesar\",\n" + - " \"Choco\",\n" + - " \"Cordoba\",\n" + - " \"Cundinamarca\",\n" + - " \"Guainia\",\n" + - " \"Guaviare\",\n" + - " \"Huila\",\n" + - " \"La Guajira\",\n" + - " \"Magdalena\",\n" + - " \"Meta\",\n" + - " \"Narino\",\n" + - " \"Norte de Santander\",\n" + - " \"Putumayo\",\n" + - " \"Quindio\",\n" + - " \"Risaralda\",\n" + - " \"San Andres/Providencia\",\n" + - " \"Santander\",\n" + - " \"Sucre\",\n" + - " \"Tolima\",\n" + - " \"Valle del Cauca\",\n" + - " \"Vaupes\",\n" + - " \"Vichada\"\n" + - " ]\n" + - " },\n" + - " {\n" + - " \"iso\": \"CRI\",\n" + - " \"code\": \"CR\",\n" + - " \"name\": \"Costa Rica\",\n" + - " \"cities\": [\n" + - " \"San Jose\",\n" + - " \"Alajuela\",\n" + - " \"Cartago\",\n" + - " \"Guanacaste\",\n" + - " \"Heredia\",\n" + - " \"Limon\",\n" + - " \"Puntarenas\"\n" + - " ]\n" + - " },\n" + - " {\n" + - " \"iso\": \"CUB\",\n" + - " \"code\": \"CU\",\n" + - " \"name\": \"Cuba\",\n" + - " \"cities\": [\n" + - " \"Havana\",\n" + - " \"Camaguey\",\n" + - " \"Ciego de Avila\",\n" + - " \"Cienfuegos\",\n" + - " \"Ciudad de La Habana\",\n" + - " \"Granma\",\n" + - " \"Guantanamo\",\n" + - " \"Holguin\",\n" + - " \"Isla de la Juventud\",\n" + - " \"La Habana\",\n" + - " \"Las Tunas\",\n" + - " \"Matanzas\",\n" + - " \"Pinar del Rio\",\n" + - " \"Sancti Spiritus\",\n" + - " \"Santiago de Cuba\",\n" + - " \"Villa Clara\"\n" + - " ]\n" + - " },\n" + - " {\n" + - " \"iso\": \"CPV\",\n" + - " \"code\": \"CV\",\n" + - " \"name\": \"Cape Verde\",\n" + - " \"cities\": [\n" + - " \"Praia\",\n" + - " \"Boa Vista\",\n" + - " \"Brava\",\n" + - " \"Calheta\",\n" + - " \"Maio\",\n" + - " \"Mosteiros\",\n" + - " \"Paul\",\n" + - " \"Porto Novo\",\n" + - " \"Ribeira Grande\",\n" + - " \"Sal\",\n" + - " \"Santa Catarina\",\n" + - " \"Santa Cruz\",\n" + - " \"Sao Domingos\",\n" + - " \"Sao Nicolau\",\n" + - " \"Sao Filipe\",\n" + - " \"Sao Vicente\",\n" + - " \"Tarrafal\"\n" + - " ]\n" + - " },\n" + - " {\n" + - " \"iso\": \"CYP\",\n" + - " \"code\": \"CY\",\n" + - " \"name\": \"Cyprus\",\n" + - " \"cities\": [\n" + - " \"Nicosia\",\n" + - " \"Famagusta\",\n" + - " \"Kyrenia\",\n" + - " \"Larnaca\",\n" + - " \"Limassol\",\n" + - " \"Paphos\"\n" + - " ]\n" + - " },\n" + - " {\n" + - " \"iso\": \"CZE\",\n" + - " \"code\": \"CZ\",\n" + - " \"name\": \"Czech Republic\",\n" + - " \"cities\": [\n" + - " \"Prague (Praha)\",\n" + - " \"Jihocesky\",\n" + - " \"Jihomoravsky\",\n" + - " \"Karlovarsky\",\n" + - " \"Kralovehradecky\",\n" + - " \"Liberecky\",\n" + - " \"Moravskoslezsky\",\n" + - " \"Olomoucky\",\n" + - " \"Pardubicky\",\n" + - " \"Plzensky\",\n" + - " \"Stredocesky\",\n" + - " \"Ustecky\",\n" + - " \"Vysocina\",\n" + - " \"Zlinsky\"\n" + - " ]\n" + - " },\n" + - " {\n" + - " \"iso\": \"DEU\",\n" + - " \"code\": \"DE\",\n" + - " \"name\": \"Germany\",\n" + - " \"cities\": [\n" + - " \"Berlin\",\n" + - " \"Baden-Wuerttemberg\",\n" + - " \"Bayern\",\n" + - " \"Berlin\",\n" + - " \"Brandenburg\",\n" + - " \"Bremen\",\n" + - " \"Hamburg\",\n" + - " \"Hessen\",\n" + - " \"Mecklenburg-Vorpommern\",\n" + - " \"Niedersachsen\",\n" + - " \"Nordrhein-Westfalen\",\n" + - " \"Rheinland-Pfalz\",\n" + - " \"Saarland\",\n" + - " \"Sachsen\",\n" + - " \"Sachsen-Anhalt\",\n" + - " \"Schleswig-Holstein\",\n" + - " \"Thueringen\"\n" + - " ]\n" + - " },\n" + - " {\n" + - " \"iso\": \"DJI\",\n" + - " \"code\": \"DJ\",\n" + - " \"name\": \"Djibouti\",\n" + - " \"cities\": [\n" + - " \"Djibouti\",\n" + - " \"'Ali Sabih\",\n" + - " \"Dikhil\",\n" + - " \"Obock\",\n" + - " \"Tadjoura\"\n" + - " ]\n" + - " },\n" + - " {\n" + - " \"iso\": \"DNK\",\n" + - " \"code\": \"DK\",\n" + - " \"name\": \"Denmark\",\n" + - " \"cities\": [\n" + - " \"Copenhagen (Kobenhavn)\",\n" + - " \"Arhus\",\n" + - " \"Bornholm\",\n" + - " \"Fredericksberg\",\n" + - " \"Frederiksborg\",\n" + - " \"Fyn\",\n" + - " \"Kobenhavns\",\n" + - " \"Nordjylland\",\n" + - " \"Ribe\",\n" + - " \"Ringkobing\",\n" + - " \"Roskilde\",\n" + - " \"Sonderjylland\",\n" + - " \"Storstrom\",\n" + - " \"Vejle\",\n" + - " \"Vestsjalland\",\n" + - " \"Viborg\"\n" + - " ]\n" + - " },\n" + - " {\n" + - " \"iso\": \"DMA\",\n" + - " \"code\": \"DM\",\n" + - " \"name\": \"Dominica\",\n" + - " \"cities\": [\n" + - " \"Roseau\",\n" + - " \"Saint Andrew\",\n" + - " \"Saint David\",\n" + - " \"Saint George\",\n" + - " \"Saint John\",\n" + - " \"Saint Joseph\",\n" + - " \"Saint Luke\",\n" + - " \"Saint Mark\",\n" + - " \"Saint Patrick\",\n" + - " \"Saint Paul\",\n" + - " \"Saint Peter\"\n" + - " ]\n" + - " }\n" + - " ]\n" + - "}"; - private static final String CURRENCIES_JSON = "{\n" + - " \"currencies\": [\n" + - " {\n" + - " \"currencyCode\": \"AED\",\n" + - " \"displayName\": \"United Arab Emirates Dirham\",\n" + - " \"numericCode\": 784,\n" + - " \"symbol\": \"AED\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"JOD\",\n" + - " \"displayName\": \"Jordanian Dinar\",\n" + - " \"numericCode\": 400,\n" + - " \"symbol\": \"JOD\",\n" + - " \"defaultFractionDigits\": 3\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"SYP\",\n" + - " \"displayName\": \"Syrian Pound\",\n" + - " \"numericCode\": 760,\n" + - " \"symbol\": \"SYP\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"HRK\",\n" + - " \"displayName\": \"Kuna\",\n" + - " \"numericCode\": 191,\n" + - " \"symbol\": \"HRK\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"EUR\",\n" + - " \"displayName\": \"Euro\",\n" + - " \"numericCode\": 978,\n" + - " \"symbol\": \"EUR\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"PAB\",\n" + - " \"displayName\": \"Panamanian Balboa\",\n" + - " \"numericCode\": 590,\n" + - " \"symbol\": \"PAB\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"EUR\",\n" + - " \"displayName\": \"Euro\",\n" + - " \"numericCode\": 978,\n" + - " \"symbol\": \"EUR\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"VEF\",\n" + - " \"displayName\": \"Venezuelan BolÃ\u00ADvar\",\n" + - " \"numericCode\": 937,\n" + - " \"symbol\": \"VEF\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"TWD\",\n" + - " \"displayName\": \"New Taiwan Dollar\",\n" + - " \"numericCode\": 901,\n" + - " \"symbol\": \"TWD\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"DKK\",\n" + - " \"displayName\": \"Danish Krone\",\n" + - " \"numericCode\": 208,\n" + - " \"symbol\": \"DKK\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"USD\",\n" + - " \"displayName\": \"US Dollar\",\n" + - " \"numericCode\": 840,\n" + - " \"symbol\": \"$\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"VND\",\n" + - " \"displayName\": \"Vietnamese Dong\",\n" + - " \"numericCode\": 704,\n" + - " \"symbol\": \"VND\",\n" + - " \"defaultFractionDigits\": 0\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"USD\",\n" + - " \"displayName\": \"US Dollar\",\n" + - " \"numericCode\": 840,\n" + - " \"symbol\": \"$\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"EUR\",\n" + - " \"displayName\": \"Euro\",\n" + - " \"numericCode\": 978,\n" + - " \"symbol\": \"EUR\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"SEK\",\n" + - " \"displayName\": \"Swedish Krona\",\n" + - " \"numericCode\": 752,\n" + - " \"symbol\": \"SEK\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"BOB\",\n" + - " \"displayName\": \"Bolivian Boliviano\",\n" + - " \"numericCode\": 68,\n" + - " \"symbol\": \"BOB\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"SGD\",\n" + - " \"displayName\": \"Singapore Dollar\",\n" + - " \"numericCode\": 702,\n" + - " \"symbol\": \"SGD\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"BHD\",\n" + - " \"displayName\": \"Bahraini Dinar\",\n" + - " \"numericCode\": 48,\n" + - " \"symbol\": \"BHD\",\n" + - " \"defaultFractionDigits\": 3\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"SAR\",\n" + - " \"displayName\": \"Saudi Riyal\",\n" + - " \"numericCode\": 682,\n" + - " \"symbol\": \"SAR\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"YER\",\n" + - " \"displayName\": \"Yemeni Rial\",\n" + - " \"numericCode\": 886,\n" + - " \"symbol\": \"YER\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"INR\",\n" + - " \"displayName\": \"Indian Rupee\",\n" + - " \"numericCode\": 356,\n" + - " \"symbol\": \"INR\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"EUR\",\n" + - " \"displayName\": \"Euro\",\n" + - " \"numericCode\": 978,\n" + - " \"symbol\": \"EUR\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"EUR\",\n" + - " \"displayName\": \"Euro\",\n" + - " \"numericCode\": 978,\n" + - " \"symbol\": \"EUR\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"BAM\",\n" + - " \"displayName\": \"Bosnia-Herzegovina Convertible Mark\",\n" + - " \"numericCode\": 977,\n" + - " \"symbol\": \"BAM\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"UAH\",\n" + - " \"displayName\": \"Ukrainian Hryvnia\",\n" + - " \"numericCode\": 980,\n" + - " \"symbol\": \"UAH\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"CHF\",\n" + - " \"displayName\": \"Swiss Franc\",\n" + - " \"numericCode\": 756,\n" + - " \"symbol\": \"CHF\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"ARS\",\n" + - " \"displayName\": \"Argentine Peso\",\n" + - " \"numericCode\": 32,\n" + - " \"symbol\": \"ARS\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"EGP\",\n" + - " \"displayName\": \"Egyptian Pound\",\n" + - " \"numericCode\": 818,\n" + - " \"symbol\": \"EGP\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"JPY\",\n" + - " \"displayName\": \"Japanese Yen\",\n" + - " \"numericCode\": 392,\n" + - " \"symbol\": \"JPY\",\n" + - " \"defaultFractionDigits\": 0\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"SVC\",\n" + - " \"displayName\": \"Salvadoran Colón\",\n" + - " \"numericCode\": 222,\n" + - " \"symbol\": \"SVC\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"BRL\",\n" + - " \"displayName\": \"Brazilian Real\",\n" + - " \"numericCode\": 986,\n" + - " \"symbol\": \"BRL\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"ISK\",\n" + - " \"displayName\": \"Icelandic Króna\",\n" + - " \"numericCode\": 352,\n" + - " \"symbol\": \"ISK\",\n" + - " \"defaultFractionDigits\": 0\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"CZK\",\n" + - " \"displayName\": \"Czech Republic Koruna\",\n" + - " \"numericCode\": 203,\n" + - " \"symbol\": \"CZK\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"PLN\",\n" + - " \"displayName\": \"Polish Zloty\",\n" + - " \"numericCode\": 985,\n" + - " \"symbol\": \"PLN\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"EUR\",\n" + - " \"displayName\": \"Euro\",\n" + - " \"numericCode\": 978,\n" + - " \"symbol\": \"EUR\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"CSD\",\n" + - " \"displayName\": \"Serbian Dinar (2002-2006)\",\n" + - " \"numericCode\": 891,\n" + - " \"symbol\": \"CSD\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"MYR\",\n" + - " \"displayName\": \"Malaysian Ringgit\",\n" + - " \"numericCode\": 458,\n" + - " \"symbol\": \"MYR\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"EUR\",\n" + - " \"displayName\": \"Euro\",\n" + - " \"numericCode\": 978,\n" + - " \"symbol\": \"EUR\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"COP\",\n" + - " \"displayName\": \"Colombian Peso\",\n" + - " \"numericCode\": 170,\n" + - " \"symbol\": \"COP\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"BGN\",\n" + - " \"displayName\": \"Bulgarian Lev\",\n" + - " \"numericCode\": 975,\n" + - " \"symbol\": \"BGN\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"BAM\",\n" + - " \"displayName\": \"Bosnia-Herzegovina Convertible Mark\",\n" + - " \"numericCode\": 977,\n" + - " \"symbol\": \"BAM\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"PYG\",\n" + - " \"displayName\": \"Paraguayan Guarani\",\n" + - " \"numericCode\": 600,\n" + - " \"symbol\": \"PYG\",\n" + - " \"defaultFractionDigits\": 0\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"USD\",\n" + - " \"displayName\": \"US Dollar\",\n" + - " \"numericCode\": 840,\n" + - " \"symbol\": \"$\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"USD\",\n" + - " \"displayName\": \"US Dollar\",\n" + - " \"numericCode\": 840,\n" + - " \"symbol\": \"$\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"SDG\",\n" + - " \"displayName\": \"Sudanese Pound\",\n" + - " \"numericCode\": 938,\n" + - " \"symbol\": \"SDG\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"RON\",\n" + - " \"displayName\": \"Romanian Leu\",\n" + - " \"numericCode\": 946,\n" + - " \"symbol\": \"RON\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"PHP\",\n" + - " \"displayName\": \"Philippine Peso\",\n" + - " \"numericCode\": 608,\n" + - " \"symbol\": \"PHP\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"TND\",\n" + - " \"displayName\": \"Tunisian Dinar\",\n" + - " \"numericCode\": 788,\n" + - " \"symbol\": \"TND\",\n" + - " \"defaultFractionDigits\": 3\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"EUR\",\n" + - " \"displayName\": \"Euro\",\n" + - " \"numericCode\": 978,\n" + - " \"symbol\": \"EUR\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"GTQ\",\n" + - " \"displayName\": \"Guatemalan Quetzal\",\n" + - " \"numericCode\": 320,\n" + - " \"symbol\": \"GTQ\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"KRW\",\n" + - " \"displayName\": \"South Korean Won\",\n" + - " \"numericCode\": 410,\n" + - " \"symbol\": \"KRW\",\n" + - " \"defaultFractionDigits\": 0\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"EUR\",\n" + - " \"displayName\": \"Euro\",\n" + - " \"numericCode\": 978,\n" + - " \"symbol\": \"EUR\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"MXN\",\n" + - " \"displayName\": \"Mexican Peso\",\n" + - " \"numericCode\": 484,\n" + - " \"symbol\": \"MXN\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"RUB\",\n" + - " \"displayName\": \"Russian Ruble\",\n" + - " \"numericCode\": 643,\n" + - " \"symbol\": \"RUB\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"HNL\",\n" + - " \"displayName\": \"Honduran Lempira\",\n" + - " \"numericCode\": 340,\n" + - " \"symbol\": \"HNL\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"HKD\",\n" + - " \"displayName\": \"Hong Kong Dollar\",\n" + - " \"numericCode\": 344,\n" + - " \"symbol\": \"HKD\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"NOK\",\n" + - " \"displayName\": \"Norwegian Krone\",\n" + - " \"numericCode\": 578,\n" + - " \"symbol\": \"NOK\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"HUF\",\n" + - " \"displayName\": \"Hungarian Forint\",\n" + - " \"numericCode\": 348,\n" + - " \"symbol\": \"HUF\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"THB\",\n" + - " \"displayName\": \"Thai Baht\",\n" + - " \"numericCode\": 764,\n" + - " \"symbol\": \"THB\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"IQD\",\n" + - " \"displayName\": \"Iraqi Dinar\",\n" + - " \"numericCode\": 368,\n" + - " \"symbol\": \"IQD\",\n" + - " \"defaultFractionDigits\": 3\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"CLP\",\n" + - " \"displayName\": \"Chilean Peso\",\n" + - " \"numericCode\": 152,\n" + - " \"symbol\": \"CLP\",\n" + - " \"defaultFractionDigits\": 0\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"MAD\",\n" + - " \"displayName\": \"Moroccan Dirham\",\n" + - " \"numericCode\": 504,\n" + - " \"symbol\": \"MAD\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"EUR\",\n" + - " \"displayName\": \"Euro\",\n" + - " \"numericCode\": 978,\n" + - " \"symbol\": \"EUR\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"TRY\",\n" + - " \"displayName\": \"Turkish Lira\",\n" + - " \"numericCode\": 949,\n" + - " \"symbol\": \"TRY\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"EUR\",\n" + - " \"displayName\": \"Euro\",\n" + - " \"numericCode\": 978,\n" + - " \"symbol\": \"EUR\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"QAR\",\n" + - " \"displayName\": \"Qatari Rial\",\n" + - " \"numericCode\": 634,\n" + - " \"symbol\": \"QAR\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"EUR\",\n" + - " \"displayName\": \"Euro\",\n" + - " \"numericCode\": 978,\n" + - " \"symbol\": \"EUR\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"EUR\",\n" + - " \"displayName\": \"Euro\",\n" + - " \"numericCode\": 978,\n" + - " \"symbol\": \"EUR\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"OMR\",\n" + - " \"displayName\": \"Omani Rial\",\n" + - " \"numericCode\": 512,\n" + - " \"symbol\": \"OMR\",\n" + - " \"defaultFractionDigits\": 3\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"ALL\",\n" + - " \"displayName\": \"Albanian Lek\",\n" + - " \"numericCode\": 8,\n" + - " \"symbol\": \"ALL\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"DOP\",\n" + - " \"displayName\": \"Dominican Peso\",\n" + - " \"numericCode\": 214,\n" + - " \"symbol\": \"DOP\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"CUP\",\n" + - " \"displayName\": \"Cuban Peso\",\n" + - " \"numericCode\": 192,\n" + - " \"symbol\": \"CUP\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"NZD\",\n" + - " \"displayName\": \"New Zealand Dollar\",\n" + - " \"numericCode\": 554,\n" + - " \"symbol\": \"NZD\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"RSD\",\n" + - " \"displayName\": \"Serbian Dinar\",\n" + - " \"numericCode\": 941,\n" + - " \"symbol\": \"RSD\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"CHF\",\n" + - " \"displayName\": \"Swiss Franc\",\n" + - " \"numericCode\": 756,\n" + - " \"symbol\": \"CHF\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"UYU\",\n" + - " \"displayName\": \"Uruguayan Peso\",\n" + - " \"numericCode\": 858,\n" + - " \"symbol\": \"UYU\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"EUR\",\n" + - " \"displayName\": \"Euro\",\n" + - " \"numericCode\": 978,\n" + - " \"symbol\": \"EUR\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"ILS\",\n" + - " \"displayName\": \"Israeli New Sheqel\",\n" + - " \"numericCode\": 376,\n" + - " \"symbol\": \"ILS\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"ZAR\",\n" + - " \"displayName\": \"South African Rand\",\n" + - " \"numericCode\": 710,\n" + - " \"symbol\": \"ZAR\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"THB\",\n" + - " \"displayName\": \"Thai Baht\",\n" + - " \"numericCode\": 764,\n" + - " \"symbol\": \"THB\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"EUR\",\n" + - " \"displayName\": \"Euro\",\n" + - " \"numericCode\": 978,\n" + - " \"symbol\": \"EUR\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"EUR\",\n" + - " \"displayName\": \"Euro\",\n" + - " \"numericCode\": 978,\n" + - " \"symbol\": \"EUR\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"NOK\",\n" + - " \"displayName\": \"Norwegian Krone\",\n" + - " \"numericCode\": 578,\n" + - " \"symbol\": \"NOK\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"AUD\",\n" + - " \"displayName\": \"Australian Dollar\",\n" + - " \"numericCode\": 36,\n" + - " \"symbol\": \"AUD\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"EUR\",\n" + - " \"displayName\": \"Euro\",\n" + - " \"numericCode\": 978,\n" + - " \"symbol\": \"EUR\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"CAD\",\n" + - " \"displayName\": \"Canadian Dollar\",\n" + - " \"numericCode\": 124,\n" + - " \"symbol\": \"CAD\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"EUR\",\n" + - " \"displayName\": \"Euro\",\n" + - " \"numericCode\": 978,\n" + - " \"symbol\": \"EUR\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"EUR\",\n" + - " \"displayName\": \"Euro\",\n" + - " \"numericCode\": 978,\n" + - " \"symbol\": \"EUR\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"CRC\",\n" + - " \"displayName\": \"Costa Rican Colón\",\n" + - " \"numericCode\": 188,\n" + - " \"symbol\": \"CRC\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"KWD\",\n" + - " \"displayName\": \"Kuwaiti Dinar\",\n" + - " \"numericCode\": 414,\n" + - " \"symbol\": \"KWD\",\n" + - " \"defaultFractionDigits\": 3\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"LYD\",\n" + - " \"displayName\": \"Libyan Dinar\",\n" + - " \"numericCode\": 434,\n" + - " \"symbol\": \"LYD\",\n" + - " \"defaultFractionDigits\": 3\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"CHF\",\n" + - " \"displayName\": \"Swiss Franc\",\n" + - " \"numericCode\": 756,\n" + - " \"symbol\": \"CHF\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"EUR\",\n" + - " \"displayName\": \"Euro\",\n" + - " \"numericCode\": 978,\n" + - " \"symbol\": \"EUR\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"DZD\",\n" + - " \"displayName\": \"Algerian Dinar\",\n" + - " \"numericCode\": 12,\n" + - " \"symbol\": \"DZD\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"EUR\",\n" + - " \"displayName\": \"Euro\",\n" + - " \"numericCode\": 978,\n" + - " \"symbol\": \"EUR\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"EUR\",\n" + - " \"displayName\": \"Euro\",\n" + - " \"numericCode\": 978,\n" + - " \"symbol\": \"EUR\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"EUR\",\n" + - " \"displayName\": \"Euro\",\n" + - " \"numericCode\": 978,\n" + - " \"symbol\": \"EUR\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"EUR\",\n" + - " \"displayName\": \"Euro\",\n" + - " \"numericCode\": 978,\n" + - " \"symbol\": \"EUR\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"SGD\",\n" + - " \"displayName\": \"Singapore Dollar\",\n" + - " \"numericCode\": 702,\n" + - " \"symbol\": \"SGD\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"CAD\",\n" + - " \"displayName\": \"Canadian Dollar\",\n" + - " \"numericCode\": 124,\n" + - " \"symbol\": \"CAD\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"EUR\",\n" + - " \"displayName\": \"Euro\",\n" + - " \"numericCode\": 978,\n" + - " \"symbol\": \"EUR\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"CNY\",\n" + - " \"displayName\": \"Chinese Yuan\",\n" + - " \"numericCode\": 156,\n" + - " \"symbol\": \"CNY\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"JPY\",\n" + - " \"displayName\": \"Japanese Yen\",\n" + - " \"numericCode\": 392,\n" + - " \"symbol\": \"JPY\",\n" + - " \"defaultFractionDigits\": 0\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"EUR\",\n" + - " \"displayName\": \"Euro\",\n" + - " \"numericCode\": 978,\n" + - " \"symbol\": \"EUR\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"RSD\",\n" + - " \"displayName\": \"Serbian Dinar\",\n" + - " \"numericCode\": 941,\n" + - " \"symbol\": \"RSD\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"INR\",\n" + - " \"displayName\": \"Indian Rupee\",\n" + - " \"numericCode\": 356,\n" + - " \"symbol\": \"INR\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"LBP\",\n" + - " \"displayName\": \"Lebanese Pound\",\n" + - " \"numericCode\": 422,\n" + - " \"symbol\": \"LBP\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"NIO\",\n" + - " \"displayName\": \"Nicaraguan Córdoba\",\n" + - " \"numericCode\": 558,\n" + - " \"symbol\": \"NIO\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"MKD\",\n" + - " \"displayName\": \"Macedonian Denar\",\n" + - " \"numericCode\": 807,\n" + - " \"symbol\": \"MKD\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"BYN\",\n" + - " \"displayName\": \"Belarusian Ruble\",\n" + - " \"numericCode\": 933,\n" + - " \"symbol\": \"BYN\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"EUR\",\n" + - " \"displayName\": \"Euro\",\n" + - " \"numericCode\": 978,\n" + - " \"symbol\": \"EUR\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"PEN\",\n" + - " \"displayName\": \"Peruvian Sol\",\n" + - " \"numericCode\": 604,\n" + - " \"symbol\": \"PEN\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"IDR\",\n" + - " \"displayName\": \"Indonesian Rupiah\",\n" + - " \"numericCode\": 360,\n" + - " \"symbol\": \"IDR\",\n" + - " \"defaultFractionDigits\": 2\n" + - " },\n" + - " {\n" + - " \"currencyCode\": \"GBP\",\n" + - " \"displayName\": \"British Pound Sterling\",\n" + - " \"numericCode\": 826,\n" + - " \"symbol\": \"GBP\",\n" + - " \"defaultFractionDigits\": 2\n" + - " }\n" + - " ]\n" + - "}"; - private static final String PROFILE_JSON = "{\"id\":\"1\",\"name\":\"Progressoft corp.\",\"code\":\"PSF\",\"reference\":\"PSFT\",\"address\":{\"id\":\"1\",\"countryISOCode\":\"OM\",\"city\":\"Muscat\",\"street\":\"street\",\"zipCode\":\"MSS\",\"apartment\":\"apartment\",\"mailBox\":\"mailBox\",\"phoneNumber\":\"1234567\",\"faxNumber\":\"12345678\"},\"corporateAccounts\":[{\"accountAccessibility\":\"OUT\",\"accountType\":\"SAVING\",\"currency\":{\"currencyCode\":\"KWD\",\"defaultFractionDigits\":3,\"numericCode\":414},\"iban\":\"AB89ABCD0000000000009235351490\",\"accountAlias\":\"LG.Inc\",\"accountNumber\":\"0000000000009235351490\"},{\"accountAccessibility\":\"IN\",\"accountType\":\"SAVING\",\"currency\":{\"currencyCode\":\"KWD\",\"defaultFractionDigits\":3,\"numericCode\":414},\"iban\":\"AB62ABCD0000000000009235351491\",\"accountAlias\":\"Hewlett-Packard\",\"accountNumber\":\"0000000000009235351491\"},{\"accountAccessibility\":\"OUT\",\"accountType\":\"SAVING\",\"currency\":{\"currencyCode\":\"KWD\",\"defaultFractionDigits\":3,\"numericCode\":414},\"iban\":\"AB35ABCD0000000000009235351492\",\"accountAlias\":\"Progressoft\",\"accountNumber\":\"0000000000009235351492\"},{\"accountAccessibility\":\"IN_OUT\",\"accountType\":\"SAVING\",\"currency\":{\"currencyCode\":\"KWD\",\"defaultFractionDigits\":3,\"numericCode\":414},\"iban\":\"AB08ABCD0000000000009235351493\",\"accountAlias\":\"Netflix\",\"accountNumber\":\"0000000000009235351493\"},{\"accountAccessibility\":\"OUT\",\"accountType\":\"SAVING\",\"currency\":{\"currencyCode\":\"KWD\",\"defaultFractionDigits\":3,\"numericCode\":414},\"iban\":\"AB78ABCD0000000000009235351494\",\"accountAlias\":\"Amazon\",\"accountNumber\":\"0000000000009235351494\"},{\"accountAccessibility\":\"IN\",\"accountType\":\"SAVING\",\"currency\":{\"currencyCode\":\"KWD\",\"defaultFractionDigits\":3,\"numericCode\":414},\"iban\":\"AB51ABCD0000000000009235351495\",\"accountAlias\":\"Google\",\"accountNumber\":\"0000000000009235351495\"},{\"accountAccessibility\":\"IN\",\"accountType\":\"SAVING\",\"currency\":{\"currencyCode\":\"KWD\",\"defaultFractionDigits\":3,\"numericCode\":414},\"iban\":\"AB24ABCD0000000000009235351496\",\"accountAlias\":\"Versend\",\"accountNumber\":\"0000000000009235351496\"},{\"accountAccessibility\":\"IN_OUT\",\"accountType\":\"SAVING\",\"currency\":{\"currencyCode\":\"KWD\",\"defaultFractionDigits\":3,\"numericCode\":414},\"iban\":\"AB94ABCD0000000000009235351497\",\"accountAlias\":\"Aramex\",\"accountNumber\":\"0000000000009235351497\"}],\"banks\":[{\"name\":\"Bank ABC\",\"swiftCode\":\"ABCDEFGHXXX\",\"shortName\":\"S.A.O.J\",\"branches\":[{\"name\":\"Muscat\",\"address\":{\"id\":\"2\",\"countryISOCode\":\"OM\",\"city\":\"Muscat\",\"street\":\"street\",\"zipCode\":\"MSS\",\"apartment\":\"apartment\",\"mailBox\":\"mailBox\",\"phoneNumber\":\"1235898\",\"faxNumber\":\"36465141\"},\"contactPerson\":{\"name\":\"Hadil-Muscat\",\"mobileNumber\":\"9843358717\",\"email\":\"noman.mail@compay.com\"}},{\"name\":\"HeadQuater\",\"address\":{\"id\":\"1\",\"countryISOCode\":\"OM\",\"city\":\"Muscat\",\"street\":\"street\",\"zipCode\":\"MSS\",\"apartment\":\"apartment\",\"mailBox\":\"mailBox\",\"phoneNumber\":\"1235898\",\"faxNumber\":\"36465141\"},\"contactPerson\":{\"name\":\"Hadil\",\"mobileNumber\":\"9843358716\",\"email\":\"noman@company.com\"}}]}],\"contactPerson\":null}"; - private HTMLDivElement element; - - private CorporateProfile corporateProfile; - private List countries; - private List beneficiaries; - private List banks; - private List currencies; - private AddLCImportComponent addLCImportComponent; - private FormSamplesUIHandlers uiHandlers; - - @Override - protected HTMLDivElement init() { - element = div().css("content-margin").element(); - Scheduler.get().scheduleDeferred(() -> { - this.corporateProfile = CorporateProfile.MAPPER.read(PROFILE_JSON); - this.countries = Countries.MAPPER.read(COUNTRIES_JSON).getCountries(); - this.beneficiaries = Arrays.asList(Beneficiary.MAPPER.readArray(BENEFICIARIES_JSON.replace("countryIsoCode", "countryISOCode"), Beneficiary[]::new)); - this.banks = Arrays.asList(Bank.MAPPER.readArray(BANKS_JSON, Bank[]::new)); - this.currencies = Currencies.MAPPER.read(CURRENCIES_JSON).getCurrencies(); - - reBuildForm(); - - }); - - return element; - } - - @Override - public void onSuccessCreate(String bodyAsString) { - MessageDialog.createMessage("LOC import has been created successfully " + bodyAsString + "") - .success() - .open(); - } - - @Override - public void onErrorCreate(String errorMessage) { - MessageDialog.createMessage("Error while creating LOC import [ " + errorMessage + " ]") - .error() - .open(); - } - - private void reBuildForm() { - ElementUtil.clear(element); - element.appendChild(LinkToSourceCode.create("formsamples", this.getClass()).element()); - addLCImportComponent = new AddLCImportComponent(corporateProfile, countries, beneficiaries, banks, currencies); - addLCImportComponent.setUiHandlers(this.uiHandlers); - element.appendChild(addLCImportComponent.element()); - } - - @Override - public void setUiHandlers(FormSamplesUIHandlers uiHandlers) { - this.uiHandlers = uiHandlers; - } - - @Override - public void startLoading() { - - } - - @Override - public void stopLoading() { - - } - - @Override - public void onCreate(LetterOfCredit letterOfCredit) { - MessageDialog.createMessage("Your item created.") - .success() - .addCloseListener(() -> { - ElementUtil.scrollTop(); - reBuildForm(); - }) - .open(); - } -} \ No newline at end of file diff --git a/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/section/AccountDetails.java b/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/section/AccountDetails.java deleted file mode 100644 index 8380ef95..00000000 --- a/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/section/AccountDetails.java +++ /dev/null @@ -1,56 +0,0 @@ -package org.dominokit.domino.formsamples.client.views.ui.section; - -import elemental2.dom.HTMLDivElement; -import org.dominokit.domino.formsamples.shared.model.CorporateAccount; -import org.dominokit.domino.ui.forms.TextBox; -import org.dominokit.domino.ui.grid.Column; -import org.dominokit.domino.ui.grid.Row; -import org.dominokit.domino.ui.icons.lib.Icons; -import org.jboss.elemento.IsElement; - -public final class AccountDetails implements IsElement { - - private TextBox accountNumberHeader; - private TextBox ibanHeader; - private TextBox currencyHeader; - private HTMLDivElement element; - - public AccountDetails() { - accountNumberHeader = TextBox.create("Account number") - .addLeftAddOn(Icons.wallet()) - .setReadOnly(true); - - ibanHeader = TextBox.create("IBAN") - .addLeftAddOn(Icons.code_array()) - .setReadOnly(true); - - currencyHeader = TextBox.create("Currency") - .addLeftAddOn(Icons.home_currency_usd()) - .setReadOnly(true); - - element = Row.create() - .style() - .setPaddingTop("20px") - .get() - .addColumn(Column.span12() - .appendChild(accountNumberHeader) - ) - .addColumn(Column.span12() - .appendChild(ibanHeader) - ) - .addColumn(Column.span12() - .appendChild(currencyHeader) - ).element(); - } - - @Override - public HTMLDivElement element() { - return element; - } - - public void setAccount(CorporateAccount account) { - accountNumberHeader.setValue(account.getAccountNumber()); - ibanHeader.setValue(account.getIban()); - currencyHeader.setValue(account.getCurrency().getCurrencyCode()); - } -} diff --git a/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/section/ApplicantSection.java b/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/section/ApplicantSection.java deleted file mode 100644 index 57b0c1e1..00000000 --- a/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/section/ApplicantSection.java +++ /dev/null @@ -1,128 +0,0 @@ -package org.dominokit.domino.formsamples.client.views.ui.section; - -import elemental2.dom.HTMLDivElement; -import elemental2.dom.HTMLElement; -import org.dominokit.domino.formsamples.shared.model.Applicant; -import org.dominokit.domino.formsamples.shared.model.CollateralSettlementAccount; -import org.dominokit.domino.formsamples.shared.model.CorporateAccount; -import org.dominokit.domino.formsamples.shared.model.CorporateProfile; -import org.dominokit.domino.formsamples.shared.model.FeesAndChargesSettlementAccount; -import org.dominokit.domino.formsamples.shared.model.LcSettlementAccount; -import org.dominokit.domino.formsamples.shared.model.LetterOfCredit; -import org.dominokit.domino.ui.cards.Card; -import org.dominokit.domino.ui.forms.FieldsGrouping; -import org.dominokit.domino.ui.forms.Select; -import org.dominokit.domino.ui.grid.Column; -import org.dominokit.domino.ui.grid.Row; -import org.dominokit.domino.ui.header.BlockHeader; - -import static org.dominokit.domino.formsamples.client.views.ui.CustomElements.isInvalidatedCard; -import static org.dominokit.domino.formsamples.client.views.ui.CustomElements.markCardValidation; -import static org.jboss.elemento.Elements.div; - -public class ApplicantSection implements ImportSection { - - private CorporateAccountsSelect lcSettlementAccountsSelect; - private CorporateAccountsSelect collateralSettlementAccountsSelect; - private CorporateAccountsSelect feesAndChargesAccountsSelect; - private HTMLDivElement element = div().element(); - private final Card card; - private FieldsGrouping fieldsGrouping = FieldsGrouping.create(); - - public ApplicantSection(CorporateProfile corporateProfile) { - element.appendChild(BlockHeader.create("Buyer (Applicant) *").element()); - lcSettlementAccountsSelect = CorporateAccountsSelect.create("LC settlement accounts", corporateProfile); - collateralSettlementAccountsSelect = CorporateAccountsSelect.create("Collateral settlement accounts", corporateProfile); - feesAndChargesAccountsSelect = CorporateAccountsSelect.create("Fees and charges accounts", corporateProfile); - - card = Card.create(); - - Select.SelectionHandler corporateAccountSelectionHandler = option -> { - if(isInvalidatedCard(card) && fieldsGrouping.validate().isValid()){ - markCardValidation(card, true, false); - } - }; - - lcSettlementAccountsSelect.getAccountSelect() - .setRequired(true) - .setAutoValidation(true) - .groupBy(fieldsGrouping) - .addSelectionHandler(corporateAccountSelectionHandler); - - collateralSettlementAccountsSelect.getAccountSelect() - .setRequired(true) - .setAutoValidation(true) - .groupBy(fieldsGrouping) - .addSelectionHandler(corporateAccountSelectionHandler); - - feesAndChargesAccountsSelect.getAccountSelect() - .setRequired(true) - .setAutoValidation(true) - .groupBy(fieldsGrouping) - .addSelectionHandler(corporateAccountSelectionHandler); - - - element.appendChild(card - .style() - .setPaddingTop("20px") - .get() - .appendChild(Row.create() - .addColumn(Column.span4() - .appendChild(lcSettlementAccountsSelect) - ) - .addColumn(Column.span4() - .appendChild(collateralSettlementAccountsSelect) - ).addColumn(Column.span4() - .appendChild(feesAndChargesAccountsSelect) - ) - ) - .element()); - } - - @Override - public boolean validate() { - boolean valid = fieldsGrouping.validate().isValid(); - markCardValidation(card, valid); - return valid; - } - - @Override - public void collect(LetterOfCredit letterOfCredit) { - Applicant applicant = letterOfCredit.getApplicant(); - setLcAccount(applicant); - setCollateralAccount(applicant); - setFeesAndChargesAccount(applicant); - } - - private void setFeesAndChargesAccount(Applicant applicant) { - FeesAndChargesSettlementAccount feesAndChargesSettlementAccount = new FeesAndChargesSettlementAccount(); - CorporateAccount feesAndChargesAccount = feesAndChargesAccountsSelect.getAccountSelect().getValue(); - feesAndChargesSettlementAccount.setAccountAlias(feesAndChargesAccount.getAccountAlias()); - feesAndChargesSettlementAccount.setAccountNumber(feesAndChargesAccount.getAccountNumber()); - feesAndChargesSettlementAccount.setIban(feesAndChargesAccount.getIban()); - applicant.setFeesAndChargesSettlementAccount(feesAndChargesSettlementAccount); - } - - private void setCollateralAccount(Applicant applicant) { - CollateralSettlementAccount collateralSettlementAccount = new CollateralSettlementAccount(); - CorporateAccount collateralAccount = collateralSettlementAccountsSelect.getAccountSelect().getValue(); - collateralSettlementAccount.setAccountAlias(collateralAccount.getAccountAlias()); - collateralSettlementAccount.setAccountNumber(collateralAccount.getAccountNumber()); - collateralSettlementAccount.setIban(collateralAccount.getIban()); - applicant.setCollateralSettlementAccount(collateralSettlementAccount); - } - - private void setLcAccount(Applicant applicant) { - LcSettlementAccount lcSettlementAccount = new LcSettlementAccount(); - CorporateAccount lcAccount = lcSettlementAccountsSelect.getAccountSelect().getValue(); - lcSettlementAccount.setAccountAlias(lcAccount.getAccountAlias()); - lcSettlementAccount.setAccountNumber(lcAccount.getAccountNumber()); - lcSettlementAccount.setIban(lcAccount.getIban()); - applicant.setLcSettlementAccount(lcSettlementAccount); - } - - @Override - public HTMLElement element() { - return element; - } -} diff --git a/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/section/BeneficiarySection.java b/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/section/BeneficiarySection.java deleted file mode 100644 index 873ec1be..00000000 --- a/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/section/BeneficiarySection.java +++ /dev/null @@ -1,114 +0,0 @@ -package org.dominokit.domino.formsamples.client.views.ui.section; - -import elemental2.dom.HTMLDivElement; -import elemental2.dom.HTMLElement; -import org.dominokit.domino.formsamples.shared.model.Account; -import org.dominokit.domino.formsamples.shared.model.Beneficiary; -import org.dominokit.domino.formsamples.shared.model.ContactPerson; -import org.dominokit.domino.formsamples.shared.model.LetterOfCredit; -import org.dominokit.domino.formsamples.shared.model.SellerBeneficiary; -import org.dominokit.domino.ui.cards.Card; -import org.dominokit.domino.ui.forms.FieldsGrouping; -import org.dominokit.domino.ui.forms.Select; -import org.dominokit.domino.ui.forms.SelectOption; -import org.dominokit.domino.ui.grid.Column; -import org.dominokit.domino.ui.grid.Row; -import org.dominokit.domino.ui.header.BlockHeader; -import org.dominokit.domino.ui.icons.lib.Icons; - -import java.util.List; - -import static org.dominokit.domino.formsamples.client.views.ui.CustomElements.isInvalidatedCard; -import static org.dominokit.domino.formsamples.client.views.ui.CustomElements.markCardValidation; -import static org.jboss.elemento.Elements.div; - -public class BeneficiarySection implements ImportSection { - - private Select beneficiariesSelect; - private Select accountsSelect; - private Card card; - private HTMLDivElement element = div().element(); - private FieldsGrouping fieldsGrouping = FieldsGrouping.create(); - - public BeneficiarySection(List beneficiaries) { - element.appendChild(BlockHeader.create("Seller(Beneficiary) *").element()); - - card = Card.create(); - - - beneficiariesSelect = Select.create("Beneficiary Name") - .groupBy(fieldsGrouping) - .setRequired(true) - .setAutoValidation(true) - .addLeftAddOn(Icons.label()) - .addSelectionHandler(option -> revalidate()); - - accountsSelect = Select.create("Through") - .addLeftAddOn(Icons.bank()) - .groupBy(fieldsGrouping) - .setRequired(true) - .setAutoValidation(true) - .addSelectionHandler(option -> revalidate()); - - for (Beneficiary beneficiary : beneficiaries) { - beneficiariesSelect.appendChild(SelectOption.create(beneficiary, beneficiary.getName())); - } - - beneficiariesSelect.addSelectionHandler(option -> { - accountsSelect.removeAllOptions(); - Beneficiary beneficiary = beneficiariesSelect.getValue(); - List accounts = beneficiary.getAccounts(); - for (Account account : accounts) { - accountsSelect.appendChild(SelectOption.create(account, account.getAccountAlias())); - } - }); - - - element.appendChild(card - .style() - .setPaddingTop("20px") - .get() - .appendChild(Row.create() - .addColumn(Column.span6() - .appendChild(beneficiariesSelect) - ) - .addColumn(Column.span6() - .appendChild(accountsSelect) - ) - ) - .element()); - } - - private void revalidate() { - if (isInvalidatedCard(card) && fieldsGrouping.validate().isValid()) { - markCardValidation(card, true, false); - } - } - - @Override - public boolean validate() { - boolean valid = fieldsGrouping.validate().isValid(); - markCardValidation(card, valid); - return valid; - } - - @Override - public void collect(LetterOfCredit letterOfCredit) { - SellerBeneficiary beneficiary = letterOfCredit.getBeneficiary(); - Beneficiary selectedBeneficiary = beneficiariesSelect.getValue(); - beneficiary.setReference(selectedBeneficiary.getId()); - beneficiary.setName(selectedBeneficiary.getName()); - beneficiary.setAddress(selectedBeneficiary.getAddress()); - ContactPerson contactPerson = new ContactPerson(); - contactPerson.setAddress(selectedBeneficiary.getContactPerson().getAddress()); - contactPerson.setEmail(selectedBeneficiary.getContactPerson().getEmail()); - contactPerson.setName(selectedBeneficiary.getContactPerson().getName()); - beneficiary.setContactPerson(contactPerson); - beneficiary.setAccount(accountsSelect.getValue()); - } - - @Override - public HTMLElement element() { - return element; - } -} diff --git a/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/section/ConfirmationInstructionsSection.java b/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/section/ConfirmationInstructionsSection.java deleted file mode 100644 index 54dbd2fe..00000000 --- a/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/section/ConfirmationInstructionsSection.java +++ /dev/null @@ -1,107 +0,0 @@ -package org.dominokit.domino.formsamples.client.views.ui.section; - -import elemental2.dom.HTMLDivElement; -import elemental2.dom.HTMLElement; -import org.dominokit.domino.formsamples.shared.model.ConfirmationInstructions; -import org.dominokit.domino.formsamples.shared.model.CorporateProfile; -import org.dominokit.domino.formsamples.shared.model.LetterOfCredit; -import org.dominokit.domino.ui.cards.Card; -import org.dominokit.domino.ui.forms.SwitchButton; -import org.dominokit.domino.ui.grid.Column; -import org.dominokit.domino.ui.grid.Row; -import org.dominokit.domino.ui.style.Style; - -import static org.dominokit.domino.formsamples.client.views.ui.CustomElements.isInvalidatedCard; -import static org.dominokit.domino.formsamples.client.views.ui.CustomElements.markCardValidation; -import static org.jboss.elemento.Elements.div; - -public class ConfirmationInstructionsSection implements ImportSection { - private SwitchButton chargesInstructionsRequiredSwitch; - private SwitchButton confirmationChargesOnSwitch; - private CorporateAccountsSelect confirmationChargesAccountSelect; - private Card confirmationInstructionsCard; - private HTMLDivElement element = div().element(); - - public ConfirmationInstructionsSection(CorporateProfile corporateProfile) { - - confirmationChargesAccountSelect = CorporateAccountsSelect.create("Confirmation charges account", corporateProfile); - confirmationChargesAccountSelect - .getAccountSelect() - .setAutoValidation(true) - .setRequired(true) - .addSelectionHandler(option -> revalidate()) - .hide(); - - - chargesInstructionsRequiredSwitch = Style.of(SwitchButton.create()) - .setMarginBottom("0px") - .get() - .setOffTitle("Required") - .addChangeHandler(value -> { - if (value) { - confirmationInstructionsCard.show(); - } else { - confirmationInstructionsCard.hide(); - revalidate(); - } - }); - - confirmationChargesOnSwitch = SwitchButton.create("Confirmation charges on", "Beneficiary", "Applicant") - .addChangeHandler(value -> { - if (value) { - confirmationChargesAccountSelect.show(); - } else { - confirmationChargesAccountSelect.hide(); - revalidate(); - } - }); - - confirmationInstructionsCard = Card.create("Confirmation Instructions", "") - .hide(); - confirmationInstructionsCard.getHeaderDescription() - .appendChild(chargesInstructionsRequiredSwitch.element()); - - confirmationInstructionsCard.bodyStyle() - .setPaddingTop("40px"); - - element.appendChild(confirmationInstructionsCard - .appendChild(Row.create() - .addColumn(Column.span6().appendChild(confirmationChargesOnSwitch)) - .addColumn(Column.span6().appendChild(confirmationChargesAccountSelect)) - ).element()); - } - - @Override - public void collect(LetterOfCredit letterOfCredit) { - ConfirmationInstructions confirmationInstructions = letterOfCredit.getConfirmationInstructions(); - confirmationInstructions.setConfirmationRequired(chargesInstructionsRequiredSwitch.getValue()); - if (confirmationInstructions.isConfirmationRequired()) { - confirmationInstructions.setConfirmationChargesOn(confirmationChargesOnSwitch.getValue() ? "APPLICANT" : "BENEFICIARIES"); - } - } - - @Override - public boolean validate() { - boolean valid = isValid(); - markCardValidation(confirmationInstructionsCard, valid); - return valid; - } - - public void revalidate() { - if (isInvalidatedCard(confirmationInstructionsCard) && isValid()) { - markCardValidation(confirmationInstructionsCard, true, false); - } - } - - private boolean isValid() { - return !chargesInstructionsRequiredSwitch.getValue() || ( - !confirmationChargesOnSwitch.getValue() || - confirmationChargesAccountSelect.getAccountSelect().validate().isValid() - ); - } - - @Override - public HTMLElement element() { - return element; - } -} diff --git a/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/section/CorrespondentChargesInstructionsSection.java b/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/section/CorrespondentChargesInstructionsSection.java deleted file mode 100644 index dfc56ce8..00000000 --- a/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/section/CorrespondentChargesInstructionsSection.java +++ /dev/null @@ -1,89 +0,0 @@ -package org.dominokit.domino.formsamples.client.views.ui.section; - -import elemental2.dom.HTMLDivElement; -import elemental2.dom.HTMLElement; -import org.dominokit.domino.formsamples.shared.model.ChargesInstructions; -import org.dominokit.domino.formsamples.shared.model.CorporateProfile; -import org.dominokit.domino.formsamples.shared.model.LetterOfCredit; -import org.dominokit.domino.ui.cards.Card; -import org.dominokit.domino.ui.forms.SwitchButton; -import org.dominokit.domino.ui.grid.Column; -import org.dominokit.domino.ui.grid.Row; - -import static org.dominokit.domino.formsamples.client.views.ui.CustomElements.isInvalidatedCard; -import static org.dominokit.domino.formsamples.client.views.ui.CustomElements.markCardValidation; -import static org.jboss.elemento.Elements.div; - -public class CorrespondentChargesInstructionsSection implements ImportSection { - - private SwitchButton correspondentChargesSwitch; - private CorporateAccountsSelect corporateAccountsSelect; - private Card correspondentChargesInstructionsCard; - private HTMLDivElement element = div().element(); - - public CorrespondentChargesInstructionsSection(CorporateProfile corporateProfile) { - - correspondentChargesInstructionsCard = Card.create("Correspondent Charges Instructions", "") - .hide(); - correspondentChargesInstructionsCard.bodyStyle() - .setPaddingTop("40px"); - - correspondentChargesSwitch = SwitchButton.create() - .style() - .setMarginBottom("0px") - .get() - .setOnTitle("Applicant") - .setOffTitle("Beneficiary") - .addChangeHandler(value -> { - if (value) { - correspondentChargesInstructionsCard.show(); - } else { - correspondentChargesInstructionsCard.hide(); - revalidate(); - } - }); - - correspondentChargesInstructionsCard.getHeaderDescription().appendChild(correspondentChargesSwitch.element()); - - corporateAccountsSelect = CorporateAccountsSelect.create("Charges Instructions", corporateProfile); - corporateAccountsSelect.getAccountSelect() - .dropup() - .setAutoValidation(true) - .setRequired(true) - .addSelectionHandler(option -> revalidate()); - - element.appendChild(correspondentChargesInstructionsCard - .appendChild(Row.create() - .addColumn(Column.span6().appendChild(corporateAccountsSelect)) - ).element()); - } - - @Override - public void collect(LetterOfCredit letterOfCredit) { - ChargesInstructions chargesInstructions = letterOfCredit.getChargesInstructions(); - chargesInstructions.setOutsideCountryChargesOn(correspondentChargesSwitch.getValue() ? "APPLICANT" : "BENEFICIARIES"); - } - - @Override - public boolean validate() { - boolean valid = isValid(); - markCardValidation(correspondentChargesInstructionsCard, valid); - return valid; - } - - public void revalidate() { - if (isInvalidatedCard(correspondentChargesInstructionsCard) && isValid()) { - markCardValidation(correspondentChargesInstructionsCard, true, false); - } - } - - private boolean isValid() { - return !correspondentChargesSwitch.getValue() || - corporateAccountsSelect.getAccountSelect().validate().isValid(); - } - - @Override - public HTMLElement element() { - return element; - } -} diff --git a/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/section/CreditAmountAndToleranceSection.java b/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/section/CreditAmountAndToleranceSection.java deleted file mode 100644 index faaad0c9..00000000 --- a/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/section/CreditAmountAndToleranceSection.java +++ /dev/null @@ -1,149 +0,0 @@ -package org.dominokit.domino.formsamples.client.views.ui.section; - -import com.google.gwt.i18n.client.NumberFormat; -import elemental2.dom.HTMLDivElement; -import elemental2.dom.HTMLElement; -import org.dominokit.domino.formsamples.client.views.ui.CurrenciesComponent; -import org.dominokit.domino.formsamples.shared.model.CreditAmount; -import org.dominokit.domino.formsamples.shared.model.CurrencyData; -import org.dominokit.domino.formsamples.shared.model.LcAmount; -import org.dominokit.domino.formsamples.shared.model.LetterOfCredit; -import org.dominokit.domino.ui.cards.Card; -import org.dominokit.domino.ui.forms.CheckBox; -import org.dominokit.domino.ui.forms.FieldsGrouping; -import org.dominokit.domino.ui.forms.Select; -import org.dominokit.domino.ui.forms.TextBox; -import org.dominokit.domino.ui.forms.validations.ValidationResult; -import org.dominokit.domino.ui.grid.Column; -import org.dominokit.domino.ui.grid.Row; -import org.dominokit.domino.ui.header.BlockHeader; -import org.dominokit.domino.ui.utils.ElementUtil; - -import java.util.List; - -import static org.dominokit.domino.formsamples.client.views.ui.CustomElements.isInvalidatedCard; -import static org.dominokit.domino.formsamples.client.views.ui.CustomElements.markCardValidation; -import static org.dominokit.domino.formsamples.client.views.ui.CustomElements.validatePercent; -import static org.jboss.elemento.Elements.div; -import static org.jboss.elemento.Elements.i; - -public class CreditAmountAndToleranceSection implements ImportSection { - private TextBox amountFieldTextBox; - private Select currencySelect; - private TextBox toleranceTextBox; - private CheckBox maximumCheckBox; - private Card card; - private HTMLDivElement element = div().element(); - private FieldsGrouping fieldsGrouping = FieldsGrouping.create(); - - public CreditAmountAndToleranceSection(List currencies) { - element.appendChild(BlockHeader.create("Credit Amount And Tolerance *").element()); - - card = Card.create(); - - CurrenciesComponent currenciesComponent = CurrenciesComponent.create() - .setCurrencies(currencies); - - revalidate(); - - amountFieldTextBox = currenciesComponent - .getAmountField() - .groupBy(fieldsGrouping) - .setRequired(true) - .setAutoValidation(true); - amountFieldTextBox.getInputElement().addEventListener("input", evt -> revalidate()); - - currencySelect = currenciesComponent - .getCurrencySelect() - .groupBy(fieldsGrouping) - .setRequired(true) - .setAutoValidation(true) - .addSelectionHandler(option -> revalidate()); - - toleranceTextBox = ElementUtil.numbersOnly(TextBox.create("Tolerance")) - .groupBy(fieldsGrouping) - .setRequired(true) - .setAutoValidation(true) - .addValidator(this::validateTolerance); - toleranceTextBox.getInputElement().addEventListener("input", evt -> revalidate()); - - maximumCheckBox = CheckBox.create("Maximum"); - maximumCheckBox.addChangeHandler(value -> { - if (value) { - toleranceTextBox.hide(); - toleranceTextBox.setRequired(false); - } else { - toleranceTextBox.show(); - toleranceTextBox.setRequired(true); - toleranceTextBox.setAutoValidation(true); - toleranceTextBox.validate(); - } - - revalidate(); - }); - - - element.appendChild(card - .style() - .setPaddingTop("20px") - .get() - .appendChild(Row.create() - .addColumn(Column.span3() - .appendChild(currencySelect) - ).addColumn(Column.span3() - .appendChild(amountFieldTextBox) - ) - .addColumn(Column.span3() - .appendChild(maximumCheckBox) - ) - .addColumn(Column.span3() - .appendChild(toleranceTextBox - .addLeftAddOn(i().css("fas", "fa-percent", "fa-sm"))) - ) - - ) - .element()); - - } - - private void revalidate() { - if (isInvalidatedCard(card) && fieldsGrouping.validate().isValid()) { - markCardValidation(card, true, false); - } - } - - private ValidationResult validateTolerance() { - if (maximumCheckBox.getValue()) - return ValidationResult.valid(); - - return validatePercent(toleranceTextBox); - } - - @Override - public boolean validate() { - boolean valid = fieldsGrouping.validate().isValid(); - markCardValidation(card, valid); - return valid; - } - - @Override - public void collect(LetterOfCredit letterOfCredit) { - CreditAmount creditAmount = letterOfCredit.getCreditAmount(); - creditAmount.setMaximum(maximumCheckBox.getValue()); - if (!creditAmount.isMaximum()) { - creditAmount.setTolerance(Double.parseDouble(toleranceTextBox.getValue())); - } - LcAmount lcAmount = new LcAmount(); - lcAmount.setCurrency(currencySelect.getValue().getCurrencyCode()); - double amount = NumberFormat.getCurrencyFormat(lcAmount.getCurrency()) - .parse(amountFieldTextBox.getValue()); - lcAmount.setValue(amount); - creditAmount.setLcAmount(lcAmount); - } - - - @Override - public HTMLElement element() { - return element; - } -} diff --git a/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/section/DocumentsRequiredSection.java b/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/section/DocumentsRequiredSection.java deleted file mode 100644 index 797c35d4..00000000 --- a/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/section/DocumentsRequiredSection.java +++ /dev/null @@ -1,78 +0,0 @@ -package org.dominokit.domino.formsamples.client.views.ui.section; - -import elemental2.dom.HTMLDivElement; -import elemental2.dom.HTMLElement; -import org.dominokit.domino.formsamples.client.views.ui.section.documents.CertificateOfOriginPart; -import org.dominokit.domino.formsamples.client.views.ui.section.documents.DraftsPart; -import org.dominokit.domino.formsamples.client.views.ui.section.documents.InsurancePolicyPart; -import org.dominokit.domino.formsamples.client.views.ui.section.documents.OtherDocumentsPart; -import org.dominokit.domino.formsamples.client.views.ui.section.documents.PackingListPart; -import org.dominokit.domino.formsamples.client.views.ui.section.documents.ShippingDocumentsPart; -import org.dominokit.domino.formsamples.client.views.ui.section.documents.SignedCommercialInvoicePart; -import org.dominokit.domino.formsamples.shared.model.Bank; -import org.dominokit.domino.formsamples.shared.model.Country; -import org.dominokit.domino.formsamples.shared.model.LetterOfCredit; -import org.dominokit.domino.ui.header.BlockHeader; - -import java.util.List; - -import static org.jboss.elemento.Elements.div; - -public class DocumentsRequiredSection implements ImportSection { - - private final DraftsPart draftsPart; - private final SignedCommercialInvoicePart signedCommercialInvoicePart; - private final CertificateOfOriginPart certificateOfOriginPart; - private final PackingListPart packingListPart; - private final ShippingDocumentsPart shippingDocumentsPart; - private final InsurancePolicyPart insurancePolicyPart; - private final OtherDocumentsPart otherDocumentsPart; - - private HTMLDivElement element = div().element(); - - public DocumentsRequiredSection(List banks, List countries) { - element.appendChild(BlockHeader.create("Documents Required").element()); - - draftsPart = new DraftsPart(); - signedCommercialInvoicePart = new SignedCommercialInvoicePart(countries); - certificateOfOriginPart = new CertificateOfOriginPart(countries); - packingListPart = new PackingListPart(); - shippingDocumentsPart = new ShippingDocumentsPart(banks); - insurancePolicyPart = new InsurancePolicyPart(); - otherDocumentsPart = new OtherDocumentsPart(); - - element.appendChild(draftsPart.element()); - element.appendChild(signedCommercialInvoicePart.element()); - element.appendChild(certificateOfOriginPart.element()); - element.appendChild(packingListPart.element()); - element.appendChild(shippingDocumentsPart.element()); - element.appendChild(insurancePolicyPart.element()); - element.appendChild(otherDocumentsPart.element()); - } - - @Override - public void collect(LetterOfCredit letterOfCredit) { - - shippingDocumentsPart.collect(letterOfCredit); - draftsPart.collect(letterOfCredit); - signedCommercialInvoicePart.collect(letterOfCredit); - packingListPart.collect(letterOfCredit); - insurancePolicyPart.collect(letterOfCredit); - otherDocumentsPart.collect(letterOfCredit); - } - - @Override - public boolean validate() { - return draftsPart.validate() & - signedCommercialInvoicePart.validate() & - certificateOfOriginPart.validate() & - packingListPart.validate() & - shippingDocumentsPart.validate() & - insurancePolicyPart.validate(); - } - - @Override - public HTMLElement element() { - return element; - } -} diff --git a/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/section/GeneralSection.java b/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/section/GeneralSection.java deleted file mode 100644 index 131534d8..00000000 --- a/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/section/GeneralSection.java +++ /dev/null @@ -1,76 +0,0 @@ -package org.dominokit.domino.formsamples.client.views.ui.section; - -import elemental2.dom.HTMLDivElement; -import elemental2.dom.HTMLElement; -import org.dominokit.domino.formsamples.shared.model.CorporateProfile; -import org.dominokit.domino.formsamples.shared.model.LetterOfCredit; -import org.dominokit.domino.ui.cards.Card; -import org.dominokit.domino.ui.datepicker.DateBox; -import org.dominokit.domino.ui.forms.TextBox; -import org.dominokit.domino.ui.grid.Column; -import org.dominokit.domino.ui.grid.Row; -import org.dominokit.domino.ui.header.BlockHeader; -import org.dominokit.domino.ui.icons.lib.Icons; - -import java.util.Date; - -import static org.dominokit.domino.formsamples.client.views.ui.Constants.DATE_PATTERN; -import static org.jboss.elemento.Elements.div; - -public class GeneralSection implements ImportSection { - - private DateBox creationDateBox; - private TextBox placeTextBox; - private HTMLDivElement element = div().element(); - - public GeneralSection(CorporateProfile corporateProfile) { - element.appendChild(BlockHeader.create("General").element()); - - creationDateBox = DateBox.create(); - placeTextBox = TextBox.create("Place") - .value("Amman"); - - element.appendChild(Card.create() - .style() - .setPaddingTop("20px") - .get() - .appendChild(Row.create() - .addColumn(Column.span6() - .style() - .setMarginBottom("0px").get() - .appendChild(creationDateBox - .setPattern(DATE_PATTERN) - .setHelperText(DATE_PATTERN) - .setLabel("Date") - .addLeftAddOn(Icons.calendar_range()) - .setReadOnly(true) - .value(new Date()))) - .addColumn(Column.span6() - .style() - .setMarginBottom("0px") - .get() - .appendChild(placeTextBox - .setReadOnly(true) - .addLeftAddOn(Icons.location_enter()) - .value(corporateProfile.getAddress().getCountryISOCode() + " - " + corporateProfile.getAddress().getCity()))) - ) - .element()); - } - - - @Override - public void collect(LetterOfCredit letterOfCredit) { - - } - - @Override - public boolean validate() { - return true; - } - - - @Override - public HTMLElement element() { - return element; - } -} diff --git a/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/section/GoodsDescriptionSection.java b/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/section/GoodsDescriptionSection.java deleted file mode 100644 index 622f9972..00000000 --- a/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/section/GoodsDescriptionSection.java +++ /dev/null @@ -1,68 +0,0 @@ -package org.dominokit.domino.formsamples.client.views.ui.section; - -import elemental2.dom.HTMLDivElement; -import elemental2.dom.HTMLElement; -import org.dominokit.domino.formsamples.shared.model.LetterOfCredit; -import org.dominokit.domino.ui.cards.Card; -import org.dominokit.domino.ui.forms.TextArea; -import org.dominokit.domino.ui.header.BlockHeader; -import org.dominokit.domino.ui.icons.lib.Icons; - -import static org.dominokit.domino.formsamples.client.views.ui.CustomElements.isInvalidatedCard; -import static org.dominokit.domino.formsamples.client.views.ui.CustomElements.markCardValidation; -import static org.jboss.elemento.Elements.div; - -public class GoodsDescriptionSection implements ImportSection { - - private TextArea goodsDescriptionTextArea; - private Card card; - private HTMLDivElement element = div().element(); - - public GoodsDescriptionSection() { - element.appendChild(BlockHeader.create("Goods Description *").element()); - - goodsDescriptionTextArea = TextArea.create("Goods Description") - .setAutoValidation(true) - .setRequired(true) - .autoSize() - .setRows(3) - .addLeftAddOn(Icons.note()); - - goodsDescriptionTextArea.getInputElement().addEventListener("input", evt -> revalidate()); - - card = Card.create() - .style() - .setPaddingTop("20px").get(); - - element.appendChild(card - .appendChild(goodsDescriptionTextArea) - .element()); - } - - public void revalidate(){ - if(isInvalidatedCard(card) && isValid()){ - markCardValidation(card, true, false); - } - } - - private boolean isValid() { - return goodsDescriptionTextArea.validate().isValid(); - } - - @Override - public void collect(LetterOfCredit letterOfCredit) { - letterOfCredit.setDescriptionOfGoods(goodsDescriptionTextArea.getValue()); - } - - @Override - public boolean validate() { - boolean valid = isValid(); - markCardValidation(card, valid); - return valid; - } - - @Override - public HTMLElement element() { - return element; - } -} diff --git a/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/section/IssuerBankSection.java b/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/section/IssuerBankSection.java deleted file mode 100644 index a5476ca2..00000000 --- a/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/section/IssuerBankSection.java +++ /dev/null @@ -1,114 +0,0 @@ -package org.dominokit.domino.formsamples.client.views.ui.section; - -import elemental2.dom.HTMLDivElement; -import elemental2.dom.HTMLElement; -import org.dominokit.domino.formsamples.client.views.ui.BanksComponent; -import org.dominokit.domino.formsamples.shared.model.Bank; -import org.dominokit.domino.formsamples.shared.model.Branch; -import org.dominokit.domino.formsamples.shared.model.CorporateProfile; -import org.dominokit.domino.formsamples.shared.model.Issuer; -import org.dominokit.domino.formsamples.shared.model.LetterOfCredit; -import org.dominokit.domino.ui.cards.Card; -import org.dominokit.domino.ui.forms.FieldsGrouping; -import org.dominokit.domino.ui.forms.Select; -import org.dominokit.domino.ui.forms.TextBox; -import org.dominokit.domino.ui.grid.Column; -import org.dominokit.domino.ui.grid.Row; -import org.dominokit.domino.ui.header.BlockHeader; -import org.dominokit.domino.ui.icons.lib.Icons; - -import java.util.List; - -import static org.dominokit.domino.formsamples.client.views.ui.CustomElements.markCardValidation; -import static org.jboss.elemento.Elements.div; - - -public class IssuerBankSection implements ImportSection { - - private Select issuerBanksSelect; - private Select issuerBranchesSelect; - private TextBox issuerAddressTextBox; - private TextBox issuerContactPersonTextBox; - private Row issuerBankInfoRow; - private Card card; - private HTMLDivElement element = div().element(); - private FieldsGrouping fieldsGrouping = FieldsGrouping.create(); - - public IssuerBankSection(CorporateProfile corporateProfile) { - element.appendChild(BlockHeader.create("Issuer Bank *").element()); - - List banks = corporateProfile.getBanks(); - BanksComponent banksComponent = BanksComponent.create(banks); - - issuerBranchesSelect = banksComponent - .getBranchesSelect() - .groupBy(fieldsGrouping) - .setRequired(true) - .setAutoValidation(true); - - issuerBanksSelect = banksComponent - .getBanksSelect() - .groupBy(fieldsGrouping) - .setRequired(true) - .setAutoValidation(true); - - issuerAddressTextBox = TextBox.create("Address"); - issuerContactPersonTextBox = TextBox.create("Contact Person"); - - issuerBankInfoRow = Row.create() - .addColumn(Column.span6() - .appendChild(issuerAddressTextBox - .addLeftAddOn(Icons.location_enter()) - .setReadOnly(true))) - .addColumn(Column.span6() - .appendChild(issuerContactPersonTextBox - .addLeftAddOn(Icons.account()) - .setReadOnly(true)) - ).hide(); - - issuerBranchesSelect.addSelectionHandler(option -> issuerBankInfoRow.show()); - - issuerBanksSelect.addSelectionHandler(option -> issuerBankInfoRow.hide()); - - - card = Card.create(); - element.appendChild(card - .style() - .setPaddingTop("20px") - .get() - .appendChild(Row.create() - .addColumn(Column.span6().appendChild(issuerBanksSelect)) - .addColumn(Column.span6().appendChild(issuerBranchesSelect)) - ).appendChild(issuerBankInfoRow) - .element()); - - issuerBanksSelect.focus(); - - issuerBranchesSelect.addSelectionHandler(option -> { - Branch branch = option.getValue(); - issuerAddressTextBox.setValue(branch.getAddress().getCountryISOCode() + " - " + branch.getAddress().getCity()); - issuerContactPersonTextBox.setValue(branch.getContactPerson().getName()); - markCardValidation(card, true, false); - }); - - } - - @Override - public void collect(LetterOfCredit letterOfCredit) { - Issuer issuer = letterOfCredit.getIssuer(); - issuer.setBank(issuerBanksSelect.getValue().getSwiftCode()); - issuer.setBranch(issuerBranchesSelect.getValue().getName()); - } - - @Override - public boolean validate() { - boolean valid = fieldsGrouping.validate().isValid(); - markCardValidation(card, valid); - return valid; - } - - @Override - public HTMLElement element() { - return element; - } -} diff --git a/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/section/PaymentScheduleSection.java b/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/section/PaymentScheduleSection.java deleted file mode 100644 index 75523f93..00000000 --- a/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/section/PaymentScheduleSection.java +++ /dev/null @@ -1,270 +0,0 @@ -package org.dominokit.domino.formsamples.client.views.ui.section; - -import elemental2.dom.HTMLDivElement; -import elemental2.dom.HTMLElement; -import org.dominokit.domino.formsamples.client.views.ui.Constants; -import org.dominokit.domino.formsamples.shared.model.LetterOfCredit; -import org.dominokit.domino.formsamples.shared.model.PaymentScheduleItem; -import org.dominokit.domino.ui.badges.Badge; -import org.dominokit.domino.ui.button.Button; -import org.dominokit.domino.ui.cards.Card; -import org.dominokit.domino.ui.collapsible.Collapsible; -import org.dominokit.domino.ui.forms.*; -import org.dominokit.domino.ui.forms.validations.ValidationResult; -import org.dominokit.domino.ui.grid.Column; -import org.dominokit.domino.ui.grid.Row; -import org.dominokit.domino.ui.grid.flex.FlexItem; -import org.dominokit.domino.ui.grid.flex.FlexLayout; -import org.dominokit.domino.ui.icons.lib.Icons; -import org.dominokit.domino.ui.icons.MdiIcon; -import org.dominokit.domino.ui.lists.ListGroup; -import org.dominokit.domino.ui.style.Color; -import org.dominokit.domino.ui.style.Styles; -import org.dominokit.domino.ui.utils.TextNode; - -import java.util.List; - -import static org.dominokit.domino.formsamples.client.views.ui.CustomElements.isInvalidatedCard; -import static org.dominokit.domino.formsamples.client.views.ui.CustomElements.markCardValidation; -import static org.dominokit.domino.ui.grid.Column.span12; -import static org.dominokit.domino.ui.grid.Column.span4; -import static org.dominokit.domino.ui.utils.ElementUtil.numbersOnly; -import static org.jboss.elemento.Elements.*; - -public class PaymentScheduleSection implements ImportSection { - - private final HTMLElement validationMessageElement = small().textContent("Total payment schedules should be 100%").css(Color.RED.getStyle()).element(); - private final Row paymentSchedulerListGroupRow; - private TextBox numberOfDaysTextBox; - private Select paymentScheduleAfterSelect; - private TextBox percentageTextBox; - private RadioGroup paymentScheduleRadioGroup; - private ListGroup paymentScheduleItemsListGroup; - private Button addButton; - private Collapsible valuesContainerCollapsible; - private Card paymentScheduleCard; - private HTMLDivElement element = div().element(); - private FieldsGrouping fieldsGrouping = FieldsGrouping.create(); - - public PaymentScheduleSection() { - - numberOfDaysTextBox = numbersOnly(TextBox.create("No. Of Days") - .addLeftAddOn(Icons.looks()) - .setHelperText(Constants.NUMBERS_ONLY)) - .groupBy(fieldsGrouping) - .setAutoValidation(true); - - Column numberOfDaysColumn = span4() - .appendChild(numberOfDaysTextBox).hide(); - - paymentScheduleAfterSelect = Select.create("After").appendChild(SelectOption.create("Presentation Of Documents", "Presentation Of Documents")) - .appendChild(SelectOption.create("Bill Of Lading Date", "Bill Of Lading Date")) - .appendChild(SelectOption.create("Commercial Invoice", "Commercial Invoice")) - .addLeftAddOn(Icons.redo()) - .groupBy(fieldsGrouping) - .setAutoValidation(true); - - Column paymentScheduleAfterColumn = span4() - .appendChild(paymentScheduleAfterSelect).hide(); - - percentageTextBox = numbersOnly(TextBox.create("Percentage")) - .setHelperText("Numbers only") - .setAutoValidation(true) - .value("100") - .setRequired(true) - .groupBy(fieldsGrouping) - .addLeftAddOn(i().css("fas", "fa-percent", "fa-sm")) - .addValidator(() -> { - int percentage = Integer.parseInt(percentageTextBox.getValue()); - int remainingPercentage = remainingPercentage(); - if (percentage > 0 && percentage <= remainingPercentage) { - return ValidationResult.valid(); - } - return ValidationResult.invalid("Maximum allowed percentage is " + remainingPercentage); - }); - - paymentSchedulerListGroupRow = Row.create(); - - paymentScheduleItemsListGroup = ListGroup.create() - .setItemRenderer((listGroup, listItem) -> { - MdiIcon delete = Icons.delete() - .clickable() - .styler(style -> style - .setMarginTop("-3px") - .setMarginLeft("10px") - ) - .addEventListener("click", evt1 -> { - paymentScheduleItemsListGroup.removeItem(listItem); - percentageTextBox.setValue(remainingPercentage() + ""); - addButton.show(); - valuesContainerCollapsible.show(); - if (listGroup.getValues().size() == 0) { - paymentSchedulerListGroupRow.hide(); - } - - revalidate(); - }); - FlexLayout flexLayout = FlexLayout.create() - .css(Styles.padding_10); - listItem - .appendChild(flexLayout - .appendChild(FlexItem.create() - .setFlexGrow(1) - .apply(self -> { - paymentScheduleRadioGroup.getSelectedRadio().getLabel() - .ifPresent(s -> self.appendChild(TextNode.of(s))); - }) - ) - .appendChild(FlexItem.create() - .appendChild(delete) - ) - ); - - if (numberOfDaysTextBox.isRequired()) { - flexLayout.appendChild(FlexItem.create() - .appendChild(Badge.create(listItem.getValue().getNumberOfDays() + " days after " + listItem.getValue().getAfterIncident().toLowerCase()) - .setBackground(Color.GREEN) - )); - } - - flexLayout.appendChild(FlexItem.create() - .appendChild(Badge.create(listItem.getValue().getPercentage() + "%") - .setBackground(Color.GREEN))); - - }); - - paymentScheduleRadioGroup = RadioGroup.create("paymentSchedule") - .appendChild(Radio.create("SIGHT", "Payment Sight").withGap().check()) - .appendChild(Radio.create("NEGOTIATION", "Negotiation").withGap()) - .appendChild(Radio.create("ACCEPTANCE", "Acceptance at").withGap()) - .appendChild(Radio.create("DEFERRED", "Deferred Payment").withGap()) - .addChangeHandler(value -> { - if (value.equals("DEFERRED") || value.equals("ACCEPTANCE")) { - numberOfDaysColumn.show(); - paymentScheduleAfterColumn.show(); - numberOfDaysTextBox.setRequired(true); - paymentScheduleAfterSelect.setRequired(true); - } else { - numberOfDaysColumn.hide(); - paymentScheduleAfterColumn.hide(); - numberOfDaysTextBox.setRequired(false); - paymentScheduleAfterSelect.setRequired(false); - } - }) - .horizontal(); - - paymentScheduleCard = Card.create("Payment Schedule *"); - addButton = Button.createDefault(Icons.plus()) - .setContent("ADD") - .linkify() - .style() - .setMarginTop("-10px") - .get() - ; - paymentScheduleCard.getHeaderBar() - .appendChild(addButton - .addClickListener(evt -> { - if (fieldsGrouping.validate().isValid()) { - addPaymentSchedule(); - } - }).element()); - - - Row paymentTypeRow = Row.create() - .addColumn(span12() - .appendChild(paymentScheduleRadioGroup)); - - - Row paymentValuesRow = Row.create() - .addColumn(span4().appendChild(percentageTextBox)) - .addColumn(numberOfDaysColumn) - .addColumn(paymentScheduleAfterColumn); - - HTMLDivElement valuesContainer = div() - .add(paymentTypeRow) - .add(paymentValuesRow).element(); - - valuesContainerCollapsible = Collapsible.create(valuesContainer) - .show(); - - - element.appendChild(paymentScheduleCard - .appendChild(valuesContainer) - .appendChild(paymentSchedulerListGroupRow - .addColumn(Column.span12() - .appendChild(paymentScheduleItemsListGroup)) - .hide() - ) - .element()); - } - - private int remainingPercentage() { - List allValues = paymentScheduleItemsListGroup.getValues(); - return 100 - allValues.stream().mapToInt(PaymentScheduleItem::getPercentage).sum(); - } - - public void revalidate() { - if (isInvalidatedCard(paymentScheduleCard) && remainingPercentage() == 0) { - markCardValidation(paymentScheduleCard, true, false); - markWithValidationMessage(true); - } - } - - private void addPaymentSchedule() { - PaymentScheduleItem item = new PaymentScheduleItem(); - item.setType(paymentScheduleRadioGroup.getValue()); - if (paymentScheduleAfterSelect.isRequired()) - item.setAfterIncident(paymentScheduleAfterSelect.getValue()); - - if (numberOfDaysTextBox.isRequired()) - item.setNumberOfDays(Integer.parseInt(numberOfDaysTextBox.getValue())); - - item.setPercentage(Integer.parseInt(percentageTextBox.getValue())); - paymentScheduleItemsListGroup.addItem(item); - - - int remainingPercentage = remainingPercentage(); - if (remainingPercentage == 0) { - addButton.hide(); - valuesContainerCollapsible.hide(); - } else { - if (addButton.isCollapsed()) - addButton.show(); - if (valuesContainerCollapsible.isCollapsed()) - valuesContainerCollapsible.show(); - percentageTextBox.setValue(remainingPercentage + ""); - } - numberOfDaysTextBox.clear(); - paymentScheduleAfterSelect.clear(); - paymentSchedulerListGroupRow.show(); - - revalidate(); - - } - - private void markWithValidationMessage(boolean valid) { - if (!valid) { - paymentScheduleCard.getHeaderDescription().appendChild(validationMessageElement); - } else { - validationMessageElement.remove(); - } - } - - @Override - public boolean validate() { - boolean valid = remainingPercentage() == 0; - markCardValidation(paymentScheduleCard, valid); - markWithValidationMessage(valid); - return valid; - } - - @Override - public void collect(LetterOfCredit letterOfCredit) { - letterOfCredit.getPaymentSchedule().addAll(paymentScheduleItemsListGroup.getValues()); - } - - @Override - public HTMLElement element() { - return element; - } -} diff --git a/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/section/ShipmentDetailsSection.java b/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/section/ShipmentDetailsSection.java deleted file mode 100644 index 5a0c4e81..00000000 --- a/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/section/ShipmentDetailsSection.java +++ /dev/null @@ -1,164 +0,0 @@ -package org.dominokit.domino.formsamples.client.views.ui.section; - -import com.google.gwt.i18n.client.DateTimeFormat; -import elemental2.dom.HTMLDivElement; -import elemental2.dom.HTMLElement; -import org.dominokit.domino.formsamples.shared.model.LetterOfCredit; -import org.dominokit.domino.formsamples.shared.model.ShipmentDetails; -import org.dominokit.domino.ui.cards.Card; -import org.dominokit.domino.ui.datepicker.DateBox; -import org.dominokit.domino.ui.forms.FieldsGrouping; -import org.dominokit.domino.ui.forms.Select; -import org.dominokit.domino.ui.forms.SelectOption; -import org.dominokit.domino.ui.forms.SwitchButton; -import org.dominokit.domino.ui.forms.TextBox; -import org.dominokit.domino.ui.grid.Row; -import org.dominokit.domino.ui.header.BlockHeader; -import org.dominokit.domino.ui.icons.lib.Icons; - -import static org.dominokit.domino.formsamples.client.views.ui.Constants.DATE_PATTERN; -import static org.dominokit.domino.formsamples.client.views.ui.CustomElements.isInvalidatedCard; -import static org.dominokit.domino.formsamples.client.views.ui.CustomElements.markCardValidation; -import static org.dominokit.domino.ui.grid.Column.span6; -import static org.jboss.elemento.Elements.div; - -public class ShipmentDetailsSection implements ImportSection { - - private DateBox latestDateOfShipmentDateBox; - private Select shipmentBySelect; - private SwitchButton partialShipmentSwitch; - private SwitchButton transShipmentSwitch; - private TextBox shipmentFromTextBox; - private TextBox shipmentToTextBox; - private TextBox placeOfDestinationTextBox; - private Select termsOfDeliverySelect; - private Card card; - private HTMLDivElement element = div().element(); - private FieldsGrouping fieldsGrouping = FieldsGrouping.create(); - - public ShipmentDetailsSection() { - card = Card.create(); - - latestDateOfShipmentDateBox = DateBox.create() - .groupBy(fieldsGrouping) - .setRequired(true) - .setAutoValidation(true) - .setPattern(DATE_PATTERN) - .setHelperText(DATE_PATTERN) - .setLabel("Latest Date Of Shipment") - .addLeftAddOn(Icons.calendar_range()); - latestDateOfShipmentDateBox.getDatePicker().addDateSelectionHandler((date, dateTimeFormatInfo) -> revalidate()); - latestDateOfShipmentDateBox.getInputElement().addEventListener("input", evt -> revalidate()); - - shipmentBySelect = Select.create("Shipment By") - .groupBy(fieldsGrouping) - .setRequired(true) - .setAutoValidation(true) - .addLeftAddOn(Icons.ship_wheel()) - .appendChild(SelectOption.create("AIR_FREIGHT", "Air Freight")) - .appendChild(SelectOption.create("SEA_FREIGHT", "Sea Freight")) - .appendChild(SelectOption.create("LAND", "Land")) - .appendChild(SelectOption.create("MULTIMODAL", "Multimodal")) - .addSelectionHandler(option -> revalidate()); - - partialShipmentSwitch = SwitchButton.create("Partial Shipments", "Not permitted", "Permitted") - .value(true); - - transShipmentSwitch = SwitchButton.create("Transshipment", "Not permitted", "Permitted"); - - shipmentFromTextBox = TextBox.create("Shipment From") - .groupBy(fieldsGrouping) - .setRequired(true) - .setAutoValidation(true) - .addLeftAddOn(Icons.location_enter()); - shipmentFromTextBox.getInputElement().addEventListener("input", evt -> revalidate()); - - shipmentToTextBox = TextBox.create("Shipment To") - .groupBy(fieldsGrouping) - .setRequired(true) - .setAutoValidation(true) - .addLeftAddOn(Icons.location_enter()); - - shipmentToTextBox.getInputElement().addEventListener("input", evt -> revalidate()); - - placeOfDestinationTextBox = TextBox.create("Place Of Destination") - .groupBy(fieldsGrouping) - .setRequired(true) - .setAutoValidation(true) - .addLeftAddOn(Icons.location_enter()); - placeOfDestinationTextBox.getInputElement().addEventListener("input", evt -> revalidate()); - - termsOfDeliverySelect = Select.create("Terms Of Delivery (Incoterms 2010)") - .groupBy(fieldsGrouping) - .setRequired(true) - .setAutoValidation(true) - .addLeftAddOn(Icons.wallet_membership()) - .appendChild(SelectOption.create("EXW", "EXW – Ex Works (named place of delivery)")) - .appendChild(SelectOption.create("FCA", "FCA – Free Carrier (named place of delivery)")) - .appendChild(SelectOption.create("CPT", "CPT – Carriage Paid To (named place of destination)")) - .appendChild(SelectOption.create("CIP", "CIP – Carriage and Insurance Paid to (named place of destination)")) - .appendChild(SelectOption.create("DAT", "DAT – Delivered At Terminal (named terminal at port or place of destination)")) - .appendChild(SelectOption.create("DAP", "DAP – Delivered At Place (named place of destination)")) - .appendChild(SelectOption.create("DDP", "DDP – Delivered Duty Paid (named place of destination)")) - .appendChild(SelectOption.create("FAS", "FAS – Free Alongside Ship (named port of shipment)")) - .appendChild(SelectOption.create("FOB", "FOB – Free on Board (named port of shipment)")) - .appendChild(SelectOption.create("CFR", "CFR – Cost and Freight (named port of destination)")) - .appendChild(SelectOption.create("CIF", "CIF – Cost, Insurance & Freight (named port of destination)")) - .addSelectionHandler(option -> revalidate()); - - element.appendChild(BlockHeader.create("Shipment Details *").element()); - - element.appendChild(card - .style() - .setPaddingTop("20px") - .get() - .appendChild(Row.create() - .addColumn(span6().appendChild(latestDateOfShipmentDateBox)) - .addColumn(span6().appendChild(transShipmentSwitch)) - ) - .appendChild(Row.create() - .addColumn(span6().appendChild(shipmentBySelect)) - .addColumn(span6().appendChild(partialShipmentSwitch)) - ) - .appendChild(Row.create() - .addColumn(span6().appendChild(shipmentFromTextBox)) - .addColumn(span6().appendChild(shipmentToTextBox)) - ) - .appendChild(Row.create() - .addColumn(span6().appendChild(termsOfDeliverySelect)) - .addColumn(span6().appendChild(placeOfDestinationTextBox)) - ).element()); - - } - - private void revalidate() { - if (isInvalidatedCard(card) && fieldsGrouping.validate().isValid()) { - markCardValidation(card, true, false); - } - } - - @Override - public boolean validate() { - boolean valid = fieldsGrouping.validate().isValid(); - markCardValidation(card, valid); - return valid; - } - - @Override - public void collect(LetterOfCredit letterOfCredit) { - ShipmentDetails shipmentDetails = letterOfCredit.getShipmentDetails(); - shipmentDetails.setLatestDateOfShipment(DateTimeFormat.getFormat(DATE_PATTERN).format(latestDateOfShipmentDateBox.getValue())); - shipmentDetails.setPartialShipmentsPermitted(partialShipmentSwitch.getValue()); - shipmentDetails.setTransshipmentPermitted(transShipmentSwitch.getValue()); - shipmentDetails.setShipmentBy(shipmentBySelect.getValue()); - shipmentDetails.setShipmentFrom(shipmentFromTextBox.getValue()); - shipmentDetails.setShipmentTo(shipmentToTextBox.getValue()); - shipmentDetails.setPlaceOfDestination(placeOfDestinationTextBox.getValue()); - shipmentDetails.setTermsOfDelivery(termsOfDeliverySelect.getValue()); - } - - @Override - public HTMLElement element() { - return element; - } -} diff --git a/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/section/ValiditySection.java b/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/section/ValiditySection.java deleted file mode 100644 index 0c040bc8..00000000 --- a/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/section/ValiditySection.java +++ /dev/null @@ -1,123 +0,0 @@ -package org.dominokit.domino.formsamples.client.views.ui.section; - -import com.google.gwt.i18n.client.DateTimeFormat; -import elemental2.dom.HTMLDivElement; -import elemental2.dom.HTMLElement; -import org.dominokit.domino.formsamples.client.views.ui.Constants; -import org.dominokit.domino.formsamples.client.views.ui.CountriesComponent; -import org.dominokit.domino.formsamples.shared.model.Country; -import org.dominokit.domino.formsamples.shared.model.LetterOfCredit; -import org.dominokit.domino.formsamples.shared.model.Validity; -import org.dominokit.domino.ui.cards.Card; -import org.dominokit.domino.ui.datepicker.DateBox; -import org.dominokit.domino.ui.forms.FieldsGrouping; -import org.dominokit.domino.ui.forms.Select; -import org.dominokit.domino.ui.forms.TextBox; -import org.dominokit.domino.ui.grid.Row; -import org.dominokit.domino.ui.header.BlockHeader; -import org.dominokit.domino.ui.icons.lib.Icons; - -import java.util.List; - -import static org.dominokit.domino.formsamples.client.views.ui.Constants.DATE_PATTERN; -import static org.dominokit.domino.formsamples.client.views.ui.CustomElements.isInvalidatedCard; -import static org.dominokit.domino.formsamples.client.views.ui.CustomElements.markCardValidation; -import static org.dominokit.domino.ui.grid.Column.span3; -import static org.dominokit.domino.ui.utils.ElementUtil.numbersOnly; -import static org.jboss.elemento.Elements.div; - -public class ValiditySection implements ImportSection { - - private Select countrySelect; - private Select citySelect; - - private DateBox validityExpiryDateBox; - private TextBox daysForShipmentTextBox; - private Card card; - private HTMLDivElement element = div().element(); - private FieldsGrouping fieldsGrouping = FieldsGrouping.create(); - - public ValiditySection(List countries) { - element.appendChild(BlockHeader.create("Validity *").element()); - - CountriesComponent countriesComponent = CountriesComponent.create(countries); - - card = Card.create(); - - revalidate(); - - countrySelect = countriesComponent.getCountriesSelect() - .setRequired(true) - .setAutoValidation(true) - .groupBy(fieldsGrouping) - .addSelectionHandler(option -> revalidate()); - - citySelect = countriesComponent.getCitiesSelect() - .setLabel("City / Town") - .setRequired(true) - .setAutoValidation(true) - .groupBy(fieldsGrouping) - .addSelectionHandler(option -> revalidate()); - - validityExpiryDateBox = DateBox.create() - .groupBy(fieldsGrouping) - .setRequired(true) - .setAutoValidation(true) - .setPattern(DATE_PATTERN) - .setLabel("Expiry Date Of Credit") - .addLeftAddOn(Icons.calendar_range()) - .setHelperText(DATE_PATTERN); - validityExpiryDateBox.getInputElement().addEventListener("input", evt -> revalidate()); - validityExpiryDateBox.getDatePicker().addDateSelectionHandler((date, dateTimeFormatInfo) -> revalidate()); - - daysForShipmentTextBox = TextBox.create("Days for Shipping Documents") - .value("21") - .groupBy(fieldsGrouping) - .setRequired(true) - .setAutoValidation(true) - .addLeftAddOn(Icons.looks()) - .setHelperText(Constants.NUMBERS_ONLY); - daysForShipmentTextBox.getInputElement().addEventListener("input", evt -> revalidate()); - - - element.appendChild(card - .style() - .setPaddingTop("20px") - .get() - .appendChild(Row.create() - .addColumn(span3().appendChild(validityExpiryDateBox)) - .addColumn(span3().appendChild(countrySelect)) - .addColumn(span3().appendChild(citySelect)) - .addColumn(span3().appendChild(numbersOnly(daysForShipmentTextBox))) - ) - .element()); - - } - - private void revalidate() { - if (isInvalidatedCard(card) && fieldsGrouping.validate().isValid()) { - markCardValidation(card, true, false); - } - } - - @Override - public boolean validate() { - boolean valid = fieldsGrouping.validate().isValid(); - markCardValidation(card, valid); - return valid; - } - - @Override - public void collect(LetterOfCredit letterOfCredit) { - Validity validity = letterOfCredit.getValidity(); - validity.setCity(citySelect.getValue()); - validity.setCountry(countrySelect.getValue().getIso()); - validity.setDaysForPresentingDocuments(Integer.parseInt(daysForShipmentTextBox.getValue())); - validity.setExpiryDateOfCredit(DateTimeFormat.getFormat(DATE_PATTERN).format(validityExpiryDateBox.getValue())); - } - - @Override - public HTMLElement element() { - return element; - } -} diff --git a/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/section/documents/CertificateOfOriginPart.java b/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/section/documents/CertificateOfOriginPart.java deleted file mode 100644 index 028e2915..00000000 --- a/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/section/documents/CertificateOfOriginPart.java +++ /dev/null @@ -1,159 +0,0 @@ -package org.dominokit.domino.formsamples.client.views.ui.section.documents; - -import elemental2.dom.HTMLDivElement; -import elemental2.dom.HTMLElement; -import org.dominokit.domino.formsamples.client.views.ui.section.ImportSection; -import org.dominokit.domino.formsamples.shared.model.CertificateOfOrigin; -import org.dominokit.domino.formsamples.shared.model.Country; -import org.dominokit.domino.formsamples.shared.model.DocumentsRequired; -import org.dominokit.domino.formsamples.shared.model.LetterOfCredit; -import org.dominokit.domino.ui.cards.Card; -import org.dominokit.domino.ui.forms.FieldsGrouping; -import org.dominokit.domino.ui.forms.Select; -import org.dominokit.domino.ui.forms.SelectOption; -import org.dominokit.domino.ui.forms.SwitchButton; -import org.dominokit.domino.ui.forms.TextBox; -import org.dominokit.domino.ui.grid.Column; -import org.dominokit.domino.ui.grid.Row; -import org.dominokit.domino.ui.icons.lib.Icons; - -import java.util.List; - -import static org.dominokit.domino.formsamples.client.views.ui.CustomElements.createCopiesField; -import static org.dominokit.domino.formsamples.client.views.ui.CustomElements.createCountriesSelect; -import static org.dominokit.domino.formsamples.client.views.ui.CustomElements.createDescriptionField; -import static org.dominokit.domino.formsamples.client.views.ui.CustomElements.createRequiredField; -import static org.dominokit.domino.formsamples.client.views.ui.CustomElements.isInvalidatedCard; -import static org.dominokit.domino.formsamples.client.views.ui.CustomElements.markCardValidation; -import static org.jboss.elemento.Elements.div; - -public class CertificateOfOriginPart implements ImportSection { - - private final TextBox numberOfCopiesTextBox; - private TextBox certificateOfOriginCopiesTextBox; - private SwitchButton certificateOfOriginRequiredSwitchButton; - private TextBox certificateOfOriginTextBox; - - private Select certificateOfOriginLocalizationEntitiesSelect; - private Select certificateOfOriginOriginCountrySelect; - private Select certificateOfOriginOriginOfGoodsCountrySelect; - private Select certificateOfOriginOriginOfLocalizationEntitiesCountrySelect; - - private FieldsGrouping fieldsGrouping = FieldsGrouping.create(); - - private Card certificateOfOriginCard; - - private HTMLDivElement element = div().element(); - - public CertificateOfOriginPart(List countries) { - certificateOfOriginCopiesTextBox = createCopiesField() - .setLabel("Original copies") - .groupBy(fieldsGrouping); - - certificateOfOriginCopiesTextBox.getInputElement().addEventListener("input", evt -> revalidate()); - - numberOfCopiesTextBox = createCopiesField() - .groupBy(fieldsGrouping); - numberOfCopiesTextBox.getInputElement().addEventListener("input", evt -> revalidate()); - - certificateOfOriginRequiredSwitchButton = createRequiredField() - .groupBy(fieldsGrouping) - .addChangeHandler(value -> { - if (value) { - certificateOfOriginCard.show(); - } else { - certificateOfOriginCard.hide(); - revalidate(); - } - }); - - certificateOfOriginTextBox = createDescriptionField() - .groupBy(fieldsGrouping); - certificateOfOriginTextBox.getInputElement().addEventListener("input", evt -> revalidate()); - - certificateOfOriginLocalizationEntitiesSelect = Select.create("Legalization entities") - .groupBy(fieldsGrouping) - .setAutoValidation(true) - .setRequired(true) - .addLeftAddOn(Icons.domain()) - .appendChild(SelectOption.create("Chamber of commerce", "Chamber of commerce")) - .appendChild(SelectOption.create("Official trade office", "Official trade office")) - .appendChild(SelectOption.create("Chamber of industries", "Chamber of industries")) - .addSelectionHandler(option -> revalidate()); - - certificateOfOriginOriginCountrySelect = createCountriesSelect("Country of origins", countries) - .groupBy(fieldsGrouping) - .setAutoValidation(true) - .setRequired(true) - .addSelectionHandler(option -> revalidate()); - - certificateOfOriginOriginOfGoodsCountrySelect = createCountriesSelect("Origin of goods", countries) - .groupBy(fieldsGrouping) - .setAutoValidation(true) - .setRequired(true) - .addSelectionHandler(option -> revalidate()); - - certificateOfOriginOriginOfLocalizationEntitiesCountrySelect = createCountriesSelect("Country of legalization entities", countries) - .groupBy(fieldsGrouping) - .setAutoValidation(true) - .setRequired(true) - .addSelectionHandler(option -> revalidate()); - - certificateOfOriginCard = Card.create("Certificate of origin in") - .setBodyPaddingTop("40px") - .hide(); - - certificateOfOriginCard.getHeaderDescription().appendChild(certificateOfOriginRequiredSwitchButton.element()); - - - element.appendChild(certificateOfOriginCard - .appendChild(Row.create() - .addColumn(Column.span4().appendChild(certificateOfOriginCopiesTextBox)) - .addColumn(Column.span4().appendChild(numberOfCopiesTextBox)) - ).appendChild(Row.create() - .addColumn(Column.span8().appendChild(certificateOfOriginTextBox))) - .appendChild(Row.create() - .addColumn(Column.span6().appendChild(certificateOfOriginLocalizationEntitiesSelect)) - .addColumn(Column.span6().appendChild(certificateOfOriginOriginCountrySelect)) - ).appendChild(Row.create() - .addColumn(Column.span6().copy().appendChild(certificateOfOriginOriginOfGoodsCountrySelect)) - .addColumn(Column.span6().copy().appendChild(certificateOfOriginOriginOfLocalizationEntitiesCountrySelect))) - .element()); - - } - - public void revalidate() { - if (isInvalidatedCard(certificateOfOriginCard) && isValid()) { - markCardValidation(certificateOfOriginCard, true, false); - } - } - - private boolean isValid() { - return !certificateOfOriginRequiredSwitchButton.getValue() || - fieldsGrouping.validate().isValid(); - } - - @Override - public void collect(LetterOfCredit letterOfCredit) { - DocumentsRequired documentsRequired = letterOfCredit.getDocumentsRequired(); - CertificateOfOrigin certificateOfOrigin = new CertificateOfOrigin(); - certificateOfOrigin.setRequired(certificateOfOriginRequiredSwitchButton.getValue()); - if (certificateOfOrigin.isRequired()) { - certificateOfOrigin.setDescription(certificateOfOriginTextBox.getValue()); - certificateOfOrigin.setNumberOfCopies(Integer.parseInt(certificateOfOriginCopiesTextBox.getValue())); - } - documentsRequired.setCertificateOfOrigin(certificateOfOrigin); - } - - @Override - public boolean validate() { - boolean valid = isValid(); - markCardValidation(certificateOfOriginCard, valid); - return valid; - } - - @Override - public HTMLElement element() { - return element; - } -} diff --git a/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/section/documents/DraftsPart.java b/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/section/documents/DraftsPart.java deleted file mode 100644 index c1bc63da..00000000 --- a/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/section/documents/DraftsPart.java +++ /dev/null @@ -1,239 +0,0 @@ -package org.dominokit.domino.formsamples.client.views.ui.section.documents; - -import elemental2.dom.HTMLDivElement; -import elemental2.dom.HTMLElement; -import org.dominokit.domino.formsamples.client.views.ui.section.ImportSection; -import org.dominokit.domino.formsamples.shared.model.DocumentsRequired; -import org.dominokit.domino.formsamples.shared.model.DraftsItem; -import org.dominokit.domino.formsamples.shared.model.LetterOfCredit; -import org.dominokit.domino.ui.button.Button; -import org.dominokit.domino.ui.cards.Card; -import org.dominokit.domino.ui.forms.FieldsGrouping; -import org.dominokit.domino.ui.forms.Select; -import org.dominokit.domino.ui.forms.SelectOption; -import org.dominokit.domino.ui.forms.SwitchButton; -import org.dominokit.domino.ui.forms.TextBox; -import org.dominokit.domino.ui.grid.Column; -import org.dominokit.domino.ui.grid.Row; -import org.dominokit.domino.ui.grid.flex.FlexItem; -import org.dominokit.domino.ui.grid.flex.FlexLayout; -import org.dominokit.domino.ui.icons.lib.Icons; -import org.dominokit.domino.ui.lists.ListGroup; -import org.dominokit.domino.ui.style.Color; -import org.dominokit.domino.ui.style.Styles; -import org.dominokit.domino.ui.utils.TextNode; - -import static org.dominokit.domino.formsamples.client.views.ui.Constants.NUMBERS_ONLY; -import static org.dominokit.domino.formsamples.client.views.ui.CustomElements.createRequiredField; -import static org.dominokit.domino.formsamples.client.views.ui.CustomElements.isInvalidatedCard; -import static org.dominokit.domino.formsamples.client.views.ui.CustomElements.markCardValidation; -import static org.dominokit.domino.formsamples.client.views.ui.CustomElements.validatePercent; -import static org.dominokit.domino.ui.utils.ElementUtil.numbersOnly; -import static org.jboss.elemento.Elements.div; -import static org.jboss.elemento.Elements.i; -import static org.jboss.elemento.Elements.small; - -public class DraftsPart implements ImportSection { - - private final HTMLElement validationMessage = small() - .textContent("At least one draft should be provided.") - .css(Color.RED.getStyle()) - .element(); - private Select draftDrawnOnSelect; - private TextBox atDaysTextBox; - private Select documentsRequiredFromSelect; - private TextBox draftsPercentage; - private Select draftsOf; - private SwitchButton draftsRequiredSwitch; - private ListGroup draftsListGroup; - - private FieldsGrouping fieldsGrouping = FieldsGrouping.create(); - private Card draftsCard; - - private HTMLDivElement element = div().element(); - - public DraftsPart() { - - draftsListGroup = ListGroup.create() - .setItemRenderer((listGroup, listItem) -> { - listItem.appendChild(FlexLayout.create() - .css(Styles.padding_10) - .appendChild(FlexItem.create() - .setFlexGrow(1) - .appendChild(TextNode.of(formattedDraftItem(listItem.getValue()))) - ) - .appendChild(FlexItem.create() - .appendChild(Icons.delete() - .clickable() - .styler(style -> style - .setMarginTop("-3px") - .setMarginLeft("10px") - ) - .addClickListener(evt -> { - listGroup.removeItem(listItem); - revalidate(); - } - ) - ) - ) - ); - }); - - draftDrawnOnSelect = Select.create("Draft Drawn On") - .groupBy(fieldsGrouping) - .setRequired(true) - .setAutoValidation(true) - .addLeftAddOn(Icons.bank()) - .appendChild(SelectOption.create("Progressoft", "Progressoft")) - .appendChild(SelectOption.create("Clusus", "Clusus")) - .appendChild(SelectOption.create("Bank XYZ", "Bank XYZ")) - .appendChild(SelectOption.create("Bank ABC", "Bank ABC")); - - atDaysTextBox = numbersOnly(TextBox.create("At (Days)")) - .groupBy(fieldsGrouping) - .setRequired(true) - .setAutoValidation(true) - .setHelperText(NUMBERS_ONLY) - .addLeftAddOn(Icons.looks()); - - documentsRequiredFromSelect = Select.create("From") - .groupBy(fieldsGrouping) - .setRequired(true) - .setAutoValidation(true) - .addLeftAddOn(Icons.calendar_range()) - .appendChild(SelectOption.create("shipmentDate", "Shipment Date")) - .appendChild(SelectOption.create("commercialDate", "Commercial Date")) - .appendChild(SelectOption.create("billOfLading", "Bill Of Lading")); - - draftsPercentage = numbersOnly(TextBox.create("Percentage")) - .groupBy(fieldsGrouping) - .setHelperText(NUMBERS_ONLY) - .setRequired(true) - .setAutoValidation(true) - .addValidator(() -> validatePercent(draftsPercentage)) - .addLeftAddOn(i() - .css("fas", "fa-percent", "fa-sm") - .style("margin-left: 15px;padding-right: 6px;")); - - - draftsOf = Select.create("Of") - .groupBy(fieldsGrouping) - .setRequired(true) - .setAutoValidation(true) - .addLeftAddOn(Icons.file_document_box()) - .appendChild(SelectOption.create("Invoice value", "Invoice value")) - .appendChild(SelectOption.create("IC value", "IC value")); - - draftsCard = Card.create("Drafts") - .setBodyPaddingTop("40px") - .hide(); - - Button addDraftButton = initAddButton(); - - draftsRequiredSwitch = createRequiredField(); - draftsRequiredSwitch.addChangeHandler(value -> { - if (value) { - draftsCard.show(); - addDraftButton.show(); - } else { - draftsCard.hide(); - addDraftButton.hide(); - revalidate(); - } - }); - draftsCard.getHeaderBar().appendChild(addDraftButton.element()); - draftsCard.getHeaderDescription().appendChild(draftsRequiredSwitch.element()); - element.appendChild(draftsCard - .appendChild(Row.create() - .addColumn(Column.span4() - .appendChild(draftDrawnOnSelect)) - .addColumn(Column.span4() - .appendChild(atDaysTextBox)) - .addColumn(Column.span4() - .appendChild(documentsRequiredFromSelect)) - ).appendChild(Row.create() - .addColumn(Column.span6() - .appendChild(draftsPercentage)) - .addColumn(Column.span6() - .appendChild(draftsOf)) - ).appendChild(Row.create() - .addColumn(Column.span12() - .appendChild(draftsListGroup)) - ).element()); - } - - private String formattedDraftItem(DraftsItem draftsItem) { - return draftsItem.formatted(documentsRequiredFromSelect.getSelectedOption().getDisplayValue().toLowerCase(), draftsOf.getValue().toLowerCase()); - } - - private void revalidate() { - if (isInvalidatedCard(draftsCard)) { - boolean valid = isValid(); - if (valid) { - markCardValidation(draftsCard, true, false); - markWithValidationMessage(valid); - } - } - } - - private Button initAddButton() { - Button addDraftButton = Button.createDefault(Icons.plus()).setContent("ADD").linkify() - .addClickListener(evt -> { - if (fieldsGrouping.validate().isValid()) { - - DraftsItem draftsItem = makeDraftItem(); - - draftsListGroup.addItem(draftsItem); - - atDaysTextBox.clear(); - draftDrawnOnSelect.clear(); - documentsRequiredFromSelect.clear(); - draftsPercentage.clear(); - draftsOf.clear(); - fieldsGrouping.clearInvalid(); - revalidate(); - } - }); - addDraftButton.hide(); - return addDraftButton; - } - - private boolean isValid() { - return !draftsRequiredSwitch.getValue() || !draftsListGroup.getValues().isEmpty(); - } - - private void markWithValidationMessage(boolean valid) { - if (!valid) { - draftsCard.getHeaderDescription().appendChild(validationMessage); - } else { - validationMessage.remove(); - } - } - - private DraftsItem makeDraftItem() { - return new DraftsItem(Integer.parseInt(atDaysTextBox.getValue()), - draftDrawnOnSelect.getValue(), documentsRequiredFromSelect.getValue(), - Integer.parseInt(draftsPercentage.getValue())); - } - - @Override - public void collect(LetterOfCredit letterOfCredit) { - DocumentsRequired documentsRequired = letterOfCredit.getDocumentsRequired(); - documentsRequired.setDraftRequired(draftsRequiredSwitch.getValue()); - if (documentsRequired.isDraftRequired()) - documentsRequired.setDrafts(draftsListGroup.getValues()); - } - - @Override - public boolean validate() { - boolean valid = isValid(); - markCardValidation(draftsCard, valid); - markWithValidationMessage(valid); - return valid; - } - - @Override - public HTMLElement element() { - return element; - } -} diff --git a/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/section/documents/InsurancePolicyPart.java b/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/section/documents/InsurancePolicyPart.java deleted file mode 100644 index f475a9cd..00000000 --- a/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/section/documents/InsurancePolicyPart.java +++ /dev/null @@ -1,114 +0,0 @@ -package org.dominokit.domino.formsamples.client.views.ui.section.documents; - -import elemental2.dom.HTMLDivElement; -import elemental2.dom.HTMLElement; -import org.dominokit.domino.formsamples.client.views.ui.section.ImportSection; -import org.dominokit.domino.formsamples.shared.model.DocumentsRequired; -import org.dominokit.domino.formsamples.shared.model.Insurance; -import org.dominokit.domino.formsamples.shared.model.LetterOfCredit; -import org.dominokit.domino.ui.cards.Card; -import org.dominokit.domino.ui.forms.FieldsGrouping; -import org.dominokit.domino.ui.forms.SwitchButton; -import org.dominokit.domino.ui.forms.TextBox; -import org.dominokit.domino.ui.grid.Row; -import org.dominokit.domino.ui.icons.lib.Icons; - -import static org.dominokit.domino.formsamples.client.views.ui.CustomElements.isInvalidatedCard; -import static org.dominokit.domino.formsamples.client.views.ui.CustomElements.markCardValidation; -import static org.dominokit.domino.ui.grid.Column.span6; -import static org.jboss.elemento.Elements.div; - -public class InsurancePolicyPart implements ImportSection { - - private TextBox insuranceCompanyTextBox; - private TextBox insurancePolicyNumberTextBox; - private SwitchButton insurancePolicyRequiredSwitchButton; - - private FieldsGrouping fieldsGrouping = FieldsGrouping.create(); - - private Card insurancePolicyCard; - - private HTMLDivElement element = div().element(); - - public InsurancePolicyPart() { - - insuranceCompanyTextBox = TextBox.create("Insurance company") - .groupBy(fieldsGrouping) - .addLeftAddOn(Icons.bank()) - .setAutoValidation(true) - .setRequired(true); - - insuranceCompanyTextBox.getInputElement().addEventListener("input", evt -> revalidate()); - - insurancePolicyNumberTextBox = TextBox.create("Insurance policy number") - .groupBy(fieldsGrouping) - .addLeftAddOn(Icons.phone()) - .setAutoValidation(true) - .setRequired(true); - - insurancePolicyNumberTextBox.getInputElement().addEventListener("input", evt -> revalidate()); - - insurancePolicyRequiredSwitchButton = SwitchButton.create() - .style() - .setMarginBottom("0px") - .get() - .setOnTitle("Applicant") - .setOffTitle("Beneficiary") - .addChangeHandler(value -> { - if (value) { - insurancePolicyCard.show(); - } else { - insurancePolicyCard.hide(); - revalidate(); - } - }); - - insurancePolicyCard = Card.create("Insurance policy required by") - .setBodyPaddingTop("40px") - .hide(); - - insurancePolicyCard.getHeaderDescription() - .appendChild(insurancePolicyRequiredSwitchButton.element()); - - Row insurancePolicyRow = Row.create() - .addColumn(span6().appendChild(insuranceCompanyTextBox)) - .addColumn(span6().appendChild(insurancePolicyNumberTextBox)); - - element.appendChild(insurancePolicyCard - .appendChild(insurancePolicyRow) - .element()); - } - - public void revalidate() { - if (isInvalidatedCard(insurancePolicyCard) && isValid()) { - markCardValidation(insurancePolicyCard, true, false); - } - } - - private boolean isValid() { - return !insurancePolicyRequiredSwitchButton.getValue() || fieldsGrouping.validate().isValid(); - } - - @Override - public void collect(LetterOfCredit letterOfCredit) { - DocumentsRequired documentsRequired = letterOfCredit.getDocumentsRequired(); - if (!insurancePolicyRequiredSwitchButton.isChecked()) { - Insurance insurance = new Insurance(); - insurance.setInsuranceCompany(insuranceCompanyTextBox.getValue()); - insurance.setInsurancePolicyNumber(insurancePolicyNumberTextBox.getValue()); - documentsRequired.setInsurance(insurance); - } - } - - @Override - public boolean validate() { - boolean valid = isValid(); - markCardValidation(insurancePolicyCard, valid); - return valid; - } - - @Override - public HTMLElement element() { - return element; - } -} diff --git a/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/section/documents/OtherDocumentsPart.java b/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/section/documents/OtherDocumentsPart.java deleted file mode 100644 index 61abe250..00000000 --- a/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/section/documents/OtherDocumentsPart.java +++ /dev/null @@ -1,145 +0,0 @@ -package org.dominokit.domino.formsamples.client.views.ui.section.documents; - -import elemental2.dom.HTMLDivElement; -import elemental2.dom.HTMLElement; -import org.dominokit.domino.formsamples.client.views.ui.section.ImportSection; -import org.dominokit.domino.formsamples.shared.model.DocumentsRequired; -import org.dominokit.domino.formsamples.shared.model.LetterOfCredit; -import org.dominokit.domino.formsamples.shared.model.OtherDocumentsItem; -import org.dominokit.domino.ui.badges.Badge; -import org.dominokit.domino.ui.button.Button; -import org.dominokit.domino.ui.cards.Card; -import org.dominokit.domino.ui.forms.FieldsGrouping; -import org.dominokit.domino.ui.forms.TextBox; -import org.dominokit.domino.ui.grid.Row; -import org.dominokit.domino.ui.grid.flex.FlexItem; -import org.dominokit.domino.ui.grid.flex.FlexLayout; -import org.dominokit.domino.ui.icons.lib.Icons; -import org.dominokit.domino.ui.icons.MdiIcon; -import org.dominokit.domino.ui.lists.ListGroup; -import org.dominokit.domino.ui.style.Color; -import org.dominokit.domino.ui.style.Styles; -import org.dominokit.domino.ui.utils.TextNode; - -import static org.dominokit.domino.formsamples.client.views.ui.CustomElements.createCopiesField; -import static org.dominokit.domino.formsamples.client.views.ui.CustomElements.createDescriptionField; -import static org.dominokit.domino.ui.grid.Column.*; -import static org.jboss.elemento.Elements.div; - -public class OtherDocumentsPart implements ImportSection { - - private final Row otherDocumentListGroupRow; - private ListGroup otherDocumentsItemListGroup; - private TextBox otherDocumentsCopiesTextBox; - private TextBox otherDocumentsDescriptionTextBox; - - private FieldsGrouping fieldsGrouping = FieldsGrouping.create(); - - private HTMLDivElement element = div().element(); - - public OtherDocumentsPart() { - otherDocumentsCopiesTextBox = createCopiesField() - .groupBy(fieldsGrouping); - - otherDocumentsDescriptionTextBox = createDescriptionField() - .groupBy(fieldsGrouping); - - otherDocumentListGroupRow = Row.create() - .hide(); - - otherDocumentsItemListGroup = ListGroup.create() - .setItemRenderer((listGroup, listItem) -> { - MdiIcon delete = Icons.delete() - .clickable() - .styler(style -> style.addCss(Styles.pull_right) - .setMarginTop("-3px") - .setMarginLeft("10px") - ) - .addClickListener(evt -> { - otherDocumentsItemListGroup.removeItem(listItem); - if (otherDocumentsItemListGroup.getValues().size() == 0) { - otherDocumentListGroupRow.hide(); - } - }); - - listItem - .appendChild(FlexLayout.create() - .css(Styles.padding_10) - .appendChild(FlexItem.create() - .appendChild(TextNode.of(listItem.getValue().getDescription())) - .setFlexGrow(1) - ) - .appendChild(FlexItem.create().appendChild(delete)) - .appendChild(FlexItem.create().appendChild(createCopiesBadge(listItem.getValue()))) - ); - - }); - - Card otherDocumentsCard = Card.create("Other documents").setBodyPaddingTop("40px"); - otherDocumentsCard.getHeaderBar() - .appendChild(Button.createDefault(Icons.plus()) - .setContent("ADD") - .styler(style -> style.setMarginTop("-10px")) - .linkify() - .addClickListener(evt -> { - if (fieldsGrouping.validate().isValid()) { - addOtherDocumentItem(); - } - }).element()); - - - element.appendChild(otherDocumentsCard - .appendChild(Row.create() - .addColumn(span4().appendChild(otherDocumentsCopiesTextBox.setRequired(true))) - .addColumn(span8() - .appendChild(otherDocumentsDescriptionTextBox.setRequired(true))) - ) - .appendChild(otherDocumentListGroupRow - .addColumn(span12() - .appendChild(otherDocumentsItemListGroup) - ) - ) - .element()); - } - - private Badge createCopiesBadge(OtherDocumentsItem item) { - return Badge.create(item.getNumberOfCopies() + " Copies") - .setBackground(Color.GREEN) - .style() - .addCss(Styles.pull_right).get(); - } - - private void addOtherDocumentItem() { - OtherDocumentsItem item = makeNewOtherDocument(); - otherDocumentsItemListGroup.addItem(item); - - if (otherDocumentListGroupRow.isCollapsed()) { - otherDocumentListGroupRow.show(); - } - otherDocumentsCopiesTextBox.clear(); - otherDocumentsCopiesTextBox.clearInvalid(); - otherDocumentsDescriptionTextBox.clear(); - otherDocumentsDescriptionTextBox.clearInvalid(); - } - - private OtherDocumentsItem makeNewOtherDocument() { - return new OtherDocumentsItem(Integer.parseInt(otherDocumentsCopiesTextBox.getValue()), otherDocumentsDescriptionTextBox.getValue()); - } - - - @Override - public void collect(LetterOfCredit letterOfCredit) { - DocumentsRequired documentsRequired = letterOfCredit.getDocumentsRequired(); - documentsRequired.setOtherDocuments(otherDocumentsItemListGroup.getValues()); - } - - @Override - public boolean validate() { - return true; - } - - @Override - public HTMLElement element() { - return element; - } -} diff --git a/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/section/documents/PackingListPart.java b/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/section/documents/PackingListPart.java deleted file mode 100644 index aa7271b5..00000000 --- a/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/section/documents/PackingListPart.java +++ /dev/null @@ -1,99 +0,0 @@ -package org.dominokit.domino.formsamples.client.views.ui.section.documents; - -import elemental2.dom.HTMLDivElement; -import elemental2.dom.HTMLElement; -import org.dominokit.domino.formsamples.client.views.ui.section.ImportSection; -import org.dominokit.domino.formsamples.shared.model.DocumentsRequired; -import org.dominokit.domino.formsamples.shared.model.LetterOfCredit; -import org.dominokit.domino.formsamples.shared.model.PackingList; -import org.dominokit.domino.ui.cards.Card; -import org.dominokit.domino.ui.forms.FieldsGrouping; -import org.dominokit.domino.ui.forms.SwitchButton; -import org.dominokit.domino.ui.forms.TextBox; -import org.dominokit.domino.ui.grid.Column; -import org.dominokit.domino.ui.grid.Row; - -import static org.dominokit.domino.formsamples.client.views.ui.CustomElements.createCopiesField; -import static org.dominokit.domino.formsamples.client.views.ui.CustomElements.createDescriptionField; -import static org.dominokit.domino.formsamples.client.views.ui.CustomElements.createRequiredField; -import static org.dominokit.domino.formsamples.client.views.ui.CustomElements.isInvalidatedCard; -import static org.dominokit.domino.formsamples.client.views.ui.CustomElements.markCardValidation; -import static org.jboss.elemento.Elements.div; - -public class PackingListPart implements ImportSection { - - private TextBox packingListCopiesTextBox; - private SwitchButton packingListRequiredSwitchButton; - private TextBox packingListTextBox; - private Card packingListCard; - private HTMLDivElement element = div().element(); - private FieldsGrouping fieldsGrouping = FieldsGrouping.create(); - - public PackingListPart() { - packingListCopiesTextBox = createCopiesField() - .groupBy(fieldsGrouping); - packingListCopiesTextBox.getInputElement().addEventListener("input", evt -> revalidate()); - - packingListTextBox = createDescriptionField() - .groupBy(fieldsGrouping); - packingListTextBox.getInputElement().addEventListener("input", evt -> revalidate()); - - packingListRequiredSwitchButton = createRequiredField() - .addChangeHandler(value -> { - if (value) { - packingListCard.show(); - } else { - packingListCard.hide(); - revalidate(); - } - }); - - packingListCard = Card.create("Packing list in") - .setBodyPaddingTop("40px") - .hide(); - - packingListCard.getHeaderDescription() - .appendChild(packingListRequiredSwitchButton.element()); - - - element.appendChild(packingListCard - .appendChild(Row.create() - .addColumn(Column.span4().appendChild(packingListCopiesTextBox.setRequired(true).setAutoValidation(true))) - .addColumn(Column.span8().appendChild(packingListTextBox.setRequired(true).setAutoValidation(true)))) - .element()); - } - - @Override - public void collect(LetterOfCredit letterOfCredit) { - DocumentsRequired documentsRequired = letterOfCredit.getDocumentsRequired(); - PackingList packingList = new PackingList(); - packingList.setRequired(packingListRequiredSwitchButton.getValue()); - if (packingList.isRequired()) { - packingList.setDescription(packingListTextBox.getValue()); - packingList.setNumberOfCopies(Integer.parseInt(packingListCopiesTextBox.getValue())); - } - documentsRequired.setPackingList(packingList); - } - - @Override - public boolean validate() { - boolean valid = isValid(); - markCardValidation(packingListCard, valid); - return valid; - } - - public void revalidate(){ - if(isInvalidatedCard(packingListCard) && isValid()){ - markCardValidation(packingListCard, true, false); - } - } - - private boolean isValid() { - return !packingListRequiredSwitchButton.getValue() || fieldsGrouping.validate().isValid(); - } - - @Override - public HTMLElement element() { - return element; - } -} diff --git a/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/section/documents/ShippingDocumentsPart.java b/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/section/documents/ShippingDocumentsPart.java deleted file mode 100644 index d09e72d7..00000000 --- a/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/section/documents/ShippingDocumentsPart.java +++ /dev/null @@ -1,167 +0,0 @@ -package org.dominokit.domino.formsamples.client.views.ui.section.documents; - -import elemental2.dom.HTMLDivElement; -import elemental2.dom.HTMLElement; -import org.dominokit.domino.formsamples.client.views.ui.section.ImportSection; -import org.dominokit.domino.formsamples.shared.model.AirwayBill; -import org.dominokit.domino.formsamples.shared.model.Bank; -import org.dominokit.domino.formsamples.shared.model.DocumentsRequired; -import org.dominokit.domino.formsamples.shared.model.LetterOfCredit; -import org.dominokit.domino.formsamples.shared.model.OceanBillsOfLanding; -import org.dominokit.domino.formsamples.shared.model.TruckConsignmentNote; -import org.dominokit.domino.ui.cards.Card; -import org.dominokit.domino.ui.forms.FieldsGrouping; -import org.dominokit.domino.ui.forms.Select; -import org.dominokit.domino.ui.forms.SelectOption; -import org.dominokit.domino.ui.forms.SwitchButton; -import org.dominokit.domino.ui.forms.TextBox; -import org.dominokit.domino.ui.grid.Row; -import org.dominokit.domino.ui.icons.lib.Icons; - -import java.util.List; - -import static org.dominokit.domino.formsamples.client.views.ui.CustomElements.createCopiesField; -import static org.dominokit.domino.formsamples.client.views.ui.CustomElements.createDescriptionField; -import static org.dominokit.domino.formsamples.client.views.ui.CustomElements.createRequiredField; -import static org.dominokit.domino.formsamples.client.views.ui.CustomElements.isInvalidatedCard; -import static org.dominokit.domino.formsamples.client.views.ui.CustomElements.markCardValidation; -import static org.dominokit.domino.ui.grid.Column.span6; -import static org.jboss.elemento.Elements.div; - -public class ShippingDocumentsPart implements ImportSection { - - private final SwitchButton shippingDocumentsSwitchButton; - private final Select orderOfBankSelect; - private final Select freightSelect; - private TextBox shippingDocumentsCopiesTextBox; - private TextBox shippingDocumentsDescriptionTextBox; - private Select shippingDocumentsTypeSelect; - private FieldsGrouping fieldsGrouping = FieldsGrouping.create(); - - - private Card card; - private HTMLDivElement element = div().element(); - - public ShippingDocumentsPart(List banks) { - Row shippingDocumentInfoRow = Row.create(); - Row shippingDocumentSelectRow = Row.create(); - - shippingDocumentsCopiesTextBox = createCopiesField() - .groupBy(fieldsGrouping) - .setAutoValidation(true) - .setRequired(true); - shippingDocumentsCopiesTextBox.getInputElement().addEventListener("input", evt -> revalidate()); - - shippingDocumentsDescriptionTextBox = createDescriptionField() - .groupBy(fieldsGrouping) - .setAutoValidation(true) - .setRequired(true); - shippingDocumentsDescriptionTextBox.getInputElement().addEventListener("input", evt -> revalidate()); - - orderOfBankSelect = Select.create("Order of") - .groupBy(fieldsGrouping) - .addLeftAddOn(Icons.domain()) - .setAutoValidation(true) - .setRequired(true) - .addSelectionHandler(option -> revalidate()); - - for (Bank bank : banks) { - orderOfBankSelect.appendChild(SelectOption.create(bank, bank.getSwiftCode(), bank.getName())); - } - - freightSelect = Select.create("Freight") - .groupBy(fieldsGrouping) - .setAutoValidation(true) - .setRequired(true) - .addLeftAddOn(Icons.credit_card()) - .appendChild(SelectOption.create("Prepaid", "Prepaid")) - .appendChild(SelectOption.create("Payable at destination", "Payable at destination")) - .addSelectionHandler(option -> revalidate()); - - shippingDocumentsTypeSelect = Select.create("Shipping documents type") - .groupBy(fieldsGrouping) - .setRequired(true) - .setAutoValidation(true) - .addLeftAddOn(Icons.ship_wheel()) - .appendChild(SelectOption.create("Ocean bills of lading in", "Ocean bills of lading in")) - .appendChild(SelectOption.create("Airway bill in", "Airway bill in")) - .appendChild(SelectOption.create("Truck consignment note", "Truck consignment note")) - .appendChild(SelectOption.create("Multimodal transport document", "Multimodal transport document")) - .selectAt(0) - .addSelectionHandler(option -> revalidate()); - - shippingDocumentsSwitchButton = createRequiredField() - .addChangeHandler(value -> { - if (value) { - card.show(); - } else { - card.hide(); - revalidate(); - } - }); - - - card = Card.create("Shipping documents") - .setBodyPaddingTop("40px") - .hide(); - card.getHeaderDescription() - .appendChild(shippingDocumentsSwitchButton.element()); - - element.appendChild(card - .appendChild(Row.create() - .addColumn(span6().appendChild(shippingDocumentsTypeSelect))) - .appendChild(shippingDocumentInfoRow - .addColumn(span6().appendChild(shippingDocumentsCopiesTextBox)) - .addColumn(span6().appendChild(shippingDocumentsDescriptionTextBox))) - .appendChild(shippingDocumentSelectRow - .addColumn(span6().appendChild(orderOfBankSelect)) - .addColumn(span6().appendChild(freightSelect) - )) - .element()); - } - - public void revalidate() { - if (isInvalidatedCard(card) && fieldsGrouping.validate().isValid()) { - markCardValidation(card, true, false); - } - } - - @Override - public void collect(LetterOfCredit letterOfCredit) { - if(shippingDocumentsSwitchButton.getValue()) { - DocumentsRequired documentsRequired = letterOfCredit.getDocumentsRequired(); - if ("Ocean bills of lading in".equals(shippingDocumentsTypeSelect.getValue())) { - OceanBillsOfLanding oceanBillsOfLanding = new OceanBillsOfLanding(); - oceanBillsOfLanding.setRequired(true); - oceanBillsOfLanding.setNumberOfCopies(Integer.parseInt(shippingDocumentsCopiesTextBox.getValue())); - oceanBillsOfLanding.setDescription(shippingDocumentsDescriptionTextBox.getValue()); - documentsRequired.setOceanBillsOfLanding(oceanBillsOfLanding); - } else if ("Airway bill in".equals(shippingDocumentsTypeSelect.getValue())) { - AirwayBill airwayBill = new AirwayBill(); - airwayBill.setRequired(true); - airwayBill.setNumberOfCopies(Integer.parseInt(shippingDocumentsCopiesTextBox.getValue())); - airwayBill.setDescription(shippingDocumentsDescriptionTextBox.getValue()); - documentsRequired.setAirwayBill(airwayBill); - } else if ("Truck consignment note".equals(shippingDocumentsTypeSelect.getValue())) { - TruckConsignmentNote truckConsignmentNote = new TruckConsignmentNote(); - truckConsignmentNote.setRequired(true); - truckConsignmentNote.setNumberOfCopies(Integer.parseInt(shippingDocumentsCopiesTextBox.getValue())); - truckConsignmentNote.setDescription(shippingDocumentsDescriptionTextBox.getValue()); - documentsRequired.setTruckConsignmentNote(truckConsignmentNote); - } - - } - } - - @Override - public boolean validate() { - boolean valid = !shippingDocumentsSwitchButton.getValue() || fieldsGrouping.validate().isValid(); - markCardValidation(card, valid); - return valid; - } - - @Override - public HTMLElement element() { - return element; - } -} diff --git a/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/section/documents/SignedCommercialInvoicePart.java b/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/section/documents/SignedCommercialInvoicePart.java deleted file mode 100644 index 725a56be..00000000 --- a/formsamples/src/main/java/org/dominokit/domino/formsamples/client/views/ui/section/documents/SignedCommercialInvoicePart.java +++ /dev/null @@ -1,161 +0,0 @@ -package org.dominokit.domino.formsamples.client.views.ui.section.documents; - -import elemental2.dom.HTMLDivElement; -import elemental2.dom.HTMLElement; -import org.dominokit.domino.formsamples.client.views.ui.section.ImportSection; -import org.dominokit.domino.formsamples.shared.model.Country; -import org.dominokit.domino.formsamples.shared.model.DocumentsRequired; -import org.dominokit.domino.formsamples.shared.model.LetterOfCredit; -import org.dominokit.domino.formsamples.shared.model.SignedCommercialInvoice; -import org.dominokit.domino.ui.cards.Card; -import org.dominokit.domino.ui.forms.FieldsGrouping; -import org.dominokit.domino.ui.forms.Select; -import org.dominokit.domino.ui.forms.SelectOption; -import org.dominokit.domino.ui.forms.SwitchButton; -import org.dominokit.domino.ui.forms.TextBox; -import org.dominokit.domino.ui.grid.Row; -import org.dominokit.domino.ui.icons.lib.Icons; - -import java.util.List; - -import static org.dominokit.domino.formsamples.client.views.ui.CustomElements.createCopiesField; -import static org.dominokit.domino.formsamples.client.views.ui.CustomElements.createCountriesSelect; -import static org.dominokit.domino.formsamples.client.views.ui.CustomElements.createDescriptionField; -import static org.dominokit.domino.formsamples.client.views.ui.CustomElements.createRequiredField; -import static org.dominokit.domino.formsamples.client.views.ui.CustomElements.isInvalidatedCard; -import static org.dominokit.domino.formsamples.client.views.ui.CustomElements.markCardValidation; -import static org.dominokit.domino.ui.grid.Column.span4; -import static org.dominokit.domino.ui.grid.Column.span6; -import static org.dominokit.domino.ui.grid.Column.span8; -import static org.jboss.elemento.Elements.div; - -public class SignedCommercialInvoicePart implements ImportSection { - - private TextBox signedCommercialInvoiceOriginalCopiesTextBox; - private TextBox signedCommercialInvoiceCopiesTextBox; - private SwitchButton signedCommercialInvoiceRequiredSwitchButton; - private TextBox signedCommercialInvoiceTextBox; - - private Select signedCommercialLocalizationEntitiesSelect; - private Select signedCommercialOriginCountrySelect; - private Select signedCommercialOriginOfGoodsCountrySelect; - private Select signedCommercialOriginOfLocalizationEntityCountrySelect; - private Card signedCommercialInvoiceInCard; - - private FieldsGrouping fieldsGrouping = FieldsGrouping.create(); - - private HTMLDivElement element = div().element(); - - - public SignedCommercialInvoicePart(List countries) { - - signedCommercialInvoiceInCard = Card.create("Signed commercial invoice in") - .setBodyPaddingTop("40px") - .hide(); - - signedCommercialInvoiceOriginalCopiesTextBox = createCopiesField() - .groupBy(fieldsGrouping) - .setLabel("Number of original copies"); - signedCommercialInvoiceOriginalCopiesTextBox.getInputElement().addEventListener("input", evt -> revalidate()); - - signedCommercialInvoiceCopiesTextBox = createCopiesField() - .groupBy(fieldsGrouping); - signedCommercialInvoiceCopiesTextBox.getInputElement().addEventListener("input", evt -> revalidate()); - - signedCommercialInvoiceRequiredSwitchButton = createRequiredField() - .groupBy(fieldsGrouping) - .addChangeHandler(value -> { - if (value) { - signedCommercialInvoiceInCard.show(); - } else { - signedCommercialInvoiceInCard.hide(); - revalidate(); - } - }); - - signedCommercialInvoiceTextBox = createDescriptionField() - .groupBy(fieldsGrouping) - ; - signedCommercialInvoiceTextBox.getInputElement().addEventListener("input", evt -> revalidate()); - - signedCommercialLocalizationEntitiesSelect = Select.create("Legalization entities") - .groupBy(fieldsGrouping) - .setAutoValidation(true) - .setRequired(true) - .addLeftAddOn(Icons.domain()) - .appendChild(SelectOption.create("Chamber of commerce", "Chamber of commerce")) - .appendChild(SelectOption.create("Official trade office", "Official trade office")) - .appendChild(SelectOption.create("Chamber of industries", "Chamber of industries")) - .addSelectionHandler(option -> revalidate()); - - signedCommercialOriginCountrySelect = createCountriesSelect("Country of origins", countries) - .groupBy(fieldsGrouping) - .setAutoValidation(true) - .setRequired(true) - .addSelectionHandler(option -> revalidate()); - - signedCommercialOriginOfGoodsCountrySelect = createCountriesSelect("Origin of goods", countries) - .groupBy(fieldsGrouping) - .setAutoValidation(true) - .setRequired(true) - .addSelectionHandler(option -> revalidate()); - - signedCommercialOriginOfLocalizationEntityCountrySelect = createCountriesSelect("Country of legalization entities", countries) - .groupBy(fieldsGrouping) - .setAutoValidation(true) - .setRequired(true) - .addSelectionHandler(option -> revalidate()); - - - signedCommercialInvoiceInCard.getHeaderDescription() - .appendChild(signedCommercialInvoiceRequiredSwitchButton.element()); - - element.appendChild(signedCommercialInvoiceInCard - .appendChild(Row.create() - .addColumn(span4().appendChild(signedCommercialInvoiceOriginalCopiesTextBox)) - .addColumn(span4().appendChild(signedCommercialInvoiceCopiesTextBox)) - .addColumn(span8().appendChild(signedCommercialInvoiceTextBox)) - - ).appendChild(Row.create() - .addColumn(span6().appendChild(signedCommercialLocalizationEntitiesSelect)) - .addColumn(span6().appendChild(signedCommercialOriginCountrySelect)) - ).appendChild(Row.create() - .addColumn(span6().appendChild(signedCommercialOriginOfGoodsCountrySelect)) - .addColumn(span6().appendChild(signedCommercialOriginOfLocalizationEntityCountrySelect))) - .element()); - } - - public void revalidate() { - if (isInvalidatedCard(signedCommercialInvoiceInCard) && isValid()) { - markCardValidation(signedCommercialInvoiceInCard, true, false); - } - } - - private boolean isValid() { - return !signedCommercialInvoiceRequiredSwitchButton.getValue() || fieldsGrouping.validate().isValid(); - } - - @Override - public void collect(LetterOfCredit letterOfCredit) { - DocumentsRequired documentsRequired = letterOfCredit.getDocumentsRequired(); - SignedCommercialInvoice signedCommercialInvoice = new SignedCommercialInvoice(); - signedCommercialInvoice.setRequired(signedCommercialInvoiceRequiredSwitchButton.getValue()); - if (signedCommercialInvoice.isRequired()) { - signedCommercialInvoice.setDescription(signedCommercialInvoiceTextBox.getValue()); - signedCommercialInvoice.setNumberOfCopies(Integer.parseInt(signedCommercialInvoiceCopiesTextBox.getValue())); - } - documentsRequired.setSignedCommercialInvoice(signedCommercialInvoice); - } - - @Override - public boolean validate() { - boolean valid = isValid(); - markCardValidation(signedCommercialInvoiceInCard, valid); - return valid; - } - - @Override - public HTMLElement element() { - return element; - } -} diff --git a/formsvalidations/pom.xml b/formsvalidations/pom.xml index 61c2a31a..8ece4c64 100644 --- a/formsvalidations/pom.xml +++ b/formsvalidations/pom.xml @@ -1,5 +1,5 @@ - + 4.0.0 domino-ui-demo @@ -15,7 +15,7 @@ - com.google.gwt + org.gwtproject gwt-user provided diff --git a/formsvalidations/src/main/java/org/dominokit/domino/formsvalidations/client/views/ui/FormsValidationsViewImpl.java b/formsvalidations/src/main/java/org/dominokit/domino/formsvalidations/client/views/ui/FormsValidationsViewImpl.java index a44568a7..d97ba5d4 100644 --- a/formsvalidations/src/main/java/org/dominokit/domino/formsvalidations/client/views/ui/FormsValidationsViewImpl.java +++ b/formsvalidations/src/main/java/org/dominokit/domino/formsvalidations/client/views/ui/FormsValidationsViewImpl.java @@ -1,6 +1,7 @@ package org.dominokit.domino.formsvalidations.client.views.ui; import elemental2.dom.HTMLDivElement; +import static org.dominokit.domino.ui.utils.Domino.*; import org.dominokit.domino.SampleClass; import org.dominokit.domino.SampleMethod; import org.dominokit.domino.api.client.annotations.UiView; diff --git a/gridLayout/pom.xml b/gridLayout/pom.xml index 623a08d6..c8369b5e 100644 --- a/gridLayout/pom.xml +++ b/gridLayout/pom.xml @@ -1,5 +1,5 @@ - + 4.0.0 domino-ui-demo @@ -15,7 +15,7 @@ - com.google.gwt + org.gwtproject gwt-user provided diff --git a/gridLayout/src/main/java/org/dominokit/domino/gridLayout/client/views/ui/GridLayoutViewImpl.java b/gridLayout/src/main/java/org/dominokit/domino/gridLayout/client/views/ui/GridLayoutViewImpl.java index c4671818..d867c21a 100644 --- a/gridLayout/src/main/java/org/dominokit/domino/gridLayout/client/views/ui/GridLayoutViewImpl.java +++ b/gridLayout/src/main/java/org/dominokit/domino/gridLayout/client/views/ui/GridLayoutViewImpl.java @@ -1,6 +1,7 @@ package org.dominokit.domino.gridLayout.client.views.ui; import elemental2.dom.HTMLDivElement; +import static org.dominokit.domino.ui.utils.Domino.*; import org.dominokit.domino.api.client.annotations.UiView; import org.dominokit.domino.componentcase.client.ui.views.BaseDemoView; import org.dominokit.domino.componentcase.client.ui.views.CodeCard; diff --git a/grids/pom.xml b/grids/pom.xml index b7c0a587..ed748bfb 100644 --- a/grids/pom.xml +++ b/grids/pom.xml @@ -1,5 +1,5 @@ - 4.0.0 @@ -16,7 +16,7 @@ - com.google.gwt + org.gwtproject gwt-user provided diff --git a/grids/src/main/java/org/dominokit/domino/grids/client/views/ui/GridsViewImpl.java b/grids/src/main/java/org/dominokit/domino/grids/client/views/ui/GridsViewImpl.java index 7e82d564..d1595389 100644 --- a/grids/src/main/java/org/dominokit/domino/grids/client/views/ui/GridsViewImpl.java +++ b/grids/src/main/java/org/dominokit/domino/grids/client/views/ui/GridsViewImpl.java @@ -3,6 +3,7 @@ import com.google.gwt.core.client.GWT; import com.google.gwt.core.client.RunAsyncCallback; import elemental2.dom.HTMLDivElement; +import static org.dominokit.domino.ui.utils.Domino.*; import org.dominokit.domino.SampleClass; import org.dominokit.domino.SampleMethod; import org.dominokit.domino.api.client.annotations.UiView; diff --git a/helpers/pom.xml b/helpers/pom.xml index b3bd11cf..c92921ae 100644 --- a/helpers/pom.xml +++ b/helpers/pom.xml @@ -1,5 +1,5 @@ - + 4.0.0 domino-ui-demo @@ -15,7 +15,7 @@ - com.google.gwt + org.gwtproject gwt-user provided diff --git a/helpers/src/main/java/org/dominokit/domino/helpers/client/views/ui/HelpersViewImpl.java b/helpers/src/main/java/org/dominokit/domino/helpers/client/views/ui/HelpersViewImpl.java index d69d1a6c..a41366e5 100644 --- a/helpers/src/main/java/org/dominokit/domino/helpers/client/views/ui/HelpersViewImpl.java +++ b/helpers/src/main/java/org/dominokit/domino/helpers/client/views/ui/HelpersViewImpl.java @@ -5,22 +5,19 @@ import org.dominokit.domino.SampleMethod; import org.dominokit.domino.api.client.annotations.UiView; import org.dominokit.domino.componentcase.client.ui.views.BaseDemoView; -import org.dominokit.domino.componentcase.client.ui.views.CodeCard; import org.dominokit.domino.componentcase.client.ui.views.LinkToSourceCode; import org.dominokit.domino.helpers.client.presenters.HelpersProxy; import org.dominokit.domino.helpers.client.views.HelpersView; import org.dominokit.domino.ui.cards.Card; import org.dominokit.domino.ui.elements.DivElement; -import org.dominokit.domino.ui.grid.Column; -import org.dominokit.domino.ui.grid.Row; -import org.dominokit.domino.ui.style.Color; import org.dominokit.domino.ui.style.CssClass; import org.dominokit.domino.ui.typography.BlockHeader; -import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import static org.dominokit.domino.ui.utils.Domino.*; + @UiView(presentable = HelpersProxy.class) @SampleClass public class HelpersViewImpl extends BaseDemoView implements HelpersView { diff --git a/home/pom.xml b/home/pom.xml index fc0ffced..a52a6210 100644 --- a/home/pom.xml +++ b/home/pom.xml @@ -1,5 +1,5 @@ - 4.0.0 @@ -14,7 +14,7 @@ - com.google.gwt + org.gwtproject gwt-user provided diff --git a/home/src/main/java/org/dominokit/domino/home/client/views/ui/HomeViewImpl.java b/home/src/main/java/org/dominokit/domino/home/client/views/ui/HomeViewImpl.java index 045fee65..8919184d 100644 --- a/home/src/main/java/org/dominokit/domino/home/client/views/ui/HomeViewImpl.java +++ b/home/src/main/java/org/dominokit/domino/home/client/views/ui/HomeViewImpl.java @@ -25,6 +25,7 @@ import org.gwtproject.timer.client.Timer; import static elemental2.dom.DomGlobal.window; +import static org.dominokit.domino.ui.utils.Domino.*; @UiView(presentable = HomeProxy.class) public class HomeViewImpl extends BaseDemoView implements HomeView { diff --git a/home/src/main/java/org/dominokit/domino/home/client/views/ui/SampleComponent.java b/home/src/main/java/org/dominokit/domino/home/client/views/ui/SampleComponent.java index 16884c0f..e83ea3ba 100644 --- a/home/src/main/java/org/dominokit/domino/home/client/views/ui/SampleComponent.java +++ b/home/src/main/java/org/dominokit/domino/home/client/views/ui/SampleComponent.java @@ -7,6 +7,8 @@ import org.dominokit.domino.ui.style.CssClass; import org.dominokit.domino.ui.utils.BaseDominoElement; +import static org.dominokit.domino.ui.utils.Domino.*; + public class SampleComponent extends BaseDominoElement { CssClass dui_flex_grow_1 = ()-> "dui-flex-grow-1"; diff --git a/infobox/pom.xml b/infobox/pom.xml index 62ebb5aa..59142caf 100644 --- a/infobox/pom.xml +++ b/infobox/pom.xml @@ -1,5 +1,5 @@ - 4.0.0 @@ -14,7 +14,7 @@ - com.google.gwt + org.gwtproject gwt-user provided diff --git a/infobox/src/main/java/org/dominokit/domino/infobox/client/views/ui/InfoBoxViewImpl.java b/infobox/src/main/java/org/dominokit/domino/infobox/client/views/ui/InfoBoxViewImpl.java index 9d6fd3f3..074f6aaa 100644 --- a/infobox/src/main/java/org/dominokit/domino/infobox/client/views/ui/InfoBoxViewImpl.java +++ b/infobox/src/main/java/org/dominokit/domino/infobox/client/views/ui/InfoBoxViewImpl.java @@ -1,6 +1,7 @@ package org.dominokit.domino.infobox.client.views.ui; import elemental2.dom.HTMLDivElement; +import static org.dominokit.domino.ui.utils.Domino.*; import org.dominokit.domino.SampleClass; import org.dominokit.domino.SampleMethod; import org.dominokit.domino.api.client.annotations.UiView; diff --git a/inputfields/pom.xml b/inputfields/pom.xml index 729f7ff7..12811869 100644 --- a/inputfields/pom.xml +++ b/inputfields/pom.xml @@ -1,5 +1,5 @@ - + 4.0.0 domino-ui-demo @@ -15,7 +15,7 @@ - com.google.gwt + org.gwtproject gwt-user provided diff --git a/inputfields/src/main/java/org/dominokit/domino/inputfields/client/views/ui/InputFieldsViewImpl.java b/inputfields/src/main/java/org/dominokit/domino/inputfields/client/views/ui/InputFieldsViewImpl.java index 0a170eb3..253b995c 100644 --- a/inputfields/src/main/java/org/dominokit/domino/inputfields/client/views/ui/InputFieldsViewImpl.java +++ b/inputfields/src/main/java/org/dominokit/domino/inputfields/client/views/ui/InputFieldsViewImpl.java @@ -1,6 +1,5 @@ package org.dominokit.domino.inputfields.client.views.ui; -import elemental2.dom.DomGlobal; import elemental2.dom.HTMLDivElement; import org.dominokit.domino.SampleClass; import org.dominokit.domino.SampleMethod; @@ -29,10 +28,11 @@ import org.dominokit.domino.ui.grid.Row; import org.dominokit.domino.ui.notifications.Notification; import org.dominokit.domino.ui.typography.BlockHeader; -import org.dominokit.domino.ui.utils.DominoElement; import java.math.BigDecimal; +import static org.dominokit.domino.ui.utils.Domino.div; + @UiView(presentable = InputFieldsProxy.class) @SampleClass public class InputFieldsViewImpl extends BaseDemoView implements InputFieldsView { diff --git a/labels/pom.xml b/labels/pom.xml index a9e5e200..ea0095ce 100644 --- a/labels/pom.xml +++ b/labels/pom.xml @@ -1,5 +1,5 @@ - 4.0.0 @@ -14,7 +14,7 @@ - com.google.gwt + org.gwtproject gwt-user provided diff --git a/labels/src/main/java/org/dominokit/domino/labels/client/views/ui/LabelsViewImpl.java b/labels/src/main/java/org/dominokit/domino/labels/client/views/ui/LabelsViewImpl.java index a1b1d2d6..6734d276 100644 --- a/labels/src/main/java/org/dominokit/domino/labels/client/views/ui/LabelsViewImpl.java +++ b/labels/src/main/java/org/dominokit/domino/labels/client/views/ui/LabelsViewImpl.java @@ -1,6 +1,7 @@ package org.dominokit.domino.labels.client.views.ui; import elemental2.dom.HTMLDivElement; +import static org.dominokit.domino.ui.utils.Domino.*; import org.dominokit.domino.SampleClass; import org.dominokit.domino.SampleMethod; import org.dominokit.domino.api.client.annotations.UiView; diff --git a/layout/layout-frontend-ui/pom.xml b/layout/layout-frontend-ui/pom.xml index 65256263..f95df836 100644 --- a/layout/layout-frontend-ui/pom.xml +++ b/layout/layout-frontend-ui/pom.xml @@ -1,5 +1,5 @@ - 4.0.0 @@ -14,7 +14,7 @@ - com.google.gwt + org.gwtproject gwt-user provided diff --git a/layout/layout-frontend-ui/src/main/java/org/dominokit/domino/layout/client/ui/views/LayoutViewImpl.java b/layout/layout-frontend-ui/src/main/java/org/dominokit/domino/layout/client/ui/views/LayoutViewImpl.java index 4ff89274..0d95bf09 100644 --- a/layout/layout-frontend-ui/src/main/java/org/dominokit/domino/layout/client/ui/views/LayoutViewImpl.java +++ b/layout/layout-frontend-ui/src/main/java/org/dominokit/domino/layout/client/ui/views/LayoutViewImpl.java @@ -17,7 +17,7 @@ import org.dominokit.domino.ui.loaders.LoaderEffect; import org.dominokit.domino.ui.menu.direction.DropDirection; import org.dominokit.domino.ui.scroll.ScrollTop; -import org.dominokit.domino.ui.style.*; +import org.dominokit.domino.ui.style.DominoCss; import org.dominokit.domino.ui.themes.DominoThemeDark; import org.dominokit.domino.ui.themes.DominoThemeLight; import org.dominokit.domino.ui.themes.DominoThemeManager; diff --git a/layout/layout-frontend/pom.xml b/layout/layout-frontend/pom.xml index 26e997e0..df98764c 100644 --- a/layout/layout-frontend/pom.xml +++ b/layout/layout-frontend/pom.xml @@ -1,5 +1,5 @@ - 4.0.0 @@ -14,7 +14,7 @@ - com.google.gwt + org.gwtproject gwt-user provided diff --git a/lists/pom.xml b/lists/pom.xml index 6114c8f3..d5ddb2d9 100644 --- a/lists/pom.xml +++ b/lists/pom.xml @@ -1,5 +1,5 @@ - 4.0.0 @@ -14,7 +14,7 @@ - com.google.gwt + org.gwtproject gwt-user provided diff --git a/lists/src/main/java/org/dominokit/domino/lists/client/views/ui/ListsViewImpl.java b/lists/src/main/java/org/dominokit/domino/lists/client/views/ui/ListsViewImpl.java index d7119a67..80fafa2a 100644 --- a/lists/src/main/java/org/dominokit/domino/lists/client/views/ui/ListsViewImpl.java +++ b/lists/src/main/java/org/dominokit/domino/lists/client/views/ui/ListsViewImpl.java @@ -1,6 +1,7 @@ package org.dominokit.domino.lists.client.views.ui; import elemental2.dom.HTMLDivElement; +import static org.dominokit.domino.ui.utils.Domino.*; import org.dominokit.domino.SampleClass; import org.dominokit.domino.SampleMethod; import org.dominokit.domino.api.client.annotations.UiView; diff --git a/loaders/pom.xml b/loaders/pom.xml index c7530c4f..a449c932 100644 --- a/loaders/pom.xml +++ b/loaders/pom.xml @@ -1,5 +1,5 @@ - 4.0.0 @@ -14,7 +14,7 @@ - com.google.gwt + org.gwtproject gwt-user provided diff --git a/loaders/src/main/java/org/dominokit/domino/loaders/client/views/ui/LoadersViewImpl.java b/loaders/src/main/java/org/dominokit/domino/loaders/client/views/ui/LoadersViewImpl.java index f87307bd..a3f6efba 100644 --- a/loaders/src/main/java/org/dominokit/domino/loaders/client/views/ui/LoadersViewImpl.java +++ b/loaders/src/main/java/org/dominokit/domino/loaders/client/views/ui/LoadersViewImpl.java @@ -1,6 +1,5 @@ package org.dominokit.domino.loaders.client.views.ui; -import elemental2.dom.DomGlobal; import elemental2.dom.EventListener; import elemental2.dom.HTMLDivElement; import org.dominokit.domino.SampleClass; @@ -23,6 +22,8 @@ import org.dominokit.domino.ui.typography.BlockHeader; import org.gwtproject.timer.client.Timer; +import static org.dominokit.domino.ui.utils.Domino.*; + @UiView(presentable = LoadersProxy.class) @SampleClass public class LoadersViewImpl extends BaseDemoView implements LoadersView { diff --git a/login/pom.xml b/login/pom.xml deleted file mode 100644 index f684e861..00000000 --- a/login/pom.xml +++ /dev/null @@ -1,94 +0,0 @@ - - - 4.0.0 - - domino-ui-demo - org.dominokit - HEAD-SNAPSHOT - - - login - gwt-lib - - login - http://maven.apache.org - - - - com.google.gwt - gwt-user - provided - - - org.dominokit - domino-mvp-api-shared - - - org.dominokit - domino-mvp-api-client - - - org.dominokit - domino-mvp-api-client - sources - - - org.dominokit - domino-slf4j-logger - - - org.dominokit - domino-mvp-apt-client - provided - - - org.dominokit - domino-mvp-client-test - test - - - - org.dominokit - component-case-frontend-ui - ${project.version} - - - org.dominokit - component-case-frontend-ui - ${project.version} - sources - - - org.dominokit - sample-processor - ${project.version} - provided - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - -Xlint:all - true - true - - - - net.ltgt.gwt.maven - gwt-maven-plugin - true - - org.dominokit.domino.login.LoginClientModule - - - - org.apache.maven.plugins - maven-source-plugin - - - - diff --git a/login/src/main/java/org/dominokit/domino/login/client/views/ui/LoginViewImpl.java b/login/src/main/java/org/dominokit/domino/login/client/views/ui/LoginViewImpl.java deleted file mode 100644 index f232fca5..00000000 --- a/login/src/main/java/org/dominokit/domino/login/client/views/ui/LoginViewImpl.java +++ /dev/null @@ -1,243 +0,0 @@ -package org.dominokit.domino.login.client.views.ui; - -import elemental2.dom.HTMLDivElement; -import org.dominokit.domino.SampleClass; -import org.dominokit.domino.SampleMethod; -import org.dominokit.domino.api.client.annotations.UiView; -import org.dominokit.domino.componentcase.client.ui.views.BaseDemoView; -import org.dominokit.domino.componentcase.client.ui.views.CodeCard; -import org.dominokit.domino.componentcase.client.ui.views.LinkToSourceCode; -import org.dominokit.domino.login.client.presenters.LoginProxy; -import org.dominokit.domino.login.client.views.LoginView; -import org.dominokit.domino.ui.button.Button; -import org.dominokit.domino.ui.cards.Card; -import org.dominokit.domino.ui.forms.CheckBox; -import org.dominokit.domino.ui.forms.TextBox; -import org.dominokit.domino.ui.grid.Column; -import org.dominokit.domino.ui.grid.Row; -import org.dominokit.domino.ui.header.BlockHeader; -import org.dominokit.domino.ui.icons.lib.Icons; -import org.dominokit.domino.ui.style.Color; -import org.dominokit.domino.ui.style.Elevation; -import org.dominokit.domino.ui.style.Styles; -import org.dominokit.domino.ui.utils.DominoElement; - -import static org.jboss.elemento.Elements.div; -import static org.jboss.elemento.Elements.img; - -@UiView(presentable = LoginProxy.class) -@SampleClass -public class LoginViewImpl extends BaseDemoView implements LoginView { - - private HTMLDivElement element; - - @Override - protected HTMLDivElement init() { - element = div().element(); - - element.appendChild(BlockHeader.create("LOGIN", "Sample login dialogs").element()); - element.appendChild(LinkToSourceCode.create("login", LoginViewImpl.class).element()); - - sample1(); - element.appendChild(CodeCard.createCodeCard(CodeResource.INSTANCE.sample1()).element()); - - sample2(); - element.appendChild(CodeCard.createCodeCard(CodeResource.INSTANCE.sample2()).element()); - - sample3(); - element.appendChild(CodeCard.createCodeCard(CodeResource.INSTANCE.sample3()).element()); - - sample4(); - element.appendChild(CodeCard.createCodeCard(CodeResource.INSTANCE.sample4()).element()); - - sample5(); - element.appendChild(CodeCard.createCodeCard(CodeResource.INSTANCE.sample5()).element()); - - sample6(); - element.appendChild(CodeCard.createCodeCard(CodeResource.INSTANCE.sample6()).element()); - - return element; - } - - @SampleMethod - private void sample1() { - element.appendChild(Row.create() - .appendChild(Column.span4() - .offset4() - .appendChild(Card.create("LOGIN") - .appendChild(TextBox.create("User name") - .setRequired(true) - .setAutoValidation(true)) - .appendChild(TextBox.password("Password") - .setRequired(true) - .setAutoValidation(true)) - .appendChild(Button.create(Icons.lock_open()) - .setBackground(Color.THEME) - .setContent("Login") - .block()) - )) - .element()); - } - - @SampleMethod - private void sample2() { - element.appendChild(Row.create() - .appendChild(Column.span4() - .offset4() - .appendChild(Card.create("LOGIN") - .setHeaderBackground(Color.THEME) - .appendChild(TextBox.create("User name") - .addLeftAddOn(Icons.account()) - .setRequired(true) - .setAutoValidation(true)) - .appendChild(TextBox.password("Password") - .addLeftAddOn(Icons.security()) - .setRequired(true) - .setAutoValidation(true)) - .appendChild(CheckBox.create("Remember me") - .style().addCss(Styles.m_l_15)) - .appendChild(Button.create(Icons.lock_open()) - .setBackground(Color.THEME) - .setContent("Login") - .block()) - )) - .element()); - } - - @SampleMethod - private void sample3() { - element.appendChild(Row.create() - .appendChild(Column.span4() - .offset4() - .appendChild(Card.create("LOGIN") - .setHeaderBackground(Color.THEME) - .appendChild(TextBox.create("User name") - .addLeftAddOn(Icons.account()) - .setRequired(true) - .setAutoValidation(true)) - .appendChild(TextBox.password("Password") - .addLeftAddOn(Icons.security()) - .setRequired(true) - .setAutoValidation(true)) - .appendChild(CheckBox.create("Remember me") - .style().addCss(Styles.m_l_15)) - .appendChild(div() - .add(Button.create(Icons.lock_open()) - .setBackground(Color.THEME) - .setContent("Login") - .styler(style -> style.setMinWidth("120px"))) - .add(Button.create("Forget password") - .linkify() - .style() - .addCss(Styles.pull_right))) - )) - .element()); - } - - @SampleMethod - private void sample4() { - element.appendChild(Row.create() - .appendChild(Column.span4() - .offset4() - .appendChild(Card.create() - .fitContent() - .appendChild(img("images/login/login-bg-1.jpg") - .css(Styles.img_responsive)) - .appendChild(DominoElement.of(div().css(Styles.padding_20)) - .appendChild(TextBox.create("User name") - .setRequired(true) - .setAutoValidation(true)) - .appendChild(TextBox.password("Password") - .setRequired(true) - .setAutoValidation(true)) - .appendChild(Button.createSuccess(Icons.lock_open()) - .setContent("Login") - .block()) - ) - - )) - .element()); - } - - @SampleMethod - private void sample5() { - element.appendChild(Row.create() - .appendChild(Column.span4() - .offset4() - .appendChild(Card.create() - .fitContent() - .appendChild(div() - .css(Styles.align_center) - .css(Styles.padding_30) - .css("avatar-container") - .add(img("images/login/login-bg-2.png") - .css(Styles.img_responsive) - .css(Elevation.LEVEL_1.getStyle()) - .css("login-avatar"))) - .appendChild(DominoElement.of(div().css(Styles.padding_30)) - .appendChild(TextBox.create("User name") - .addLeftAddOn(Icons.account()) - .floating() - .setRequired(true) - .setAutoValidation(true)) - .appendChild(TextBox.password("Password") - .addLeftAddOn(Icons.security()) - .floating() - .setRequired(true) - .setAutoValidation(true)) - .appendChild(Button.create(Icons.lock_open()) - .setBackground(Color.CYAN) - .setContent("Login") - .block()) - ) - - )) - .element()); - } - - @SampleMethod - private void sample6() { - element.appendChild(Row.create() - .appendChild(Column.span6() - .offset3() - .appendChild(Card.create() - .fitContent() - .appendChild(Row.create() - .styler(style -> style.setPadding("0px")) - .condensed() - .appendChild(Column.span6() - .condense() - .appendChild(div() - .css("avatar-container") - .add(img("images/greyscale-1.jpg") - .css(Styles.img_responsive)))) - .appendChild(Column.span6() - .condense() - .appendChild(DominoElement.of(div() - .css(Styles.p_l_30) - .css(Styles.p_r_30) - .css(Styles.p_b_30) - .css(Styles.p_t_60) - .style("height: 100%;")) - .appendChild(TextBox.create("User name") - .addLeftAddOn(Icons.account()) - .floating() - .setRequired(true) - .setAutoValidation(true)) - .appendChild(TextBox.password("Password") - .addLeftAddOn(Icons.security()) - .floating() - .setRequired(true) - .setAutoValidation(true)) - .appendChild(Button.create(Icons.lock_open()) - .setBackground(Color.THEME) - .setContent("Login") - .style() - .addCss(Styles.pull_right) - .addCss("side-login-btn")) - )) - ) - )) - .element()); - } -} \ No newline at end of file diff --git a/mdiicons/pom.xml b/mdiicons/pom.xml index f2658b33..967f0208 100644 --- a/mdiicons/pom.xml +++ b/mdiicons/pom.xml @@ -1,5 +1,5 @@ - + 4.0.0 domino-ui-demo @@ -15,7 +15,7 @@ - com.google.gwt + org.gwtproject gwt-user provided diff --git a/mdiicons/src/main/java/org/dominokit/domino/mdiicons/client/views/ui/MdiIconsViewImpl.java b/mdiicons/src/main/java/org/dominokit/domino/mdiicons/client/views/ui/MdiIconsViewImpl.java index 8b8ceb6b..d0e23d95 100644 --- a/mdiicons/src/main/java/org/dominokit/domino/mdiicons/client/views/ui/MdiIconsViewImpl.java +++ b/mdiicons/src/main/java/org/dominokit/domino/mdiicons/client/views/ui/MdiIconsViewImpl.java @@ -36,7 +36,7 @@ import java.util.stream.Collectors; import static java.util.Objects.isNull; - +import static org.dominokit.domino.ui.utils.Domino.*; @UiView(presentable = MdiIconsProxy.class) public class MdiIconsViewImpl extends BaseDemoView implements MdiIconsView { diff --git a/media/pom.xml b/media/pom.xml index a2371195..fbe18fab 100644 --- a/media/pom.xml +++ b/media/pom.xml @@ -1,5 +1,5 @@ - + 4.0.0 domino-ui-demo @@ -15,7 +15,7 @@ - com.google.gwt + org.gwtproject gwt-user provided diff --git a/media/src/main/java/org/dominokit/domino/media/client/views/ui/MediaViewImpl.java b/media/src/main/java/org/dominokit/domino/media/client/views/ui/MediaViewImpl.java index 3fb43627..8743257e 100644 --- a/media/src/main/java/org/dominokit/domino/media/client/views/ui/MediaViewImpl.java +++ b/media/src/main/java/org/dominokit/domino/media/client/views/ui/MediaViewImpl.java @@ -1,6 +1,7 @@ package org.dominokit.domino.media.client.views.ui; import elemental2.dom.HTMLDivElement; +import static org.dominokit.domino.ui.utils.Domino.*; import org.dominokit.domino.SampleClass; import org.dominokit.domino.SampleMethod; import org.dominokit.domino.api.client.annotations.UiView; diff --git a/menu/pom.xml b/menu/pom.xml index 9993b910..e25ca4de 100644 --- a/menu/pom.xml +++ b/menu/pom.xml @@ -1,5 +1,5 @@ - 4.0.0 @@ -14,7 +14,7 @@ - com.google.gwt + org.gwtproject gwt-user provided diff --git a/menu/src/main/java/org/dominokit/domino/menu/client/views/ui/MenuViewImpl.java b/menu/src/main/java/org/dominokit/domino/menu/client/views/ui/MenuViewImpl.java index e051128e..193b9ac0 100644 --- a/menu/src/main/java/org/dominokit/domino/menu/client/views/ui/MenuViewImpl.java +++ b/menu/src/main/java/org/dominokit/domino/menu/client/views/ui/MenuViewImpl.java @@ -1,6 +1,7 @@ package org.dominokit.domino.menu.client.views.ui; import elemental2.dom.HTMLDivElement; +import static org.dominokit.domino.ui.utils.Domino.*; import org.dominokit.domino.SampleClass; import org.dominokit.domino.SampleMethod; import org.dominokit.domino.api.client.annotations.UiView; diff --git a/modals/pom.xml b/modals/pom.xml index c45a4006..c2e88e1c 100644 --- a/modals/pom.xml +++ b/modals/pom.xml @@ -1,5 +1,5 @@ - 4.0.0 @@ -14,7 +14,7 @@ - com.google.gwt + org.gwtproject gwt-user provided diff --git a/modals/src/main/java/org/dominokit/domino/modals/client/views/ui/ModalsViewImpl.java b/modals/src/main/java/org/dominokit/domino/modals/client/views/ui/ModalsViewImpl.java index d8008da0..8d1c0dd7 100644 --- a/modals/src/main/java/org/dominokit/domino/modals/client/views/ui/ModalsViewImpl.java +++ b/modals/src/main/java/org/dominokit/domino/modals/client/views/ui/ModalsViewImpl.java @@ -2,6 +2,7 @@ import elemental2.dom.DomGlobal; import elemental2.dom.HTMLDivElement; +import static org.dominokit.domino.ui.utils.Domino.*; import org.dominokit.domino.SampleClass; import org.dominokit.domino.SampleMethod; import org.dominokit.domino.api.client.annotations.UiView; diff --git a/notifications/pom.xml b/notifications/pom.xml index b58eb3b4..59595ead 100644 --- a/notifications/pom.xml +++ b/notifications/pom.xml @@ -1,5 +1,5 @@ - + 4.0.0 domino-ui-demo @@ -15,7 +15,7 @@ - com.google.gwt + org.gwtproject gwt-user provided diff --git a/notifications/src/main/java/org/dominokit/domino/notifications/client/views/ui/NotificationsViewImpl.java b/notifications/src/main/java/org/dominokit/domino/notifications/client/views/ui/NotificationsViewImpl.java index 17321d62..daa47f00 100644 --- a/notifications/src/main/java/org/dominokit/domino/notifications/client/views/ui/NotificationsViewImpl.java +++ b/notifications/src/main/java/org/dominokit/domino/notifications/client/views/ui/NotificationsViewImpl.java @@ -1,6 +1,7 @@ package org.dominokit.domino.notifications.client.views.ui; import elemental2.dom.HTMLDivElement; +import static org.dominokit.domino.ui.utils.Domino.*; import org.dominokit.domino.SampleClass; import org.dominokit.domino.SampleMethod; import org.dominokit.domino.api.client.annotations.UiView; diff --git a/pagination/pom.xml b/pagination/pom.xml index 17e0a62e..40118baa 100644 --- a/pagination/pom.xml +++ b/pagination/pom.xml @@ -1,5 +1,5 @@ - + 4.0.0 domino-ui-demo @@ -15,7 +15,7 @@ - com.google.gwt + org.gwtproject gwt-user provided diff --git a/pagination/src/main/java/org/dominokit/domino/pagination/client/views/ui/PaginationViewImpl.java b/pagination/src/main/java/org/dominokit/domino/pagination/client/views/ui/PaginationViewImpl.java index e718e22d..7ea9c3e4 100644 --- a/pagination/src/main/java/org/dominokit/domino/pagination/client/views/ui/PaginationViewImpl.java +++ b/pagination/src/main/java/org/dominokit/domino/pagination/client/views/ui/PaginationViewImpl.java @@ -10,7 +10,6 @@ import org.dominokit.domino.componentcase.client.ui.views.LinkToSourceCode; import org.dominokit.domino.pagination.client.presenters.PaginationProxy; import org.dominokit.domino.pagination.client.views.PaginationView; -import org.dominokit.domino.ui.button.Button; import org.dominokit.domino.ui.cards.Card; import org.dominokit.domino.ui.elements.DivElement; import org.dominokit.domino.ui.grid.Column; @@ -21,6 +20,8 @@ import org.dominokit.domino.ui.pagination.SimplePagination; import org.dominokit.domino.ui.typography.BlockHeader; +import static org.dominokit.domino.ui.utils.Domino.*; + @UiView(presentable = PaginationProxy.class) @SampleClass public class PaginationViewImpl extends BaseDemoView implements PaginationView { diff --git a/pom.xml b/pom.xml index 68a9170e..8d7ced74 100644 --- a/pom.xml +++ b/pom.xml @@ -58,9 +58,7 @@ steppers datepicker timepicker - - datatable - + datatable sample-processor sample-annotations ui-demo-server @@ -81,11 +79,12 @@ 3.9.16 1.0.3 - 1.1.0 + 1.2.1 1.0.0 1.0.0 HEAD-SNAPSHOT HEAD-SNAPSHOT + 2.11.0 @@ -109,12 +108,22 @@ import - com.google.gwt + org.gwtproject gwt - 2.10.0 + ${gwt.version} pom import + + org.gwtproject + gwt-user + ${gwt.version} + + + org.gwtproject + gwt-dev + ${gwt.version} + org.jboss.elemento elemento-core @@ -143,6 +152,38 @@ sources + + com.google.auto.service + auto-service + 1.1.1 + + + com.google.elemental2 + elemental2-svg + ${elemental2.version} + + + com.google.elemental2 + elemental2-svg + ${elemental2.version} + sources + + + com.google.elemental2 + elemental2-core + ${elemental2.version} + + + com.google.elemental2 + elemental2-core + ${elemental2.version} + sources + + + com.google.jsinterop + base + 1.0.1 + @@ -166,7 +207,6 @@ com.google.auto.service auto-service - 1.0-rc7 provided @@ -286,6 +326,9 @@ 1.8 true + + + diff --git a/popover/pom.xml b/popover/pom.xml index 6fb7208f..1ffbcf75 100644 --- a/popover/pom.xml +++ b/popover/pom.xml @@ -1,5 +1,5 @@ - + 4.0.0 domino-ui-demo @@ -15,7 +15,7 @@ - com.google.gwt + org.gwtproject gwt-user provided diff --git a/popover/src/main/java/org/dominokit/domino/popover/client/views/ui/PopoverViewImpl.java b/popover/src/main/java/org/dominokit/domino/popover/client/views/ui/PopoverViewImpl.java index 422026ed..82bf38aa 100644 --- a/popover/src/main/java/org/dominokit/domino/popover/client/views/ui/PopoverViewImpl.java +++ b/popover/src/main/java/org/dominokit/domino/popover/client/views/ui/PopoverViewImpl.java @@ -1,6 +1,7 @@ package org.dominokit.domino.popover.client.views.ui; import elemental2.dom.HTMLDivElement; +import static org.dominokit.domino.ui.utils.Domino.*; import org.dominokit.domino.SampleClass; import org.dominokit.domino.SampleMethod; import org.dominokit.domino.api.client.annotations.UiView; diff --git a/preloaders/pom.xml b/preloaders/pom.xml index 07578ce4..2fe15974 100644 --- a/preloaders/pom.xml +++ b/preloaders/pom.xml @@ -1,5 +1,5 @@ - + 4.0.0 domino-ui-demo @@ -15,7 +15,7 @@ - com.google.gwt + org.gwtproject gwt-user provided diff --git a/preloaders/src/main/java/org/dominokit/domino/preloaders/client/views/ui/PreloadersViewImpl.java b/preloaders/src/main/java/org/dominokit/domino/preloaders/client/views/ui/PreloadersViewImpl.java index 4ae58f0f..0312aee7 100644 --- a/preloaders/src/main/java/org/dominokit/domino/preloaders/client/views/ui/PreloadersViewImpl.java +++ b/preloaders/src/main/java/org/dominokit/domino/preloaders/client/views/ui/PreloadersViewImpl.java @@ -1,6 +1,7 @@ package org.dominokit.domino.preloaders.client.views.ui; import elemental2.dom.HTMLDivElement; +import static org.dominokit.domino.ui.utils.Domino.*; import org.dominokit.domino.SampleClass; import org.dominokit.domino.SampleMethod; import org.dominokit.domino.api.client.annotations.UiView; diff --git a/profile/pom.xml b/profile/pom.xml index 81fcdd67..ec8ae66e 100644 --- a/profile/pom.xml +++ b/profile/pom.xml @@ -1,5 +1,5 @@ - 4.0.0 @@ -14,7 +14,7 @@ - com.google.gwt + org.gwtproject gwt-user provided diff --git a/profile/src/main/java/org/dominokit/domino/profile/client/views/ui/ProfileViewImpl.java b/profile/src/main/java/org/dominokit/domino/profile/client/views/ui/ProfileViewImpl.java index 51fd5f6d..3cd7fbf3 100644 --- a/profile/src/main/java/org/dominokit/domino/profile/client/views/ui/ProfileViewImpl.java +++ b/profile/src/main/java/org/dominokit/domino/profile/client/views/ui/ProfileViewImpl.java @@ -10,12 +10,14 @@ import org.dominokit.domino.profile.client.presenters.ProfileProxy; import org.dominokit.domino.profile.client.views.ProfileView; import org.dominokit.domino.ui.elements.DivElement; -import org.dominokit.domino.ui.icons.lib.Icons; import org.dominokit.domino.ui.icons.LabeledIcon; +import org.dominokit.domino.ui.icons.lib.Icons; import org.dominokit.domino.ui.style.Calc; import org.dominokit.domino.ui.utils.Unit; import org.dominokit.domino.view.BaseElementView; +import static org.dominokit.domino.ui.utils.Domino.*; + @UiView(presentable = ProfileProxy.class) public class ProfileViewImpl extends BaseElementView implements ProfileView { diff --git a/progress/pom.xml b/progress/pom.xml index 8ee9d6c5..f9cff49d 100644 --- a/progress/pom.xml +++ b/progress/pom.xml @@ -1,5 +1,5 @@ - + 4.0.0 domino-ui-demo @@ -15,7 +15,7 @@ - com.google.gwt + org.gwtproject gwt-user provided diff --git a/progress/src/main/java/org/dominokit/domino/progress/client/views/ui/ProgressViewImpl.java b/progress/src/main/java/org/dominokit/domino/progress/client/views/ui/ProgressViewImpl.java index cc4f703a..5b0ac222 100644 --- a/progress/src/main/java/org/dominokit/domino/progress/client/views/ui/ProgressViewImpl.java +++ b/progress/src/main/java/org/dominokit/domino/progress/client/views/ui/ProgressViewImpl.java @@ -1,7 +1,5 @@ package org.dominokit.domino.progress.client.views.ui; -import elemental2.dom.DomGlobal; -import elemental2.dom.FrameRequestCallback; import elemental2.dom.HTMLDivElement; import org.dominokit.domino.SampleClass; import org.dominokit.domino.SampleMethod; @@ -15,10 +13,11 @@ import org.dominokit.domino.ui.elements.DivElement; import org.dominokit.domino.ui.progress.Progress; import org.dominokit.domino.ui.progress.ProgressBar; -import org.dominokit.domino.ui.style.Color; import org.dominokit.domino.ui.typography.BlockHeader; import org.gwtproject.timer.client.Timer; +import static org.dominokit.domino.ui.utils.Domino.*; + @UiView(presentable = ProgressProxy.class) @SampleClass public class ProgressViewImpl extends BaseDemoView implements ProgressView { diff --git a/sample-processor/pom.xml b/sample-processor/pom.xml index d6c8bca0..cd85184a 100644 --- a/sample-processor/pom.xml +++ b/sample-processor/pom.xml @@ -1,6 +1,6 @@ - org.dominokit @@ -15,7 +15,7 @@ - com.google.gwt + org.gwtproject gwt-user diff --git a/samples/pom.xml b/samples/pom.xml index 7ef1dfca..cd8998c4 100644 --- a/samples/pom.xml +++ b/samples/pom.xml @@ -1,5 +1,5 @@ - + 4.0.0 domino-ui-demo @@ -15,7 +15,7 @@ - com.google.gwt + org.gwtproject gwt-user provided diff --git a/samples/src/main/java/org/dominokit/domino/samples/client/views/ui/SamplesViewImpl.java b/samples/src/main/java/org/dominokit/domino/samples/client/views/ui/SamplesViewImpl.java index 3ddcf140..ff313ed8 100644 --- a/samples/src/main/java/org/dominokit/domino/samples/client/views/ui/SamplesViewImpl.java +++ b/samples/src/main/java/org/dominokit/domino/samples/client/views/ui/SamplesViewImpl.java @@ -11,6 +11,8 @@ import org.dominokit.domino.ui.grid.Row; import org.dominokit.domino.ui.typography.BlockHeader; +import static org.dominokit.domino.ui.utils.Domino.*; + @UiView(presentable = SamplesProxy.class) public class SamplesViewImpl extends BaseDemoView implements SamplesView { diff --git a/setup/pom.xml b/setup/pom.xml index 052cf1de..815cd4d5 100644 --- a/setup/pom.xml +++ b/setup/pom.xml @@ -1,5 +1,5 @@ - + 4.0.0 domino-ui-demo @@ -15,7 +15,7 @@ - com.google.gwt + org.gwtproject gwt-user provided diff --git a/setup/src/main/java/org/dominokit/domino/setup/client/views/ui/SetupViewImpl.java b/setup/src/main/java/org/dominokit/domino/setup/client/views/ui/SetupViewImpl.java index 11da0ac6..3be2a437 100644 --- a/setup/src/main/java/org/dominokit/domino/setup/client/views/ui/SetupViewImpl.java +++ b/setup/src/main/java/org/dominokit/domino/setup/client/views/ui/SetupViewImpl.java @@ -10,6 +10,8 @@ import org.dominokit.domino.ui.typography.BlockHeader; import org.gwtproject.safehtml.shared.SafeHtmlBuilder; +import static org.dominokit.domino.ui.utils.Domino.div; + @UiView(presentable = SetupProxy.class) public class SetupViewImpl extends BaseDemoView implements SetupView{ diff --git a/sliders/pom.xml b/sliders/pom.xml index fa03a1ac..775ad0e0 100644 --- a/sliders/pom.xml +++ b/sliders/pom.xml @@ -1,5 +1,5 @@ - + 4.0.0 domino-ui-demo @@ -15,7 +15,7 @@ - com.google.gwt + org.gwtproject gwt-user provided diff --git a/sliders/src/main/java/org/dominokit/domino/sliders/client/views/ui/SlidersViewImpl.java b/sliders/src/main/java/org/dominokit/domino/sliders/client/views/ui/SlidersViewImpl.java index 321ece58..9cd8dccd 100644 --- a/sliders/src/main/java/org/dominokit/domino/sliders/client/views/ui/SlidersViewImpl.java +++ b/sliders/src/main/java/org/dominokit/domino/sliders/client/views/ui/SlidersViewImpl.java @@ -17,9 +17,10 @@ import org.dominokit.domino.ui.grid.Row; import org.dominokit.domino.ui.notifications.Notification; import org.dominokit.domino.ui.sliders.Slider; -import org.dominokit.domino.ui.style.SpacingCss; import org.dominokit.domino.ui.typography.BlockHeader; +import static org.dominokit.domino.ui.utils.Domino.*; + @UiView(presentable = SlidersProxy.class) @SampleClass public class SlidersViewImpl extends BaseDemoView implements SlidersView { diff --git a/spin/pom.xml b/spin/pom.xml index 47aecd81..18448e8a 100644 --- a/spin/pom.xml +++ b/spin/pom.xml @@ -1,5 +1,5 @@ - + 4.0.0 domino-ui-demo @@ -15,7 +15,7 @@ - com.google.gwt + org.gwtproject gwt-user provided diff --git a/spin/src/main/java/org/dominokit/domino/spin/client/views/ui/SpinSelectViewImpl.java b/spin/src/main/java/org/dominokit/domino/spin/client/views/ui/SpinSelectViewImpl.java index e03e41bc..979fa508 100644 --- a/spin/src/main/java/org/dominokit/domino/spin/client/views/ui/SpinSelectViewImpl.java +++ b/spin/src/main/java/org/dominokit/domino/spin/client/views/ui/SpinSelectViewImpl.java @@ -1,6 +1,7 @@ package org.dominokit.domino.spin.client.views.ui; import elemental2.dom.HTMLDivElement; +import static org.dominokit.domino.ui.utils.Domino.*; import org.dominokit.domino.SampleClass; import org.dominokit.domino.SampleMethod; import org.dominokit.domino.api.client.annotations.UiView; diff --git a/splitPanel/pom.xml b/splitPanel/pom.xml index 4b84eb70..4f65283a 100644 --- a/splitPanel/pom.xml +++ b/splitPanel/pom.xml @@ -1,5 +1,5 @@ - + 4.0.0 domino-ui-demo @@ -15,7 +15,7 @@ - com.google.gwt + org.gwtproject gwt-user provided diff --git a/splitPanel/src/main/java/org/dominokit/domino/splitPanel/client/views/ui/SplitPanelViewImpl.java b/splitPanel/src/main/java/org/dominokit/domino/splitPanel/client/views/ui/SplitPanelViewImpl.java index a18f8289..0bda69cc 100644 --- a/splitPanel/src/main/java/org/dominokit/domino/splitPanel/client/views/ui/SplitPanelViewImpl.java +++ b/splitPanel/src/main/java/org/dominokit/domino/splitPanel/client/views/ui/SplitPanelViewImpl.java @@ -13,11 +13,11 @@ import org.dominokit.domino.ui.splitpanel.HSplitPanel; import org.dominokit.domino.ui.splitpanel.SplitPanel; import org.dominokit.domino.ui.splitpanel.VSplitPanel; -import org.dominokit.domino.ui.style.Color; -import org.dominokit.domino.ui.style.ColorScheme; import org.dominokit.domino.ui.style.CssClass; import org.dominokit.domino.ui.typography.BlockHeader; +import static org.dominokit.domino.ui.utils.Domino.*; + @UiView(presentable = SplitPanelProxy.class) @SampleClass public class SplitPanelViewImpl extends BaseDemoView implements SplitPanelView { diff --git a/steppers/pom.xml b/steppers/pom.xml index d058982d..f4c2a0da 100644 --- a/steppers/pom.xml +++ b/steppers/pom.xml @@ -1,5 +1,5 @@ - + 4.0.0 domino-ui-demo @@ -15,7 +15,7 @@ - com.google.gwt + org.gwtproject gwt-user provided diff --git a/steppers/src/main/java/org/dominokit/domino/steppers/client/views/ui/SteppersViewImpl.java b/steppers/src/main/java/org/dominokit/domino/steppers/client/views/ui/SteppersViewImpl.java index bab5ad50..cb819b0f 100644 --- a/steppers/src/main/java/org/dominokit/domino/steppers/client/views/ui/SteppersViewImpl.java +++ b/steppers/src/main/java/org/dominokit/domino/steppers/client/views/ui/SteppersViewImpl.java @@ -1,6 +1,7 @@ package org.dominokit.domino.steppers.client.views.ui; import elemental2.dom.HTMLDivElement; +import static org.dominokit.domino.ui.utils.Domino.*; import org.dominokit.domino.SampleClass; import org.dominokit.domino.SampleMethod; import org.dominokit.domino.api.client.annotations.UiView; diff --git a/tabs/pom.xml b/tabs/pom.xml index 40300ca8..40508159 100644 --- a/tabs/pom.xml +++ b/tabs/pom.xml @@ -1,5 +1,5 @@ - + 4.0.0 domino-ui-demo @@ -15,7 +15,7 @@ - com.google.gwt + org.gwtproject gwt-user provided diff --git a/tabs/src/main/java/org/dominokit/domino/tabs/client/views/ui/TabsViewImpl.java b/tabs/src/main/java/org/dominokit/domino/tabs/client/views/ui/TabsViewImpl.java index 82945147..ec8c110b 100644 --- a/tabs/src/main/java/org/dominokit/domino/tabs/client/views/ui/TabsViewImpl.java +++ b/tabs/src/main/java/org/dominokit/domino/tabs/client/views/ui/TabsViewImpl.java @@ -16,18 +16,13 @@ import org.dominokit.domino.ui.grid.Column; import org.dominokit.domino.ui.grid.Row; import org.dominokit.domino.ui.icons.lib.Icons; -import org.dominokit.domino.ui.style.DisplayCss; -import org.dominokit.domino.ui.tabs.FillItem; -import org.dominokit.domino.ui.tabs.HeaderDirection; -import org.dominokit.domino.ui.tabs.Tab; -import org.dominokit.domino.ui.tabs.TabsAlign; -import org.dominokit.domino.ui.tabs.TabsDirection; -import org.dominokit.domino.ui.tabs.TabsHeaderAlign; -import org.dominokit.domino.ui.tabs.TabsPanel; +import org.dominokit.domino.ui.tabs.*; import org.dominokit.domino.ui.typography.BlockHeader; import org.dominokit.domino.ui.utils.PostfixAddOn; import org.dominokit.domino.ui.utils.PrefixAddOn; +import static org.dominokit.domino.ui.utils.Domino.*; + @UiView(presentable = TabsProxy.class) @SampleClass public class TabsViewImpl extends BaseDemoView implements TabsView { diff --git a/themes/pom.xml b/themes/pom.xml index 158ab915..4cfc8d3e 100644 --- a/themes/pom.xml +++ b/themes/pom.xml @@ -1,5 +1,5 @@ - 4.0.0 @@ -14,7 +14,7 @@ - com.google.gwt + org.gwtproject gwt-user provided diff --git a/themes/src/main/java/org/dominokit/domino/themes/client/views/ui/ThemesViewImpl.java b/themes/src/main/java/org/dominokit/domino/themes/client/views/ui/ThemesViewImpl.java index 7be6b600..bde60b30 100644 --- a/themes/src/main/java/org/dominokit/domino/themes/client/views/ui/ThemesViewImpl.java +++ b/themes/src/main/java/org/dominokit/domino/themes/client/views/ui/ThemesViewImpl.java @@ -6,7 +6,6 @@ import org.dominokit.domino.themes.client.views.ThemesView; import org.dominokit.domino.ui.elements.DivElement; import org.dominokit.domino.ui.style.CssClass; -import org.dominokit.domino.ui.style.SwapCssClass; import org.dominokit.domino.ui.themes.DominoThemeAccent; import org.dominokit.domino.ui.themes.DominoThemeManager; import org.dominokit.domino.ui.themes.IsDominoTheme; @@ -14,12 +13,13 @@ import org.dominokit.domino.ui.utils.ElementsFactory; import org.dominokit.domino.view.BaseElementView; +import static org.dominokit.domino.ui.utils.Domino.*; + @UiView(presentable = ThemesProxy.class) public class ThemesViewImpl extends BaseElementView implements ThemesView, ElementsFactory { private DivElement root; private ThemesUiHandlers uiHandlers; - private SwapCssClass themeCss = SwapCssClass.of(); @Override protected HTMLDivElement init() { diff --git a/thumbnails/pom.xml b/thumbnails/pom.xml index 38cc47a1..64fa56ec 100644 --- a/thumbnails/pom.xml +++ b/thumbnails/pom.xml @@ -1,5 +1,5 @@ - + 4.0.0 domino-ui-demo @@ -15,7 +15,7 @@ - com.google.gwt + org.gwtproject gwt-user provided diff --git a/thumbnails/src/main/java/org/dominokit/domino/thumbnails/client/views/ui/ThumbnailsViewImpl.java b/thumbnails/src/main/java/org/dominokit/domino/thumbnails/client/views/ui/ThumbnailsViewImpl.java index 7300b0b1..563bc6d2 100644 --- a/thumbnails/src/main/java/org/dominokit/domino/thumbnails/client/views/ui/ThumbnailsViewImpl.java +++ b/thumbnails/src/main/java/org/dominokit/domino/thumbnails/client/views/ui/ThumbnailsViewImpl.java @@ -2,6 +2,7 @@ import com.google.gwt.core.client.GWT; import elemental2.dom.HTMLDivElement; +import static org.dominokit.domino.ui.utils.Domino.*; import org.dominokit.domino.SampleClass; import org.dominokit.domino.SampleMethod; import org.dominokit.domino.api.client.annotations.UiView; diff --git a/timepicker/pom.xml b/timepicker/pom.xml index 5be8baad..b8e58a1c 100644 --- a/timepicker/pom.xml +++ b/timepicker/pom.xml @@ -1,5 +1,5 @@ - + 4.0.0 domino-ui-demo @@ -15,7 +15,7 @@ - com.google.gwt + org.gwtproject gwt-user provided @@ -44,12 +44,10 @@ com.google.elemental2 elemental2-svg - ${elemental2.version} com.google.elemental2 elemental2-svg - ${elemental2.version} sources diff --git a/timepicker/src/main/java/org/dominokit/domino/timepicker/client/views/ui/TimePickerViewImpl.java b/timepicker/src/main/java/org/dominokit/domino/timepicker/client/views/ui/TimePickerViewImpl.java index 28b9e2d8..032d0b53 100644 --- a/timepicker/src/main/java/org/dominokit/domino/timepicker/client/views/ui/TimePickerViewImpl.java +++ b/timepicker/src/main/java/org/dominokit/domino/timepicker/client/views/ui/TimePickerViewImpl.java @@ -1,6 +1,7 @@ package org.dominokit.domino.timepicker.client.views.ui; import elemental2.dom.HTMLDivElement; +import static org.dominokit.domino.ui.utils.Domino.*; import org.dominokit.domino.SampleClass; import org.dominokit.domino.SampleMethod; import org.dominokit.domino.api.client.annotations.UiView; diff --git a/tree/pom.xml b/tree/pom.xml index 5613b81b..20ad3ab9 100644 --- a/tree/pom.xml +++ b/tree/pom.xml @@ -1,5 +1,5 @@ - + 4.0.0 domino-ui-demo @@ -15,7 +15,7 @@ - com.google.gwt + org.gwtproject gwt-user provided diff --git a/tree/src/main/java/org/dominokit/domino/tree/client/views/ui/TreeViewImpl.java b/tree/src/main/java/org/dominokit/domino/tree/client/views/ui/TreeViewImpl.java index 024c74f5..69f8bbdb 100644 --- a/tree/src/main/java/org/dominokit/domino/tree/client/views/ui/TreeViewImpl.java +++ b/tree/src/main/java/org/dominokit/domino/tree/client/views/ui/TreeViewImpl.java @@ -2,6 +2,7 @@ import elemental2.dom.DomGlobal; import elemental2.dom.HTMLDivElement; +import static org.dominokit.domino.ui.utils.Domino.*; import org.dominokit.domino.SampleClass; import org.dominokit.domino.SampleMethod; import org.dominokit.domino.api.client.annotations.UiView; diff --git a/typography/pom.xml b/typography/pom.xml index 313ac55f..d067d191 100644 --- a/typography/pom.xml +++ b/typography/pom.xml @@ -1,5 +1,5 @@ - + 4.0.0 domino-ui-demo @@ -15,7 +15,7 @@ - com.google.gwt + org.gwtproject gwt-user provided diff --git a/typography/src/main/java/org/dominokit/domino/typography/client/views/ui/TypographyViewImpl.java b/typography/src/main/java/org/dominokit/domino/typography/client/views/ui/TypographyViewImpl.java index 519a3f55..98fc74e3 100644 --- a/typography/src/main/java/org/dominokit/domino/typography/client/views/ui/TypographyViewImpl.java +++ b/typography/src/main/java/org/dominokit/domino/typography/client/views/ui/TypographyViewImpl.java @@ -1,6 +1,7 @@ package org.dominokit.domino.typography.client.views.ui; import elemental2.dom.HTMLDivElement; +import static org.dominokit.domino.ui.utils.Domino.*; import org.dominokit.domino.SampleClass; import org.dominokit.domino.SampleMethod; import org.dominokit.domino.api.client.annotations.UiView; diff --git a/ui-demo-backend/pom.xml b/ui-demo-backend/pom.xml index 01ef35ad..e2ad3007 100644 --- a/ui-demo-backend/pom.xml +++ b/ui-demo-backend/pom.xml @@ -1,5 +1,5 @@ - 4.0.0 @@ -22,7 +22,7 @@ runtime - com.google.gwt + org.gwtproject gwt-servlet diff --git a/ui-demo-backend/src/main/resources/app/images/logo/128.png b/ui-demo-backend/src/main/resources/app/images/logo/128.png deleted file mode 100755 index a7cc7885..00000000 Binary files a/ui-demo-backend/src/main/resources/app/images/logo/128.png and /dev/null differ diff --git a/ui-demo-backend/src/main/resources/app/temp.css b/ui-demo-backend/src/main/resources/app/temp.css deleted file mode 100644 index 6cfda64d..00000000 --- a/ui-demo-backend/src/main/resources/app/temp.css +++ /dev/null @@ -1,574 +0,0 @@ -body { - background-color: #e9e9e9; -} - -pre.prettyprint { - padding: 10px !important; - font-size: 110%; -} - -@media screen and (max-width: 992px) { - .demo-footer { - padding: 20px 0px; - text-align: center; - } - - .d-patreon img { - margin-top: 12px; - } -} - -@media screen and (min-width: 992px) { - .demo-footer { - padding: 20px 200px; - } -} - -.gitter-open-chat-button { - -webkit-box-shadow: 0 3px 1px -2px rgba(0, 0, 0, .2), 0 2px 2px 0 rgba(0, 0, 0, .14), 0 1px 5px 0 rgba(0, 0, 0, .12); - box-shadow: 0 3px 1px -2px rgba(0, 0, 0, .2), 0 2px 2px 0 rgba(0, 0, 0, .14), 0 1px 5px 0 rgba(0, 0, 0, .12); -} - -.theme-red .gitter-open-chat-button { - background-color: #F44336; - color: #fff; -} - -.theme-pink .gitter-open-chat-button { - background-color: #E91E63; - color: #fff; -} - -.theme-purple .gitter-open-chat-button { - background-color: #9C27B0; - color: #fff; -} - -.theme-deep-purple .gitter-open-chat-button { - background-color: #673AB7; - color: #fff; -} - -.theme-indigo .gitter-open-chat-button { - background-color: #3F51B5; - color: #fff; -} - -.theme-blue .gitter-open-chat-button { - background-color: #2196F3; - color: #fff; -} - -.theme-light-blue .gitter-open-chat-button { - background-color: #03A9F4; - color: #fff; -} - -.theme-cyan .gitter-open-chat-button { - background-color: #00BCD4; - color: #fff; -} - -.theme-teal .gitter-open-chat-button { - background-color: #009688; - color: #fff; -} - -.theme-green .gitter-open-chat-button { - background-color: #4CAF50; - color: #fff; -} - -.theme-light-green .gitter-open-chat-button { - background-color: #8BC34A; - color: #fff; -} - -.theme-lime .gitter-open-chat-button { - background-color: #CDDC39; - color: #fff; -} - -.theme-yellow .gitter-open-chat-button { - background-color: #FFEB3B; - color: #fff; -} - -.theme-amber .gitter-open-chat-button { - background-color: #FFC107; - color: #fff; -} - -.theme-orange .gitter-open-chat-button { - - background-color: #FF9800; - color: #fff; -} - -.theme-deep-orange .gitter-open-chat-button { - background-color: #FF5722; - color: #fff; -} - -.theme-brown .gitter-open-chat-button { - background-color: #795548; - color: #fff; -} - -.theme-grey .gitter-open-chat-button { - background-color: #9E9E9E; - color: #fff; -} - -.theme-blue-grey .gitter-open-chat-button { - background-color: #607D8B; - color: #fff; -} - -.theme-black .gitter-open-chat-button { - background-color: #000; - color: #fff; -} - -@media screen and (min-width: 992px) { - .content-margin { - margin-left: 10% !important; - margin-right: 10% !important; - } -} - -.profile-card{ - border-radius: 0px; - box-shadow: none; -} - -.invalid-section { - border: 1px solid #F44336; -} - -.open-source { - text-align: center; - width: 150px; - padding: 10px 5px 5px 0px; - background-color: white; - border-bottom-left-radius: 5px; - border-bottom-right-radius: 5px; - cursor: pointer; - position: fixed; - right: 8px; - top: 69px; - z-index: 9; -} - -.open-source .material-icons { - width: 24px; -} - -.open-source span { - position: relative; - top: -8px; - left: 7px; -} - -.sample-div { - text-align: center; - line-height: 50px; - font-size: larger; - height: 50px; - color: white; - background-color: #777777; -} - -.count-reset { - counter-reset: col; -} - -.counter:before { - counter-increment: col; - content: counter(col); -} - -.menu-header .search-bar { - height: 40px !important; -} - - - - - - -.sample-spin-item { - text-align: center; - line-height: 50px; - font-size: larger; - min-height: 50px; -} - -.demo-nav-card { - transition: transform 100ms ease; -} - -.demo-nav-card:hover { - transform: scale(1.05); -} - -.home-section { - padding: 40px; - border-bottom: 1px solid #c1c0c0; -} - -.home-section.slide-1 { - border-left: 3px solid #f4ae62; -} - -.home-section.slide-2 { - border-left: 3px solid #5485ed; -} - -.home-section.slide-3 { - border-left: 3px solid #54b060; -} - -.home-section.slide-4 { - border-left: 3px solid #e75252; -} - -.home-section.slide-5 { - border-left: 3px solid #444444; -} - -.home-section.odd { - background-color: #efefef; -} - -.home-section .breaker { - border-bottom: 1px solid #c1c0c0; - background-color: #ffffff; - left: calc(50% - 70px); - width: 140px; - height: 40px; - position: relative; - bottom: -64px; - display: inline-block; - border-radius: 10px; -} - -.home-section.odd .breaker { - background-color: #efefef; -} - -.home-sections { - border-top: 1px solid #c1c0c0; - border-right: 1px solid #c1c0c0; -} - - -.home-sections.gs-background::after { - opacity: 0.15; -} - -.img-responsive.person-pic { - width: 35%; - border-radius: 50%; - display: inline-block; -} - -.img-responsive.person-pic.quote-pic { - width: 64px; - height: 64px; -} - -.avatar-container{ - background-color: #efefef; - border-bottom: 1px solid #cecece; -} - -.login-avatar{ - width: 180px; - display: inline-block; - padding: 10px; - border: 10px solid #4ac6c6; - border-radius: 50%; -} - -.side-login-btn{ - min-width: 120px; - margin-top: 30px; - margin-bottom: 30px; -} -.demo-icon-container .demo-google-material-icon .icon-name.demo-mdi-icon-name{ - top: -5px; -} - -.button-demo ul { - padding-left: 0; -} - -.button-demo ul li { - list-style: none; - padding-left: 0; - display: inline-block; - margin-right: 7px; -} - -.button-demo ul li .btn { - display: block; - min-width: 175px; -} - -.button-demo .btn { - margin-right: 8px; - margin-bottom: 13px; - min-width: 120px; -} - -.demo-button-groups .btn-group { - margin-right: 10px; -} - -.demo-button-toolbar .btn-toolbar { - float: left; - margin-right: 25px; -} - -.demo-button-nesting > .btn-group { - margin-right: 15px; -} - -.demo-checkbox label, -.demo-radio-button label { - min-width: 150px; -} - -.demo-knob-chart div { - margin-right: 15px; -} - -.demo-switch .switch { - display: inline-block; - min-width: 170px; -} - -.demo-switch .demo-switch-title { - min-width: 95px; - display: inline-block; -} - -.demo-color-box { - padding: 15px 0; - text-align: center; - margin-bottom: 20px; - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - -ms-border-radius: 3px; - border-radius: 3px; - -webkit-box-shadow: 0 3px 1px -2px rgba(0, 0, 0, .2), 0 2px 2px 0 rgba(0, 0, 0, .14), 0 1px 5px 0 rgba(0, 0, 0, .12); - box-shadow: 0 3px 1px -2px rgba(0, 0, 0, .2), 0 2px 2px 0 rgba(0, 0, 0, .14), 0 1px 5px 0 rgba(0, 0, 0, .12); -} - -.demo-color-box .color-name { - font-size: 16px; - margin-bottom: 5px; -} - -.demo-color-box .color-code, -.demo-color-box .color-class-name { - font-size: 13px; -} - -.demo-image-copyright { - text-align: right; - font-style: italic; - font-size: 12px; - color: #777; - margin: 5px 0 10px 0; -} - -.demo-image-copyright a { - font-weight: bold; - color: #555 !important; -} - -.demo-tagsinput-area { - margin-bottom: 50px !important; -} - -.demo-icon-container .demo-google-material-icon { - margin-bottom: 5px; - text-align: left; - cursor: pointer; -} - -.demo-icon-container .demo-google-material-icon .icon-name { - position: relative; - top: -8px; - left: 7px; -} - -.demo-icon-container .demo-google-material-icon .material-icons { - width: 24px; -} - -.demo-icon-container .demo-google-material-icon .mdi { - width: 24px; -} - -.demo-preloader .preloader { - margin-right: 10px; -} - -.irs-demo { - margin-bottom: 40px; -} - -.irs-demo .irs { - margin-top: 15px; -} - - -.demo-choose-skin { - list-style: none; - padding-left: 0; - overflow-y: hidden; -} - -.demo-choose-skin li { - border-bottom: 1px solid #eee; - padding: 10px 10px 4px 10px; - position: relative; - cursor: pointer; -} - -.demo-choose-skin li.active { - background-color: #eee; -} - -.demo-choose-skin li.active:after { - font-family: 'Material Icons'; - position: absolute; - top: 10px; - right: 10px; - content: '\E876'; - font-size: 18px; - font-weight: bold; -} - -.demo-choose-skin li:hover { - background-color: #eee; -} - -.demo-choose-skin li div { - width: 24px; - height: 24px; - display: inline-block; - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - -ms-border-radius: 3px; - border-radius: 3px; -} - -.demo-choose-skin li span { - position: relative; - bottom: 7px; - left: 5px; -} - -.demo-choose-skin .red { - background-color: #F44336; -} - -.demo-choose-skin .pink { - background-color: #E91E63; -} - -.demo-choose-skin .purple { - background-color: #9C27B0; -} - -.demo-choose-skin .deep-purple { - background-color: #673AB7; -} - -.demo-choose-skin .indigo { - background-color: #3F51B5; -} - -.demo-choose-skin .blue { - background-color: #2196F3; -} - -.demo-choose-skin .light-blue { - background-color: #03A9F4; -} - -.demo-choose-skin .cyan { - background-color: #00BCD4; -} - -.demo-choose-skin .teal { - background-color: #009688; -} - -.demo-choose-skin .green { - background-color: #4CAF50; -} - -.demo-choose-skin .light-green { - background-color: #8BC34A; -} - -.demo-choose-skin .lime { - background-color: #CDDC39; -} - -.demo-choose-skin .yellow { - background-color: #ffe821; -} - -.demo-choose-skin .amber { - background-color: #FFC107; -} - -.demo-choose-skin .orange { - background-color: #FF9800; -} - -.demo-choose-skin .deep-orange { - background-color: #FF5722; -} - -.demo-choose-skin .brown { - background-color: #795548; -} - -.demo-choose-skin .grey { - background-color: #9E9E9E; -} - -.demo-choose-skin .blue-grey { - background-color: #607D8B; -} - -.demo-choose-skin .black { - background-color: #000000; -} - -.demo-choose-skin .white { - background-color: #ffffff; -} - -.d-patreon { - top: -3px; -} - -.d-patreon img { - width: 35px; - height: 35px; -} - -.demo-context-menu-target { - text-align: center; - font-size: 48px; - line-height: 600px; - color: #cecece; -} \ No newline at end of file diff --git a/ui-demo-frontend/pom.xml b/ui-demo-frontend/pom.xml index 3b32560c..0467d075 100644 --- a/ui-demo-frontend/pom.xml +++ b/ui-demo-frontend/pom.xml @@ -20,11 +20,11 @@ - com.google.gwt + org.gwtproject gwt-user - com.google.gwt + org.gwtproject gwt-dev @@ -725,11 +725,19 @@ ${extra.directory}/gwt/extra org.dominokit.domino.ui.demo.AppClientModule app + + log.json + + + + + + -XdisableCastChecking - -compileReport + -extra ${project.build.directory}/gwt/extra diff --git a/waves/pom.xml b/waves/pom.xml index e8d74937..8e598c9e 100644 --- a/waves/pom.xml +++ b/waves/pom.xml @@ -1,5 +1,5 @@ - + 4.0.0 domino-ui-demo @@ -15,7 +15,7 @@ - com.google.gwt + org.gwtproject gwt-user provided diff --git a/waves/src/main/java/org/dominokit/domino/waves/client/views/ui/WavesViewImpl.java b/waves/src/main/java/org/dominokit/domino/waves/client/views/ui/WavesViewImpl.java index e56c7359..2b2eed88 100644 --- a/waves/src/main/java/org/dominokit/domino/waves/client/views/ui/WavesViewImpl.java +++ b/waves/src/main/java/org/dominokit/domino/waves/client/views/ui/WavesViewImpl.java @@ -15,7 +15,6 @@ import org.dominokit.domino.ui.grid.Row; import org.dominokit.domino.ui.icons.lib.Icons; import org.dominokit.domino.ui.lists.ListGroup; -import org.dominokit.domino.ui.style.ColorsCss; import org.dominokit.domino.ui.typography.BlockHeader; import org.dominokit.domino.waves.client.presenters.WavesProxy; import org.dominokit.domino.waves.client.views.WavesView; @@ -43,6 +42,7 @@ import static org.dominokit.domino.ui.style.WavesStyles.dui_waves_red; import static org.dominokit.domino.ui.style.WavesStyles.dui_waves_teal; import static org.dominokit.domino.ui.style.WavesStyles.dui_waves_yellow; +import static org.dominokit.domino.ui.utils.Domino.*; @UiView(presentable = WavesProxy.class) @SampleClass @@ -58,12 +58,6 @@ protected HTMLDivElement init() { element.appendChild(BlockHeader.create("WAVES", "Click effect inspired by Google's Material Design") .element()); -// element.appendChild(Button.create("ADD button") -// .addClickListener(evt -> element.appendChild(Button -// .create("CLICK ME").addCss(dui_w_28) -// .withWaves(wavesSupport -> wavesSupport.getElement().addCss(dui_waves_accent)))) -// ); - waves(); element.appendChild(CodeCard.createCodeCard(