--- /dev/null
+/*****************************************************************************
+ * Copyright Igor Barma, Eric Brun, Alexandre Desoubeaux, Christian Martel,
+ * (2 décembre 2008)
+ *
+ * Ce logiciel est un programme informatique servant à l'évaluation des
+ * compétences.
+ *
+ * Ce logiciel est régi par la licence CeCILL soumise au droit français et
+ * respectant les principes de diffusion des logiciels libres. Vous pouvez
+ * utiliser, modifier et/ou redistribuer ce programme sous les conditions
+ * de la licence CeCILL telle que diffusée par le CEA, le CNRS et l'INRIA
+ * sur le site "http://www.cecill.info".
+ *
+ * En contrepartie de l'accessibilité au code source et des droits de copie,
+ * de modification et de redistribution accordés par cette licence, il n'est
+ * offert aux utilisateurs qu'une garantie limitée. Pour les mêmes raisons,
+ * seule une responsabilité restreinte pèse sur l'auteur du programme, le
+ * titulaire des droits patrimoniaux et les concédants successifs.
+ *
+ * A cet égard l'attention de l'utilisateur est attirée sur les risques
+ * associés au chargement, à l'utilisation, à la modification et/ou au
+ * développement et à la reproduction du logiciel par l'utilisateur étant
+ * donné sa spécificité de logiciel libre, qui peut le rendre complexe à
+ * manipuler et qui le réserve donc à des développeurs et des professionnels
+ * avertis possédant des connaissances informatiques approfondies. Les
+ * utilisateurs sont donc invités à charger et tester l'adéquation du
+ * logiciel à leurs besoins dans des conditions permettant d'assurer la
+ * sécurité de leurs systèmes et ou de leurs données et, plus généralement,
+ * à l'utiliser et l'exploiter dans les mêmes conditions de sécurité.
+ *
+ * Le fait que vous puissiez accéder à cet en-tête signifie que vous avez
+ * pris connaissance de la licence CeCILL, et que vous en avez accepté les
+ * termes.
+ *******************************************************************************/
+package com.pentila.evalcomp.client.message;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import com.google.gwt.http.client.RequestBuilder;
+import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.google.gwt.user.client.ui.Grid;
+import com.google.gwt.user.client.ui.RichTextArea;
+import com.gwtext.client.core.EventObject;
+import com.gwtext.client.core.Function;
+import com.gwtext.client.core.NameValuePair;
+import com.gwtext.client.core.SortDir;
+import com.gwtext.client.data.ArrayReader;
+import com.gwtext.client.data.FieldDef;
+import com.gwtext.client.data.MemoryProxy;
+import com.gwtext.client.data.ObjectFieldDef;
+import com.gwtext.client.data.Record;
+import com.gwtext.client.data.RecordDef;
+import com.gwtext.client.data.SimpleStore;
+import com.gwtext.client.data.SortState;
+import com.gwtext.client.data.Store;
+import com.gwtext.client.data.StringFieldDef;
+import com.gwtext.client.util.Format;
+
+import com.gwtext.client.widgets.Panel;
+import com.gwtext.client.widgets.Window;
+
+import com.gwtext.client.widgets.event.WindowListenerAdapter;
+import com.gwtext.client.widgets.form.ComboBox;
+import com.gwtext.client.widgets.grid.CellMetadata;
+import com.gwtext.client.widgets.grid.ColumnConfig;
+import com.gwtext.client.widgets.grid.ColumnModel;
+import com.gwtext.client.widgets.grid.GridEditor;
+import com.gwtext.client.widgets.grid.GridPanel;
+import com.gwtext.client.widgets.grid.GridView;
+import com.gwtext.client.widgets.grid.PropertyGridPanel;
+import com.gwtext.client.widgets.grid.Renderer;
+import com.gwtext.client.widgets.grid.RowParams;
+import com.gwtext.client.widgets.grid.event.EditorGridListenerAdapter;
+import com.gwtext.client.widgets.grid.event.GridMouseListenerAdapter;
+import com.gwtext.client.widgets.grid.event.GridRowListenerAdapter;
+import com.gwtext.client.widgets.layout.AnchorLayout;
+import com.gwtext.client.widgets.layout.AnchorLayoutData;
+import com.gwtext.client.widgets.layout.FitLayout;
+import com.gwtext.client.widgets.layout.RowLayout;
+import com.gwtext.client.widgets.layout.RowLayoutData;
+import com.gwtext.client.widgets.menu.BaseItem;
+import com.gwtext.client.widgets.menu.Item;
+import com.gwtext.client.widgets.menu.Menu;
+import com.gwtext.client.widgets.menu.event.BaseItemListenerAdapter;
+import com.pentila.evalcomp.client.ConnexionServer;
+import com.pentila.evalcomp.client.evalFolder.EvaluationFolderPanel;
+import com.pentila.evalcomp.client.i18n.Messages;
+import com.pentila.evalcomp.client.utilities.GridPanelDropable;
+import com.pentila.evalcomp.client.utilities.Tools;
+import com.pentila.evalcomp.client.utilities.UserTools;
+import com.pentila.evalcomp.client.widget.ExtWindow;
+import com.pentila.evalcomp.client.widget.RichTextToolbar;
+import com.pentila.evalcomp.client.widget.SmartWindow;
+import com.pentila.evalcomp.domain.Entity;
+import com.pentila.evalcomp.domain.Group;
+import com.pentila.evalcomp.domain.Message;
+import com.pentila.evalcomp.domain.User;
+import com.smartgwt.client.data.DataSource;
+import com.smartgwt.client.data.RecordList;
+import com.smartgwt.client.data.fields.DataSourceTextField;
+import com.smartgwt.client.types.Alignment;
+import com.smartgwt.client.types.HeaderControls;
+import com.smartgwt.client.types.ListGridFieldType;
+import com.smartgwt.client.types.Overflow;
+import com.smartgwt.client.util.SC;
+import com.smartgwt.client.widgets.Button;
+import com.smartgwt.client.widgets.HeaderControl;
+import com.smartgwt.client.widgets.RichTextEditor;
+import com.smartgwt.client.widgets.events.ClickEvent;
+import com.smartgwt.client.widgets.events.ClickHandler;
+import com.smartgwt.client.widgets.events.CloseClickEvent;
+import com.smartgwt.client.widgets.events.CloseClickHandler;
+import com.smartgwt.client.widgets.events.ResizedEvent;
+import com.smartgwt.client.widgets.events.ResizedHandler;
+import com.smartgwt.client.widgets.form.fields.LinkItem;
+import com.smartgwt.client.widgets.grid.CellFormatter;
+import com.smartgwt.client.widgets.grid.ListGrid;
+import com.smartgwt.client.widgets.grid.ListGridField;
+import com.smartgwt.client.widgets.grid.ListGridRecord;
+import com.smartgwt.client.widgets.layout.VLayout;
+import com.smartgwt.client.widgets.tile.TileLayout;
+import com.smartgwt.client.widgets.viewer.DetailViewer;
+import com.smartgwt.client.widgets.viewer.DetailViewerRecord;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class MessageViewTab. View of a message thread
+ */
+public class MessageSmartViewTab extends VLayout {
+
+ /** The current msg. */
+ private Message currentMsg = null;
+
+ /** tell if it's a one to one or one to many message. */
+ private boolean isOneToOneMessage = true;
+
+ // Definition des differents panel
+ /** The msg grid. */
+ private ListGrid msgGrid;
+
+ /**
+ * Instantiates a new message view tab.
+ */
+ private DetailViewer head;
+
+ private RichTextEditor richTextEditor;
+
+ private SmartWindow window;
+
+ private SmartWindow windowUser;
+
+ /** The render msg detail. */
+ private CellFormatter dateCell = new CellFormatter() {
+
+
+ @Override
+ public String format(Object value, ListGridRecord record, int rowNum,
+ int colNum) {
+ final String icon = "<img src=\"" + Tools.getBaseURL()
+ + "images/add_comment-16x16.png\">";
+
+ Message msg = (Message) record.getAttributeAsObject("object");
+
+
+ String fn = "";
+ String ln = "";
+
+ if (msg.getAuthor() != null) {
+ fn = msg.getAuthor().getFirstname();
+ ln = msg.getAuthor().getLastname();
+ }
+
+
+
+ return icon + Format.format(Messages
+ .getString("format_auteur_date_message"),
+ new String[] { ln, fn,
+ Tools.getDateFormated(msg.getCreationDate()),
+ Tools.getHourFormated(msg.getCreationDate()), });
+ }
+ };
+
+
+
+
+
+ /**
+ * Instantiates a new message view tab.
+ */
+ public MessageSmartViewTab() {
+ super();
+ initializeInterface();
+ }
+
+ /**
+ * Gets the msg set.
+ *
+ * @param msg
+ * the msg
+ * @param msgSet
+ * the msg set
+ *
+ * @return the msg set
+ */
+ private Set<Message> getMsgSet(Message msg, Set<Message> msgSet) {
+ msgSet.add(msg);
+ for (Message m : msg.getReplies()) {
+ for (Message mBis : getMsgSet(m, msgSet)) {
+ msgSet.add(mBis);
+ }
+ }
+ return msgSet;
+ }
+
+ /**
+ * Initialize view msg thread interface.
+ *
+ * @param msg
+ * the msg
+ */
+ public void initializeViewMsgInterface(Message msg) {
+ currentMsg = msg;
+
+ AsyncCallback callback = new AsyncCallback() {
+ public void onFailure(Throwable caught) {
+ Tools.hideLoading();
+ System.out
+ .println("problem dans la recup des messages non lus");
+ }
+
+ public void onSuccess(Object result) {
+ Message mes = (Message) result;
+ Set<Message> setMsg = new HashSet<Message>();
+
+
+ List<Entity> msgRecipList = new ArrayList<Entity>(mes
+ .getCurrentRecipients());
+
+ isOneToOneMessage = true;
+ if (msgRecipList.size() > 1) {
+ isOneToOneMessage = false;
+ }
+
+ final Set<String> msgRecipSetName = new HashSet<String>();
+ for (Entity e : msgRecipList) {
+ if (e instanceof User) {
+ msgRecipSetName.add(((User) e).getLastname()
+ + " " + ((User) e).getFirstname());
+ } else {
+ // on met 1 to 1 à false car groupe
+ isOneToOneMessage = false;
+ msgRecipSetName
+ .add(Messages.getString("le_groupe") + ((Group) e).getUid());
+ }
+ }
+
+ RecordList rl = new RecordList();
+
+ DetailViewerRecord dvr1 = new DetailViewerRecord();
+
+ dvr1.setAttribute("subject", mes.getSubject());
+
+ String ret = "";
+ String firstMember = "";
+
+ String ownerName = mes.getAuthor().getLastname() + " " + mes.getAuthor().getFirstname();
+ firstMember = ownerName;
+
+ if (msgRecipSetName.size() > 1){
+
+ head.addClickHandler(new ClickHandler(){
+
+ @Override
+ public void onClick(ClickEvent event) {
+
+ windowUser = new SmartWindow();
+ windowUser.setTitle(Messages.getString("Destinataires"));
+ ListGrid ll = new ListGrid();
+
+ ListGridField lgf = new ListGridField("name", Messages.getString("Nom"));
+
+
+
+
+ ll.setFields(lgf);
+
+ ll.setSortField("name");
+ RecordList rl = new RecordList();
+
+ for(String name : msgRecipSetName){
+ ListGridRecord lgr = new ListGridRecord();
+ lgr.setAttribute("name", name);
+
+ rl.add(lgr);
+ }
+
+ ll.setData(rl);
+
+ windowUser.addItem(ll);
+ windowUser.setWidth(300);
+ windowUser.setHeight(200);
+ windowUser.setLeft(event.getX());
+ windowUser.setTop(event.getY());
+ windowUser.show();
+
+
+ }
+
+ });
+
+ ret = Format.format(Messages.getString("et_n_participants"), "" + (msgRecipSetName.size()-1));
+
+ firstMember += ", ";
+ }else if (msgRecipSetName.size() == 1){
+ firstMember += " et ";
+ firstMember = firstMember + msgRecipSetName.iterator().next();
+ }
+
+ dvr1.setAttribute("recipients",firstMember + ret);
+
+
+ rl.add(dvr1);
+
+
+
+ head.setData(rl);
+
+ List<String> msgRecipListName = new ArrayList<String>(
+ msgRecipSetName);
+
+ Collections.sort(msgRecipListName, new Comparator<String>() {
+ public int compare(String r1, String r2) {
+
+ return r1.compareTo(r2);
+ }
+ });
+
+ setMsg = getMsgSet(mes, setMsg);
+
+ List<Message> msgList = new ArrayList<Message>(setMsg);
+ Collections.sort(msgList, new Comparator<Message>() {
+ public int compare(Message msg1, Message msg2) {
+
+ return msg2.getCreationDate().compareTo(
+ msg1.getCreationDate());
+ }
+ });
+
+ RecordList rl2 = new RecordList();
+
+
+ for (int i = 0; i < msgList.size(); i++) {
+ Message msg = (Message) msgList.toArray()[i];
+
+ ListGridRecord lgr = new ListGridRecord();
+ lgr.setAttribute("message", msg.getBody());
+ lgr.setAttribute("date", msg.getCreationDate());
+ lgr.setAttribute("object", msg);
+
+ rl2.add(lgr);
+
+ }
+
+ msgGrid.setData(rl2);
+
+ Tools.hideLoading();
+ // On met a jour la portlet message
+ //MessagerieWidget.updateMessageList();
+ }
+ };
+ Tools
+ .showLoading(
+ Messages.getString("MAJ_fil_de_discussion"), Messages.getString("Chargement"));
+ RequestBuilder rb = ConnexionServer.messageService.readMessage(
+ UserTools.getUser().getUid(), msg.getId(), callback);
+ rb.setHeader("code", "A12");
+
+ ConnexionServer.doSend(rb);
+
+ }
+
+
+
+ private void initializeInterface(){
+
+ this.setPadding(5);
+
+
+ this.setWidth100();
+ this.setHeight100();
+
+ head = new DetailViewer();
+ head.setPadding(5);
+ head.setLabelStyle("detailLabel leftDetailLabel");
+ head.setCellStyle("detail paddingDetail");
+
+ DataSource dsCamp = new DataSource();
+
+ dsCamp.addField(new DataSourceTextField("subject", Messages
+ .getString("Sujet")));
+
+ dsCamp.addField(new DataSourceTextField("recipients", Messages
+ .getString("Destinataires")));
+
+
+
+
+
+ head.setDataSource(dsCamp);
+
+
+ head.setShowResizeBar(true);
+ Button addButton = new Button(Messages.getString("Repondre_"));
+ addButton.setWidth(150);
+ addButton.setShowDisabled(true);
+ addButton.setShowDown(true);
+ addButton.setIcon(Tools.getBaseURL() + "images/add_comment-16x16.png");
+
+ addButton.addClickHandler(new ClickHandler(){
+
+ @Override
+ public void onClick(ClickEvent event) {
+ showWindowReply();
+
+ }
+
+ });
+
+ VLayout vl = new VLayout();
+
+ vl.addMember(addButton);
+
+
+ msgGrid = new ListGrid();
+ msgGrid.setPadding(5);
+
+ msgGrid.setWidth100();
+ msgGrid.setHeight100();
+ msgGrid.setShowAllRecords(true);
+ msgGrid.setWrapCells(true);
+ msgGrid.setFixedRecordHeights(false);
+ msgGrid.setAlternateRecordStyles(true);
+
+
+ ListGridField messageField = new ListGridField("message", "Message");
+
+ ListGridField dateField = new ListGridField("date", "date", 120);
+ dateField.setType(ListGridFieldType.DATE);
+ dateField.setAlign(Alignment.RIGHT);
+
+ dateField.setCellFormatter(dateCell);
+ dateField.setWrap(true);
+
+
+ msgGrid.setFields(messageField, dateField);
+
+ addMember(head);
+
+
+ vl.addMember(msgGrid);
+ addMember(vl);
+
+
+
+ }
+
+ /**
+ * Initialize GUI.
+ */
+ /*private void initializeInterface2() {
+
+
+
+ this.setPadding(5);
+ this.setWidth100();
+ this.setHeight100();
+
+
+
+
+
+
+ Panel p = new Panel();
+ ta = new RichTextArea();
+
+ ta.setSize("500px", "300px");
+ p.add(ta);
+
+ final ExtWindow w = new ExtWindow();
+ w.setCollapsible(true);
+ w.setTitle("Presse-papiers");
+ w.setCloseAction(Window.HIDE);
+ w.add(p);
+
+
+
+
+
+
+ msgGrid.addGridRowListener(new GridRowListenerAdapter() {
+ @Override
+ public void onRowClick(GridPanel grid, int rowIndex, EventObject e) {
+
+ }
+
+ @Override
+ public void onRowContextMenu(GridPanel grid, int rowIndex,
+ EventObject e) {
+
+ msgGrid.getSelectionModel().selectRow(rowIndex, true);
+ e.stopEvent();
+
+ if (menuEntity == null) {
+ menuEntity = new Menu();
+
+ Item copyItem = new Item(Messages
+ .getString("copier"), //$NON-NLS-1$
+ new BaseItemListenerAdapter() {
+ @Override
+ public void onClick(BaseItem item, EventObject e) {
+
+
+
+ copyToWindow();
+ w.show();
+ w.getEl().setStyle("z-index", "1000000");
+ }
+ });
+
+
+
+ menuEntity.addItem(copyItem);
+ }
+ menuEntity.showAt(e.getXY());
+
+ }
+
+ @Override
+ public void onRowDblClick(GridPanel grid, int rowIndex,
+ EventObject e) {
+ copyToWindow();
+ w.show();
+ w.getEl().setStyle("z-index", "1000000");
+ }
+
+ });
+
+
+ replyWindow = new ExtWindow();
+ replyWindow.setTitle(Messages.getString("Ajouter_un_commentaire"), "iconAddComment16");
+ replyWindow.setWidth("600px");
+
+ richText = new RichTextArea();
+ richText.setSize("550px", "200px");
+
+ com.gwtext.client.widgets.form.Label l = new com.gwtext.client.widgets.form.Label();
+ l.setHtml("<br><b>" + Messages.getString("message_warning") + "</b><br><br>");
+ replyWindow.add(l);
+ replyWindow.add(richText);
+ replyWindow.setCloseAction(Window.HIDE);
+ replyWindow.addListener(new WindowListenerAdapter() {
+ @Override
+ public void onActivate(Window source) {
+ richText.setText("");
+ richText.setFocus(true);
+ }
+ });
+
+ // add a couple of buttons to the form
+ Button sendButton = new Button(Messages.getString("Envoyer")); //$NON-NLS-1$
+ sendButton.addListener(new ButtonListenerAdapter() {
+ @Override
+ public void onClick(Button button, EventObject e) {
+ replyMsg();
+ }
+ });
+ replyWindow.addButton(sendButton);
+
+ Panel replyVpBas = new Panel();
+ replyVpBas.setBorder(false);
+
+ Button reponseLabelBas = new Button(Messages.getString("Repondre_"), new ButtonListenerAdapter() {
+ public void onClick(Button button, EventObject e) {
+
+ replyWindow.show();
+ replyWindow.getEl().setStyle("z-index", "1000000");
+ }
+ });
+
+ reponseLabelBas.setIconCls("iconAddComment16");
+ replyVpBas.add(reponseLabelBas);
+
+
+
+ Panel replyVpHaut = new Panel();
+ replyVpHaut.setBorder(false);
+
+ Button reponseLabelHaut = new Button(Messages.getString("Repondre_"), new ButtonListenerAdapter() {
+ public void onClick(Button button, EventObject e) {
+
+ replyWindow.show();
+ replyWindow.getEl().setStyle("z-index", "1000000");
+ }
+ });
+ reponseLabelHaut.setIconCls("iconAddComment16");
+ replyVpHaut.add(reponseLabelHaut);
+
+ pgp = new PropertyGridPanel();
+ pgp.hideColumnHeader();
+
+ GridView view = new GridView();
+ view.setForceFit(true);
+ view.setAutoFill(true);
+ pgp.setView(view);
+
+ pgp.addGridMouseListener(new GridMouseListenerAdapter() {
+ public void onMouseOver(EventObject e) {
+
+ GridView gv = pgp.getView();
+ int col = findCellIndex(pgp.getView(), e);
+ int row = gv.findRowIndex(e);
+
+ if (row == 1) {
+ pgp.startEditing(row, col);
+ cb.expand();
+ }
+
+ }
+
+ public void onMouseOut(EventObject e) {
+
+ }
+
+ });
+
+ pgp.addEditorGridListener(new EditorGridListenerAdapter(){
+ public boolean doBeforeEdit(GridPanel grid, Record record, String field, Object value, int rowIndex, int colIndex){
+ if (rowIndex == 1){
+ return true;
+ }
+ return false;
+ }
+ });
+
+ content.add(pgp, new RowLayoutData(100));
+
+
+ content.add(replyVpHaut, new RowLayoutData(30));
+ content.add(msgGrid, new RowLayoutData("60%"));
+ content.add(replyVpBas, new RowLayoutData(30));
+
+
+ add(content);
+
+ }*/
+
+ protected void showWindowReply() {
+ window = new SmartWindow();
+ window.setOverflow(Overflow.AUTO);
+
+
+ window.addCloseClickHandler(new CloseClickHandler() {
+ public void onCloseClick(CloseClickEvent event) {
+
+
+ window.destroy();
+ Tools.hideLoading();
+ }
+ });
+
+ TileLayout tileLayout = new TileLayout();
+ tileLayout.setTileWidth(200);
+ tileLayout.setTileHeight(150);
+ tileLayout.setWidth100();
+ tileLayout.setTilesPerLine(3);
+
+ ClickHandler clickHandler = new ClickHandler() {
+ public void onClick(ClickEvent event) {
+
+ if (window.getMaximized() != null && window.getMaximized()){
+ window.restore();
+ }else{
+ window.maximize();
+ }
+ }
+ };
+ HeaderControl maximize = new HeaderControl(HeaderControl.MAXIMIZE, clickHandler);
+
+ window.setHeaderControls(HeaderControls.HEADER_LABEL , HeaderControls.MINIMIZE_BUTTON,HeaderControls.MAXIMIZE_BUTTON, maximize, HeaderControls.CLOSE_BUTTON);
+ window.setWidth(800);
+ window.setHeight(600);
+ window.setAutoSize(false);
+ window.setCanDragReposition(true);
+ window.setCanDragResize(true);
+ window.centerInPage();
+
+ String title = Messages.getString("Ajouter_un_commentaire") + " : " + currentMsg.getSubject();
+
+ window.setTitle(title);
+
+ richTextEditor = new RichTextEditor();
+ richTextEditor.setHeight100();
+ richTextEditor.setOverflow(Overflow.HIDDEN);
+
+
+ VLayout vl = new VLayout();
+ vl.setDefaultLayoutAlign(Alignment.CENTER);
+ vl.addMember(richTextEditor);
+
+ Button sendButton = new Button(Messages.getString("Envoyer"));
+
+ sendButton.addClickHandler(new ClickHandler(){
+
+ @Override
+ public void onClick(ClickEvent event) {
+ replyMsg();
+
+ }
+
+ });
+
+ vl.addMember(sendButton);
+
+ window.addItem(vl);
+
+ tileLayout.addTile(window);
+
+ window.setLeft(this.getAbsoluteLeft() + 10);
+ window.setTop(this.getAbsoluteTop()+10);
+
+ window.show();
+
+ }
+
+ /**
+ * Reply to a msg.
+ */
+ private void replyMsg() {
+ Message msg = new Message();
+ msg.setAuthor(UserTools.getUser());
+ msg.setBody(richTextEditor.getValue());
+
+
+ AsyncCallback callback = new AsyncCallback() {
+ public void onFailure(Throwable caught) {
+ window.destroy();
+ }
+
+ public void onSuccess(Object result) {
+ Message msg = (Message) result;
+ initializeViewMsgInterface(msg);
+ window.destroy();
+ }
+ };
+
+ RequestBuilder rb = ConnexionServer.messageService.reply(currentMsg
+ .getId(), msg, callback);
+ rb.setHeader("code", "A12");
+ ConnexionServer.doSend(rb);
+ }
+
+
+
+ /**
+ * Copy to window.
+ */
+ /*public void copyToWindow(){
+ Record[] ar = msgGrid.getSelectionModel().getSelections();
+ String text = "";
+
+ final String icon = "<img src=\"" + Tools.getBaseURL() //$NON-NLS-1$
+ + "images/add_comment-16x16.png\">";
+
+
+
+ for (Record r : ar){
+
+ Message msg = (Message) r.getAsObject("msgObject");
+
+
+
+ String fn = "";
+ String ln = "";
+
+ if (msg.getAuthor() != null) {
+ fn = msg.getAuthor().getFirstname();
+ ln = msg.getAuthor().getLastname();
+ }
+
+ String head = icon + Format.format(Messages
+ .getString("format_auteur_date_message"),
+ new String[] { ln, fn,
+ Tools.getDateFormated(msg.getCreationDate()),
+ Tools.getHourFormated(msg.getCreationDate()), });
+
+
+
+
+ text += "<b>" + msg.getSubject()+ "</b> " +head+"<br/><br/>" +msg.getBody()+"<br/>" +"<hr/>";
+
+ }
+
+
+
+ ta.setHTML(text);
+ }
+*/
+
+ @Override
+ public void onDestroy(){
+
+ if (window != null){
+ window.destroy();
+ }
+ if (windowUser != null){
+ windowUser.destroy();
+ }
+ }
+
+
+}