package org.sagebionetworks.web.client.widget.entity.tabs;

import org.gwtbootstrap3.client.ui.Button;
import org.gwtbootstrap3.client.ui.html.Div;
import org.sagebionetworks.web.client.DisplayUtils;

import com.google.gwt.core.shared.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Widget;

public class DiscussionTabViewImpl implements DiscussionTabView {
	public static final String DISCUSSION_LEARN_MORE_URL = "#!Synapse:syn2305384/wiki/61139";
	@UiField
	Div forumContainer;
	@UiField
	Button learnMoreButton;
	private Presenter presenter;

	Widget widget;
	public interface TabsViewImplUiBinder extends UiBinder<Widget, DiscussionTabViewImpl> {}

	public DiscussionTabViewImpl() {
		TabsViewImplUiBinder binder = GWT.create(TabsViewImplUiBinder.class);
		widget = binder.createAndBindUi(this);
		learnMoreButton.addClickHandler(new ClickHandler() {
			@Override
			public void onClick(ClickEvent event) {
				DisplayUtils.newWindow(DISCUSSION_LEARN_MORE_URL, "", "");
			}
		});
	}
	
	public void updateWidth(Tab tab) {
		tab.getTabListItem().setWidth("150px");
	};
	
	@Override
	public void setForum(Widget w) {
		forumContainer.add(w);
	}

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

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

	@Override
	public void showErrorMessage(String errorMessage) {
		DisplayUtils.showErrorMessage(errorMessage);
	}
}

@@ -548,99 +548,8 @@
 w %7B%0A
-%09public static final String DISCUSSION_LEARN_MORE_URL = %22#!Synapse:syn2305384/wiki/61139%22;%0A
 %09@Ui
@@ -1037,18 +1037,32 @@
 dow(
-DISCUSSION
+TablesTabViewImpl.TABLES
 _LEA

use existing constant