Search in sources :

Example 1 with RoomEnterBehavior

use of org.apache.openmeetings.web.user.rooms.RoomEnterBehavior in project openmeetings by apache.

the class MessagesContactsPanel method selectMessage.

private void selectMessage(long id, AjaxRequestTarget target) {
    PrivateMessage msg = msgDao.get(id);
    selectedMessage.addOrReplace(new Label("from", msg == null ? "" : getEmail(msg.getFrom())));
    selectedMessage.addOrReplace(new Label("to", msg == null ? "" : getEmail(msg.getTo())));
    selectedMessage.addOrReplace(new Label("subj", msg == null ? "" : msg.getSubject()));
    selectedMessage.addOrReplace(new Label("body", msg == null ? "" : msg.getMessage()).setEscapeModelStrings(false));
    if (msg != null) {
        Room r = msg.getRoom();
        if (r != null) {
            Appointment a = apptDao.getByRoom(r.getId());
            roomContainer.addOrReplace(new Label("start", a == null ? "" : getDateFormat().format(a.getStart())));
            roomContainer.addOrReplace(new Label("end", a == null ? "" : getDateFormat().format(a.getEnd())));
            roomContainer.addOrReplace(new Button("enter").add(new RoomEnterBehavior(r.getId())));
        }
        roomContainer.setVisible(r != null);
    }
    if (target != null) {
        target.add(selectedMessage);
        updateControls(target);
    }
}
Also used : Appointment(org.apache.openmeetings.db.entity.calendar.Appointment) RoomEnterBehavior(org.apache.openmeetings.web.user.rooms.RoomEnterBehavior) Button(org.apache.wicket.markup.html.form.Button) Label(org.apache.wicket.markup.html.basic.Label) PrivateMessage(org.apache.openmeetings.db.entity.user.PrivateMessage) Room(org.apache.openmeetings.db.entity.room.Room)

Aggregations

Appointment (org.apache.openmeetings.db.entity.calendar.Appointment)1 Room (org.apache.openmeetings.db.entity.room.Room)1 PrivateMessage (org.apache.openmeetings.db.entity.user.PrivateMessage)1 RoomEnterBehavior (org.apache.openmeetings.web.user.rooms.RoomEnterBehavior)1 Label (org.apache.wicket.markup.html.basic.Label)1 Button (org.apache.wicket.markup.html.form.Button)1