From b583492f7555b2b89169a3b137e88a23e409ebf3 Mon Sep 17 00:00:00 2001 From: Mark Kevin Baldemor Date: Tue, 28 Jul 2020 07:51:59 +0800 Subject: [PATCH 1/2] Added Grid Layout Demo --- pom.xml | 2 +- .../client/application/ApplicationModule.java | 6 +- .../navigation/NavigationService.java | 3 +- .../GridLayoutModule.java} | 8 +- .../GridLayoutPresenter.java} | 10 +- .../page/layout/grid/GridLayoutView.java | 36 ++++ .../page/layout/grid/GridLayoutView.ui.xml | 185 ++++++++++++++++++ .../twelvecol/TwelveColLayoutModule.java | 30 +++ .../twelvecol/TwelveColLayoutPresenter.java | 50 +++++ .../TwelveColLayoutView.java} | 9 +- .../TwelveColLayoutView.ui.xml} | 2 +- .../core/demo/client/place/NameTokens.java | 3 +- 12 files changed, 324 insertions(+), 20 deletions(-) rename src/main/java/gmd/core/demo/client/application/page/layout/{LayoutModule.java => grid/GridLayoutModule.java} (73%) rename src/main/java/gmd/core/demo/client/application/page/layout/{LayoutPresenter.java => grid/GridLayoutPresenter.java} (83%) create mode 100644 src/main/java/gmd/core/demo/client/application/page/layout/grid/GridLayoutView.java create mode 100644 src/main/java/gmd/core/demo/client/application/page/layout/grid/GridLayoutView.ui.xml create mode 100644 src/main/java/gmd/core/demo/client/application/page/layout/twelvecol/TwelveColLayoutModule.java create mode 100644 src/main/java/gmd/core/demo/client/application/page/layout/twelvecol/TwelveColLayoutPresenter.java rename src/main/java/gmd/core/demo/client/application/page/layout/{LayoutView.java => twelvecol/TwelveColLayoutView.java} (94%) rename src/main/java/gmd/core/demo/client/application/page/layout/{LayoutView.ui.xml => twelvecol/TwelveColLayoutView.ui.xml} (99%) diff --git a/pom.xml b/pom.xml index 3bc4123..4024276 100644 --- a/pom.xml +++ b/pom.xml @@ -36,7 +36,7 @@ 2.9.0 1.6 2.1.2 - 2.4.0-rc1 + 2.4.0-SNAPSHOT 1.8 1.8 diff --git a/src/main/java/gmd/core/demo/client/application/ApplicationModule.java b/src/main/java/gmd/core/demo/client/application/ApplicationModule.java index ebeca40..a3f02be 100644 --- a/src/main/java/gmd/core/demo/client/application/ApplicationModule.java +++ b/src/main/java/gmd/core/demo/client/application/ApplicationModule.java @@ -38,7 +38,8 @@ import gmd.core.demo.client.application.page.footer.FooterModule; import gmd.core.demo.client.application.page.home.HomeModule; import gmd.core.demo.client.application.page.icon.IconModule; -import gmd.core.demo.client.application.page.layout.LayoutModule; +import gmd.core.demo.client.application.page.layout.twelvecol.TwelveColLayoutModule; +import gmd.core.demo.client.application.page.layout.grid.GridLayoutModule; import gmd.core.demo.client.application.page.listbox.ListBoxModule; import gmd.core.demo.client.application.page.loaders.LoadersModule; import gmd.core.demo.client.application.page.media.MediaModule; @@ -76,7 +77,8 @@ protected void configure() { install(new FabModule()); install(new FooterModule()); install(new IconModule()); - install(new LayoutModule()); + install(new TwelveColLayoutModule()); + install(new GridLayoutModule()); install(new ListBoxModule()); install(new LoadersModule()); install(new MediaModule()); diff --git a/src/main/java/gmd/core/demo/client/application/navigation/NavigationService.java b/src/main/java/gmd/core/demo/client/application/navigation/NavigationService.java index 5b91ee8..150f6b1 100644 --- a/src/main/java/gmd/core/demo/client/application/navigation/NavigationService.java +++ b/src/main/java/gmd/core/demo/client/application/navigation/NavigationService.java @@ -28,7 +28,8 @@ public class NavigationService { components.add(new Component(NameTokens.ICON, "We have included 740 Material Design Icons courtesy of Google. You can download them directly from the Material Design specs.")); components.add(new Component(NameTokens.FAB, "FAB or Floating action buttons are used for a promoted action. They are distinguished by a circled icon floating above the UI and have motion behaviors that include morphing, launching, and a transferring anchor point.")); components.add(new Component(NameTokens.FOOTER, "Footers are a great way to organize a lot of site navigation and information at the end of a page. This is where the user will look once hes finished scrolling through the current page or is looking for additional information about your website.")); - components.add(new Component(NameTokens.LAYOUT, "Provides you an easy way to layout your content using the Grid System and also using helper classes.")); + components.add(new Component(NameTokens.GRID_LAYOUT, "CSS Grid Layout introduces a two-dimensional grid system to CSS. Grids can be used to lay out major page areas or small user interface elements.")); + components.add(new Component(NameTokens.TWELEVE_COL_LAYOUT, "Provides you an easy way to layout your content using the Grid System and also using helper classes.")); components.add(new Component(NameTokens.LOADERS, "If you have content that will take a long time to load, you should give the user feedback. For this reason we provide a number activity + progress indicators.")); components.add(new Component(NameTokens.LISTBOX, "Material ListBox is another dropdown component that will set / get the value depends on the selected index")); components.add(new Component(NameTokens.MEDIA, "Media components include things that have to do with large media objects like Images, Video, Audio, etc.")); diff --git a/src/main/java/gmd/core/demo/client/application/page/layout/LayoutModule.java b/src/main/java/gmd/core/demo/client/application/page/layout/grid/GridLayoutModule.java similarity index 73% rename from src/main/java/gmd/core/demo/client/application/page/layout/LayoutModule.java rename to src/main/java/gmd/core/demo/client/application/page/layout/grid/GridLayoutModule.java index 0854e95..85feca2 100644 --- a/src/main/java/gmd/core/demo/client/application/page/layout/LayoutModule.java +++ b/src/main/java/gmd/core/demo/client/application/page/layout/grid/GridLayoutModule.java @@ -17,14 +17,14 @@ * limitations under the License. * #L% */ -package gmd.core.demo.client.application.page.layout; +package gmd.core.demo.client.application.page.layout.grid; import com.gwtplatform.mvp.client.gin.AbstractPresenterModule; -public class LayoutModule extends AbstractPresenterModule { +public class GridLayoutModule extends AbstractPresenterModule { @Override protected void configure() { - bindPresenter(LayoutPresenter.class, LayoutPresenter.MyView.class, LayoutView.class, - LayoutPresenter.MyProxy.class); + bindPresenter(GridLayoutPresenter.class, GridLayoutPresenter.MyView.class, GridLayoutView.class, + GridLayoutPresenter.MyProxy.class); } } diff --git a/src/main/java/gmd/core/demo/client/application/page/layout/LayoutPresenter.java b/src/main/java/gmd/core/demo/client/application/page/layout/grid/GridLayoutPresenter.java similarity index 83% rename from src/main/java/gmd/core/demo/client/application/page/layout/LayoutPresenter.java rename to src/main/java/gmd/core/demo/client/application/page/layout/grid/GridLayoutPresenter.java index 8018449..5ce201e 100644 --- a/src/main/java/gmd/core/demo/client/application/page/layout/LayoutPresenter.java +++ b/src/main/java/gmd/core/demo/client/application/page/layout/grid/GridLayoutPresenter.java @@ -17,7 +17,7 @@ * limitations under the License. * #L% */ -package gmd.core.demo.client.application.page.layout; +package gmd.core.demo.client.application.page.layout.grid; import com.google.inject.Inject; import com.google.web.bindery.event.shared.EventBus; @@ -30,17 +30,17 @@ import gmd.core.demo.client.application.page.AppPresenter; import gmd.core.demo.client.place.NameTokens; -public class LayoutPresenter extends AppPresenter { +public class GridLayoutPresenter extends AppPresenter { interface MyView extends View { } @ProxyStandard - @NameToken(NameTokens.LAYOUT) - interface MyProxy extends ProxyPlace { + @NameToken(NameTokens.GRID_LAYOUT) + interface MyProxy extends ProxyPlace { } @Inject - LayoutPresenter( + GridLayoutPresenter( EventBus eventBus, MyView view, MyProxy proxy, diff --git a/src/main/java/gmd/core/demo/client/application/page/layout/grid/GridLayoutView.java b/src/main/java/gmd/core/demo/client/application/page/layout/grid/GridLayoutView.java new file mode 100644 index 0000000..b844565 --- /dev/null +++ b/src/main/java/gmd/core/demo/client/application/page/layout/grid/GridLayoutView.java @@ -0,0 +1,36 @@ +/* + * #%L + * GwtMaterial + * %% + * Copyright (C) 2015 - 2017 GwtMaterialDesign + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ +package gmd.core.demo.client.application.page.layout.grid; + +import com.google.gwt.uibinder.client.UiBinder; +import com.google.gwt.user.client.ui.Widget; +import com.gwtplatform.mvp.client.ViewImpl; + +import javax.inject.Inject; + +public class GridLayoutView extends ViewImpl implements GridLayoutPresenter.MyView { + interface Binder extends UiBinder { + } + + @Inject + GridLayoutView(Binder uiBinder) { + initWidget(uiBinder.createAndBindUi(this)); + } +} diff --git a/src/main/java/gmd/core/demo/client/application/page/layout/grid/GridLayoutView.ui.xml b/src/main/java/gmd/core/demo/client/application/page/layout/grid/GridLayoutView.ui.xml new file mode 100644 index 0000000..0e48561 --- /dev/null +++ b/src/main/java/gmd/core/demo/client/application/page/layout/grid/GridLayoutView.ui.xml @@ -0,0 +1,185 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/gmd/core/demo/client/application/page/layout/twelvecol/TwelveColLayoutModule.java b/src/main/java/gmd/core/demo/client/application/page/layout/twelvecol/TwelveColLayoutModule.java new file mode 100644 index 0000000..794f460 --- /dev/null +++ b/src/main/java/gmd/core/demo/client/application/page/layout/twelvecol/TwelveColLayoutModule.java @@ -0,0 +1,30 @@ +/* + * #%L + * GwtMaterial + * %% + * Copyright (C) 2015 - 2017 GwtMaterialDesign + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ +package gmd.core.demo.client.application.page.layout.twelvecol; + +import com.gwtplatform.mvp.client.gin.AbstractPresenterModule; + +public class TwelveColLayoutModule extends AbstractPresenterModule { + @Override + protected void configure() { + bindPresenter(TwelveColLayoutPresenter.class, TwelveColLayoutPresenter.MyView.class, TwelveColLayoutView.class, + TwelveColLayoutPresenter.MyProxy.class); + } +} diff --git a/src/main/java/gmd/core/demo/client/application/page/layout/twelvecol/TwelveColLayoutPresenter.java b/src/main/java/gmd/core/demo/client/application/page/layout/twelvecol/TwelveColLayoutPresenter.java new file mode 100644 index 0000000..3eaf025 --- /dev/null +++ b/src/main/java/gmd/core/demo/client/application/page/layout/twelvecol/TwelveColLayoutPresenter.java @@ -0,0 +1,50 @@ +/* + * #%L + * GwtMaterial + * %% + * Copyright (C) 2015 - 2017 GwtMaterialDesign + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ +package gmd.core.demo.client.application.page.layout.twelvecol; + +import com.google.inject.Inject; +import com.google.web.bindery.event.shared.EventBus; +import com.gwtplatform.mvp.client.View; +import com.gwtplatform.mvp.client.annotations.NameToken; +import com.gwtplatform.mvp.client.annotations.ProxyStandard; +import com.gwtplatform.mvp.client.proxy.PlaceManager; +import com.gwtplatform.mvp.client.proxy.ProxyPlace; +import gmd.core.demo.client.application.ApplicationPresenter; +import gmd.core.demo.client.application.page.AppPresenter; +import gmd.core.demo.client.place.NameTokens; + +public class TwelveColLayoutPresenter extends AppPresenter { + interface MyView extends View { + } + + @ProxyStandard + @NameToken(NameTokens.TWELEVE_COL_LAYOUT) + interface MyProxy extends ProxyPlace { + } + + @Inject + TwelveColLayoutPresenter( + EventBus eventBus, + MyView view, + MyProxy proxy, + PlaceManager placeManager) { + super(eventBus, view, proxy, ApplicationPresenter.SLOT_MAIN, placeManager); + } +} diff --git a/src/main/java/gmd/core/demo/client/application/page/layout/LayoutView.java b/src/main/java/gmd/core/demo/client/application/page/layout/twelvecol/TwelveColLayoutView.java similarity index 94% rename from src/main/java/gmd/core/demo/client/application/page/layout/LayoutView.java rename to src/main/java/gmd/core/demo/client/application/page/layout/twelvecol/TwelveColLayoutView.java index 0edcac3..e507474 100644 --- a/src/main/java/gmd/core/demo/client/application/page/layout/LayoutView.java +++ b/src/main/java/gmd/core/demo/client/application/page/layout/twelvecol/TwelveColLayoutView.java @@ -17,7 +17,7 @@ * limitations under the License. * #L% */ -package gmd.core.demo.client.application.page.layout; +package gmd.core.demo.client.application.page.layout.twelvecol; import com.google.gwt.event.dom.client.ClickEvent; import com.google.gwt.uibinder.client.UiBinder; @@ -33,14 +33,13 @@ import gwt.material.design.client.constants.OffsetPosition; import gwt.material.design.client.ui.MaterialLink; import gwt.material.design.client.ui.MaterialPanel; -import gwt.material.design.client.ui.MaterialRow; import javax.inject.Inject; import static gwt.material.design.jquery.client.api.JQuery.$; -public class LayoutView extends ViewImpl implements LayoutPresenter.MyView { - interface Binder extends UiBinder { +public class TwelveColLayoutView extends ViewImpl implements TwelveColLayoutPresenter.MyView { + interface Binder extends UiBinder { } @UiField @@ -61,7 +60,7 @@ interface Binder extends UiBinder { protected ScrollHelper scrollHelper = new ScrollHelper(); @Inject - LayoutView(Binder uiBinder) { + TwelveColLayoutView(Binder uiBinder) { initWidget(uiBinder.createAndBindUi(this)); } diff --git a/src/main/java/gmd/core/demo/client/application/page/layout/LayoutView.ui.xml b/src/main/java/gmd/core/demo/client/application/page/layout/twelvecol/TwelveColLayoutView.ui.xml similarity index 99% rename from src/main/java/gmd/core/demo/client/application/page/layout/LayoutView.ui.xml rename to src/main/java/gmd/core/demo/client/application/page/layout/twelvecol/TwelveColLayoutView.ui.xml index b35f1b6..7992a54 100644 --- a/src/main/java/gmd/core/demo/client/application/page/layout/LayoutView.ui.xml +++ b/src/main/java/gmd/core/demo/client/application/page/layout/twelvecol/TwelveColLayoutView.ui.xml @@ -219,7 +219,7 @@ - + diff --git a/src/main/java/gmd/core/demo/client/place/NameTokens.java b/src/main/java/gmd/core/demo/client/place/NameTokens.java index 9811207..5f4ebea 100644 --- a/src/main/java/gmd/core/demo/client/place/NameTokens.java +++ b/src/main/java/gmd/core/demo/client/place/NameTokens.java @@ -38,7 +38,8 @@ public class NameTokens { public static final String FAB = "fab"; public static final String FOOTER = "footer"; public static final String ICON = "icon"; - public static final String LAYOUT = "layout"; + public static final String TWELEVE_COL_LAYOUT = "twelveColLayout"; + public static final String GRID_LAYOUT = "gridLayout"; public static final String LOADERS = "loaders"; public static final String LISTBOX = "listbox"; public static final String MEDIA = "media"; From 4824dc2cb8330c6d0527d5c3e19688ae3686c921 Mon Sep 17 00:00:00 2001 From: Mark Kevin Baldemor Date: Tue, 28 Jul 2020 12:09:28 +0800 Subject: [PATCH 2/2] Added content editable and resizable demo. --- .../application/page/layout/grid/GridLayoutView.ui.xml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/gmd/core/demo/client/application/page/layout/grid/GridLayoutView.ui.xml b/src/main/java/gmd/core/demo/client/application/page/layout/grid/GridLayoutView.ui.xml index 0e48561..c6c4ad6 100644 --- a/src/main/java/gmd/core/demo/client/application/page/layout/grid/GridLayoutView.ui.xml +++ b/src/main/java/gmd/core/demo/client/application/page/layout/grid/GridLayoutView.ui.xml @@ -171,7 +171,7 @@ - + @@ -181,5 +181,12 @@ + + + + + +