Massimiliano Assante 2017-09-21 15:47:50 +00:00
parent cec5260381
commit 0a312f0849
3 changed files with 12 additions and 7 deletions

View File

@ -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);

View File

@ -13,6 +13,10 @@ 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") ||

View File

@ -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() {