fixed min height

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/notifications@68669 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Massimiliano Assante 2013-01-31 18:39:25 +00:00
parent f39e7a121f
commit 297ba682af
4 changed files with 22 additions and 12 deletions

View File

@ -15,6 +15,7 @@ import org.gcube.portlets.user.notifications.client.view.templates.DayWrapper;
import org.gcube.portlets.user.notifications.client.view.templates.SingleNotificationView;
import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.user.client.Timer;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.rpc.AsyncCallback;
@ -32,6 +33,7 @@ public class NotificationsPanel extends Composite {
private final NotificationsServiceAsync notificationService = GWT.create(NotificationsService.class);
public static final String loading = GWT.getModuleBaseURL() + "../images/feeds-loader.gif";
private static final String spacer = GWT.getModuleBaseURL() + "../images/feeds-spacer.gif";
private static final String warning = GWT.getModuleBaseURL() + "../images/warning_blue.png";
private UserInfo myUserInfo;
private Image loadingImage;
@ -66,7 +68,6 @@ public class NotificationsPanel extends Composite {
notificationService.getUserNotifications(new AsyncCallback<HashMap<Date, ArrayList<Notification>>>() {
public void onFailure(Throwable caught) {
// TODO Auto-generated method stub
}
@ -82,16 +83,25 @@ public class NotificationsPanel extends Composite {
mainPanel.setHeight("");
mainPanel.setHorizontalAlignment(HasAlignment.ALIGN_LEFT);
mainPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_TOP);
ArrayList<Date> sortedKeys=new ArrayList<Date>(notificationsPerDay.keySet());
Collections.sort(sortedKeys, Collections.reverseOrder());
int notCounter = 0;
for (Date day : sortedKeys) {
mainPanel.add(new DayWrapper(day));
for (Notification notif : notificationsPerDay.get(day))
for (Notification notif : notificationsPerDay.get(day)) {
mainPanel.add(new SingleNotificationView(notif));
notCounter++;
}
}
setNotificationsRead();
if (notCounter < 5) {
mainPanel.add(new Image(spacer));
mainPanel.add(new Image(spacer));
}
if (notCounter > 5 && notCounter < 10)
mainPanel.add(new Image(spacer));
}
}
else
@ -107,11 +117,11 @@ public class NotificationsPanel extends Composite {
mainPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
mainPanel.add(loadingImage);
}
Timer t;
private void setNotificationsRead() {
t = new Timer() {
@Override
public void run() {
notificationService.setAllUserNotificationsRead(new AsyncCallback<Boolean>() {
@ -120,10 +130,10 @@ public class NotificationsPanel extends Composite {
public void onSuccess(Boolean result) {
}
});
}
};
t.schedule(500);
}
}

View File

@ -59,8 +59,8 @@ public class NotificationsServiceImpl extends RemoteServiceServlet implements No
String user = (String) this.getThreadLocalRequest().getSession().getAttribute(ScopeHelper.USERNAME_ATTRIBUTE);
if (user == null) {
//user = "test.user";
//user = "leonardo.candela";
user = "massimiliano.assante";
user = "leonardo.candela";
//user = "massimiliano.assante";
_log.warn("USER IS NULL setting "+user+" and Running OUTSIDE PORTAL");
withinPortal = false;
}

View File

@ -9,7 +9,7 @@
--%>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<script type="text/javascript" language="javascript" src='<%=request.getContextPath()%>/notifications/notifications.nocache.js'></script>
<div id="notificationsDIV">
</div>
<div id="notificationsDIV"></div>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB