package org.gcube.portlets.user.notifications.client.view.templates; import org.gcube.portal.databook.client.GCubeSocialNetworking; import org.gcube.portal.databook.shared.Notification; import com.google.gwt.core.client.GWT; import com.google.gwt.i18n.client.DateTimeFormat; import com.google.gwt.uibinder.client.UiBinder; import com.google.gwt.uibinder.client.UiField; 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 SingleNotificationView extends Composite { private static NotificationsDayUiBinder uiBinder = GWT .create(NotificationsDayUiBinder.class); interface NotificationsDayUiBinder extends UiBinder { } private Notification myNotification; @UiField Image notificationImage; @UiField HTMLPanel mainPanel; @UiField HTML notificationText; @UiField HTML timeArea; public SingleNotificationView(Notification toShow) { initWidget(uiBinder.createAndBindUi(this)); myNotification = toShow; String notificationToShow = toShow.getDescription(); notificationText.setHTML( ""+ toShow.getSenderFullName()+" " + notificationToShow); timeArea.setHTML(DateTimeFormat.getFormat("MMMM dd, h:mm a").format(toShow.getTime())); } }