git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/message-conversations@154399 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
cec5260381
commit
0a312f0849
|
@ -12,6 +12,7 @@ import com.google.gwt.user.client.ui.RootPanel;
|
|||
*/
|
||||
public class MessageConversations implements EntryPoint {
|
||||
public static final String DIV_CONTAINER_ID = "create-users-container";
|
||||
public static final String ARTIFACT_ID = "messages";
|
||||
/**
|
||||
* Create a remote service proxy to talk to the server-side Greeting service.
|
||||
*/
|
||||
|
@ -23,7 +24,7 @@ public class MessageConversations implements EntryPoint {
|
|||
* This is the entry point method.
|
||||
*/
|
||||
public void onModuleLoad() {
|
||||
((ServiceDefTarget) convService).setServiceEntryPoint("/delegate/message-conversations");
|
||||
((ServiceDefTarget) convService).setServiceEntryPoint(Utils.getServiceEntryPoint());
|
||||
ap = new ApplicationView();
|
||||
RootPanel.get(DIV_CONTAINER_ID).add(ap);
|
||||
ap.readUserMessages(false);
|
||||
|
|
|
@ -12,7 +12,11 @@ import gwt.material.design.client.constants.Color;
|
|||
public class Utils {
|
||||
public static DateTimeFormat fmCurrentYear = DateTimeFormat.getFormat("MMM d H:mm");
|
||||
public static DateTimeFormat fmPastYears = DateTimeFormat.getFormat("MMM d H:mm ''yy");
|
||||
|
||||
|
||||
public static String getServiceEntryPoint() {
|
||||
return "/delegate/"+MessageConversations.ARTIFACT_ID;
|
||||
}
|
||||
|
||||
public static Color getRandomColor() {
|
||||
Color toReturn = Color.values()[Random.nextInt(Color.values().length)];
|
||||
while (toReturn.name().startsWith("WHITE") ||
|
||||
|
@ -25,13 +29,13 @@ public class Utils {
|
|||
}
|
||||
return toReturn;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public static boolean isMobile() {
|
||||
int screenWidth = RootPanel.get(MessageConversations.DIV_CONTAINER_ID).getOffsetWidth();
|
||||
return (screenWidth <= 768);
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public static String getFormatteDate(Date date) {
|
||||
Date now = new Date();
|
||||
|
@ -47,5 +51,5 @@ public class Utils {
|
|||
return(now.getYear() == date.getYear()) ? fmCurrentYear.format(date) : fmPastYears.format(date);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -97,7 +97,7 @@ public class ApplicationView extends Composite {
|
|||
|
||||
public ApplicationView() {
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
((ServiceDefTarget) convService).setServiceEntryPoint("/delegate/message-conversations");
|
||||
((ServiceDefTarget) convService).setServiceEntryPoint(Utils.getServiceEntryPoint());
|
||||
displayMessage = new DisplayMessage(convService, this);
|
||||
newMessageDisplay = new WriteMessage(convService, this);
|
||||
Window.addResizeHandler(new ResizeHandler() {
|
||||
|
|
Loading…
Reference in New Issue