package org.sagebionetworks.web.client.widget.discussion;

import org.gwtbootstrap3.client.ui.html.Div;
import org.gwtbootstrap3.client.ui.html.Paragraph;
import org.gwtbootstrap3.client.ui.html.Span;

import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Widget;
import com.google.inject.Inject;

public class DiscussionThreadWidgetViewImpl implements DiscussionThreadWidgetView {

	public interface Binder extends UiBinder<Widget, DiscussionThreadWidgetViewImpl> {}

	@UiField
	Div replyListContainer;
	@UiField
	Span threadTitle;
	@UiField
	Paragraph threadMessage;
	@UiField
	Span activeUsers;
	@UiField
	Span numberOfReplies;
	@UiField
	Span numberOfViews;
	@UiField
	Span lastActivity;

	private Widget widget;
	private DiscussionThreadWidget presenter;

	@Inject
	public DiscussionThreadWidgetViewImpl(Binder binder) {
		widget = binder.createAndBindUi(this);
	}

	@Override
	public Widget asWidget() {
		return widget;
	}

	@Override
	public void setPresenter(DiscussionThreadWidget presenter) {
		this.presenter = presenter;
	}

	@Override
	public void addReply(Widget w) {
		replyListContainer.add(w);
	}

	@Override
	public void clear() {
		replyListContainer.clear();
	}

	@Override
	public void setTitle(String title) {
		threadTitle.setHTML(title);
	}

	@Override
	public void setMessage(String message) {
		threadMessage.setHTML(message);
	}

	@Override
	public void setActiveUsers(String activeUsers){
		this.activeUsers.setHTML(activeUsers);
	}

	@Override
	public void setNumberOfReplies(String numberOfReplies) {
		this.numberOfReplies.setHTML(numberOfReplies);
	}

	@Override
	public void setNumberOfViews(String numberOfViews) {
		this.numberOfViews.setHTML(numberOfViews);
	}

	@Override
	public void setLastActivity(String lastActivity) {
		this.lastActivity.setHTML(lastActivity);
	}

}

@@ -1321,20 +1321,20 @@
 itle.set
-HTML
+Text
 (title);
@@ -1410,20 +1410,20 @@
 sage.set
-HTML
+Text
 (message
@@ -1511,20 +1511,20 @@
 sers.set
-HTML
+Text
 (activeU
@@ -1625,28 +1625,28 @@
 fReplies.set
-HTML
+Text
 (numberOfRep
@@ -1745,20 +1745,20 @@
 iews.set
-HTML
+Text
 (numberO
@@ -1860,12 +1860,12 @@
 .set
-HTML
+Text
 (las

use setText instead of setHTML