From 6c0ad65bfa124358f9b3c673e236f0af3289ba75 Mon Sep 17 00:00:00 2001 From: "massimiliano.assante" Date: Wed, 6 May 2015 15:38:27 +0000 Subject: [PATCH] updated loading icon style git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/gcube-loggedin@114698 82a268e6-3cf1-43bd-a215-b396298e98cf --- .classpath | 4 +- .settings/org.eclipse.jst.jsp.core.prefs | 3 ++ .settings/org.eclipse.wst.common.component | 4 +- ....eclipse.wst.common.project.facet.core.xml | 1 + pom.xml | 26 +++++++++++-- .../gcubeloggedin/client/GCubeLoggedin.java | 19 ++-------- .../gcubeloggedin/client/ui/AboutView.java | 37 ++++++++++++------- .../gcubeloggedin/client/ui/AboutView.ui.xml | 3 +- .../gcubeloggedin/client/ui/LoadingText.java | 19 ++++++++++ .../client/ui/LoadingText.ui.xml | 13 +++++++ .../user/gcubeloggedin/GCubeLoggedin.gwt.xml | 6 +-- 11 files changed, 95 insertions(+), 40 deletions(-) create mode 100644 .settings/org.eclipse.jst.jsp.core.prefs create mode 100644 src/main/java/org/gcube/portlets/user/gcubeloggedin/client/ui/LoadingText.java create mode 100644 src/main/java/org/gcube/portlets/user/gcubeloggedin/client/ui/LoadingText.ui.xml diff --git a/.classpath b/.classpath index 13f8d5b..3c5ad5e 100644 --- a/.classpath +++ b/.classpath @@ -1,6 +1,6 @@ - + @@ -31,5 +31,5 @@ - + diff --git a/.settings/org.eclipse.jst.jsp.core.prefs b/.settings/org.eclipse.jst.jsp.core.prefs new file mode 100644 index 0000000..3a5c98d --- /dev/null +++ b/.settings/org.eclipse.jst.jsp.core.prefs @@ -0,0 +1,3 @@ +eclipse.preferences.version=1 +validateFragments=false +validation.use-project-settings=true diff --git a/.settings/org.eclipse.wst.common.component b/.settings/org.eclipse.wst.common.component index 4e1b3a2..ff63376 100644 --- a/.settings/org.eclipse.wst.common.component +++ b/.settings/org.eclipse.wst.common.component @@ -1,9 +1,9 @@ - + - + uses diff --git a/.settings/org.eclipse.wst.common.project.facet.core.xml b/.settings/org.eclipse.wst.common.project.facet.core.xml index 4045d87..b3a52d7 100644 --- a/.settings/org.eclipse.wst.common.project.facet.core.xml +++ b/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -4,4 +4,5 @@ + diff --git a/pom.xml b/pom.xml index 1cad8dd..c7aef87 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ org.gcube.portlets.user gcube-loggedin war - 2.5.1-SNAPSHOT + 2.6.0-SNAPSHOT gCube Loggedin Portlet @@ -26,7 +26,7 @@ - 2.5.1 + 2.7.0 distro 1.7 @@ -38,6 +38,13 @@ + + com.google.gwt + gwt + ${gwtVersion} + pom + import + org.gcube.distribution maven-portal-bom @@ -51,13 +58,26 @@ com.google.gwt gwt-user + ${gwtVersion} provided com.google.gwt gwt-servlet + ${gwtVersion} provided + + com.google.gwt + gwt-dev + ${gwtVersion} + provided + + + com.github.gwtbootstrap + gwt-bootstrap + 2.3.2.0 + org.gcube.portal custom-portal-handler @@ -141,7 +161,7 @@ - Messages.html + GCubeLoggedin.html ${webappDirectory} diff --git a/src/main/java/org/gcube/portlets/user/gcubeloggedin/client/GCubeLoggedin.java b/src/main/java/org/gcube/portlets/user/gcubeloggedin/client/GCubeLoggedin.java index f810081..0a716ef 100644 --- a/src/main/java/org/gcube/portlets/user/gcubeloggedin/client/GCubeLoggedin.java +++ b/src/main/java/org/gcube/portlets/user/gcubeloggedin/client/GCubeLoggedin.java @@ -1,8 +1,11 @@ package org.gcube.portlets.user.gcubeloggedin.client; import org.gcube.portlets.user.gcubeloggedin.client.ui.AboutView; +import org.gcube.portlets.user.gcubeloggedin.client.ui.LoadingText; import org.gcube.portlets.user.gcubeloggedin.shared.VObject; +import com.github.gwtbootstrap.client.ui.Hero; +import com.github.gwtbootstrap.client.ui.Paragraph; import com.google.gwt.core.client.EntryPoint; import com.google.gwt.core.client.GWT; import com.google.gwt.user.client.Window.Location; @@ -31,8 +34,6 @@ public class GCubeLoggedin implements EntryPoint { main_panel.setWidth("100%"); endpoint.setServiceEntryPoint(GWT.getModuleBaseURL()+"LoggedinServiceImpl"); - main_panel.add(new HTML("



Loading Environment please wait ...



" + getLoadingHTML() + "

" )); - // Associate the new panel with the HTML host page. RootPanel.get("LoggedinDiv").add(main_panel); @@ -46,19 +47,7 @@ public class GCubeLoggedin implements EntryPoint { } }); } - /** - * - * @return - */ - private String getLoadingHTML() { - return - "
"+ - ""+ - ""+ - "
"+ - ""+ - "
" ; - } + } diff --git a/src/main/java/org/gcube/portlets/user/gcubeloggedin/client/ui/AboutView.java b/src/main/java/org/gcube/portlets/user/gcubeloggedin/client/ui/AboutView.java index aad2f72..ecf4a54 100644 --- a/src/main/java/org/gcube/portlets/user/gcubeloggedin/client/ui/AboutView.java +++ b/src/main/java/org/gcube/portlets/user/gcubeloggedin/client/ui/AboutView.java @@ -1,11 +1,11 @@ package org.gcube.portlets.user.gcubeloggedin.client.ui; import org.gcube.portlets.user.gcubeloggedin.client.LoggedinServiceAsync; -import org.gcube.portlets.user.gcubeloggedin.client.UIConstants; import org.gcube.portlets.user.gcubeloggedin.shared.VObject; import org.gcube.portlets.user.gcubeloggedin.shared.VREClient; import org.gcube.portlets.widgets.sessionchecker.client.CheckSession; +import com.github.gwtbootstrap.client.ui.Button; import com.google.gwt.core.client.GWT; import com.google.gwt.core.client.Scheduler; import com.google.gwt.event.dom.client.ClickEvent; @@ -18,15 +18,15 @@ import com.google.gwt.user.client.Window; import com.google.gwt.user.client.Window.Location; import com.google.gwt.user.client.rpc.AsyncCallback; import com.google.gwt.user.client.ui.Anchor; -import com.google.gwt.user.client.ui.Button; import com.google.gwt.user.client.ui.Composite; import com.google.gwt.user.client.ui.HTML; import com.google.gwt.user.client.ui.HTMLPanel; -import com.google.gwt.user.client.ui.Image; import com.google.gwt.user.client.ui.Widget; public class AboutView extends Composite { + private static int MAX_CHAR_DESC = 700; + private static AboutViewUiBinder uiBinder = GWT .create(AboutViewUiBinder.class); @@ -37,11 +37,13 @@ public class AboutView extends Composite { initWidget(uiBinder.createAndBindUi(this)); } private WarningAlert wa; - + private String vreDescription; + private String vreImage; @UiField HTMLPanel htmlPanel; @UiField HTML description; @UiField Anchor backButton; @UiField Anchor leaveButton; + @UiField Button seeMore; private LoggedinServiceAsync loggedinService; @@ -49,9 +51,16 @@ public class AboutView extends Composite { public AboutView(VObject vobj, LoggedinServiceAsync loggedinService) { initWidget(uiBinder.createAndBindUi(this)); this.loggedinService = loggedinService; - description.setHTML("" + vobj.getDescription()); + vreImage = vobj.getImageURL(); + String desc = vreDescription = vobj.getDescription(); + if (desc.length() > MAX_CHAR_DESC) { + desc = desc.substring(0, MAX_CHAR_DESC) + " ..."; + seeMore.setVisible(true); + } + description.setHTML("" + desc); leaveButton.setStyleName("leave-group"); + if (vobj instanceof VREClient && !vobj.isMandatory()) { wa = new WarningAlert("Are you sure you want to leave this group? " @@ -68,6 +77,12 @@ public class AboutView extends Composite { } + + @UiHandler("seeMore") + void onSeeMoreClick(ClickEvent e) { + description.setHTML("" + vreDescription); + seeMore.removeFromParent(); + } @UiHandler("backButton") void onClick(ClickEvent e) { @@ -90,7 +105,7 @@ public class AboutView extends Composite { protected void abandonGroup() { htmlPanel.remove(wa); - final HTML loading = getLoadingHTML(); + final Widget loading = getLoadingHTML(); htmlPanel.add(loading); loggedinService.removeUserFromVRE(new AsyncCallback() { @Override @@ -113,14 +128,8 @@ public class AboutView extends Composite { * * @return */ - private HTML getLoadingHTML() { - return new HTML( - "
"+ - ""+ - ""+ - "
"+ - ""+ - "
") ; + public static Widget getLoadingHTML() { + return new LoadingText(); } } diff --git a/src/main/java/org/gcube/portlets/user/gcubeloggedin/client/ui/AboutView.ui.xml b/src/main/java/org/gcube/portlets/user/gcubeloggedin/client/ui/AboutView.ui.xml index 73b17fb..b6e19a3 100644 --- a/src/main/java/org/gcube/portlets/user/gcubeloggedin/client/ui/AboutView.ui.xml +++ b/src/main/java/org/gcube/portlets/user/gcubeloggedin/client/ui/AboutView.ui.xml @@ -1,6 +1,6 @@ + xmlns:g="urn:import:com.google.gwt.user.client.ui" xmlns:b="urn:import:com.github.gwtbootstrap.client.ui">
@@ -14,5 +14,6 @@
+ See more
\ No newline at end of file diff --git a/src/main/java/org/gcube/portlets/user/gcubeloggedin/client/ui/LoadingText.java b/src/main/java/org/gcube/portlets/user/gcubeloggedin/client/ui/LoadingText.java new file mode 100644 index 0000000..2076f3e --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/gcubeloggedin/client/ui/LoadingText.java @@ -0,0 +1,19 @@ +package org.gcube.portlets.user.gcubeloggedin.client.ui; + +import com.google.gwt.core.client.GWT; +import com.google.gwt.uibinder.client.UiBinder; +import com.google.gwt.user.client.ui.Composite; +import com.google.gwt.user.client.ui.Widget; + +public class LoadingText extends Composite { + + private static LoadingTextUiBinder uiBinder = GWT + .create(LoadingTextUiBinder.class); + + interface LoadingTextUiBinder extends UiBinder { + } + + public LoadingText() { + initWidget(uiBinder.createAndBindUi(this)); + } +} diff --git a/src/main/java/org/gcube/portlets/user/gcubeloggedin/client/ui/LoadingText.ui.xml b/src/main/java/org/gcube/portlets/user/gcubeloggedin/client/ui/LoadingText.ui.xml new file mode 100644 index 0000000..2f7e90c --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/gcubeloggedin/client/ui/LoadingText.ui.xml @@ -0,0 +1,13 @@ + + + + + + Please wait + + Contacting infrastructure services ... + + + + \ No newline at end of file diff --git a/src/main/resources/org/gcube/portlets/user/gcubeloggedin/GCubeLoggedin.gwt.xml b/src/main/resources/org/gcube/portlets/user/gcubeloggedin/GCubeLoggedin.gwt.xml index a8451bb..5d8fcef 100644 --- a/src/main/resources/org/gcube/portlets/user/gcubeloggedin/GCubeLoggedin.gwt.xml +++ b/src/main/resources/org/gcube/portlets/user/gcubeloggedin/GCubeLoggedin.gwt.xml @@ -4,11 +4,11 @@ - - - + + +