Package edu.wpi.cs.wpisuitetng.modules.postboard.model

Examples of edu.wpi.cs.wpisuitetng.modules.postboard.model.PostBoardMessage


      // Clear the text field
      view.getTxtNewMessage().setText("");
     
      // Send a request to the core to save this message
      final Request request = Network.getInstance().makeRequest("postboard/postboardmessage", HttpMethod.PUT); // PUT == create
      request.setBody(new PostBoardMessage(message).toJSON()); // put the new message in the body of the request
      request.addObserver(new AddMessageRequestObserver(this)); // add an observer to process the response
      request.send(); // send the request
    }
  }
View Full Code Here


  public void responseSuccess(IRequest iReq) {
    // Get the response to the given request
    final ResponseModel response = iReq.getResponse();
   
    // Parse the message out of the response body
    final PostBoardMessage message = PostBoardMessage.fromJson(response.getBody());
   
    // Pass the messages back to the controller
    controller.addMessageToModel(message);
  }
View Full Code Here

   *
   * @see edu.wpi.cs.wpisuitetng.network.RequestObserver#fail(edu.wpi.cs.wpisuitetng.network.models.IRequest, java.lang.Exception)
   */
  @Override
  public void fail(IRequest iReq, Exception exception) {
    PostBoardMessage[] errorMessage = {new PostBoardMessage("Error retrieving messages.")};
    controller.receivedMessages(errorMessage);
  }
View Full Code Here

TOP

Related Classes of edu.wpi.cs.wpisuitetng.modules.postboard.model.PostBoardMessage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.