package org.aksw.gwt.TripleCheckMate.client;

import org.aksw.gwt.TripleCheckMate.shared.evaluate.SessionContext;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.event.logical.shared.BeforeSelectionEvent;
import com.google.gwt.event.logical.shared.BeforeSelectionHandler;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.VerticalPanel;

/**
 * Entry point classes define <code>onModuleLoad()</code>.
 */
public class TripleCheckMate implements EntryPoint {

	/**
	 * This is the entry point method.
	 */

	public void onModuleLoad() {

		setHeaderTop();
		setHeaderBottom();
		setVisualPlacement();
	}

	private void setVisualPlacement(){
		RootPanel rootPanel = RootPanel.get();

		VerticalPanel page = new VerticalPanel();
		page.setHeight("100%");
		page.setWidth("100%");
		rootPanel.add(page);

		VerticalPanel evalTabPanel = new VerticalPanel();

		SessionContext.tabPanel.add(SessionContext.pageStart, "DBpedia Evaluation Campaign");
		SessionContext.tabPanel.add(SessionContext.pageEval,"Evaluate");
		SessionContext.tabPanel.addStyleName("main-tab");
		SessionContext.tabPanel.selectTab(0);
		SessionContext.tabPanel.setAnimationEnabled(true);
		SessionContext.tabPanel.addBeforeSelectionHandler(new BeforeSelectionHandler<Integer>() {

			@Override
			public void onBeforeSelection(BeforeSelectionEvent<Integer> event) {
				if (SessionContext.user.userID == 0 && event.getItem() > 0)
					event.cancel();
				//if (SessionContext.user.userID != 0 && event.getItem() != 1)
				//	event.cancel();
			}
		});

		page.add(SessionContext.tabPanel);

		VerticalPanel bodyPanel = new VerticalPanel();
		bodyPanel.setWidth("100%");
		bodyPanel.setSpacing(4);
		evalTabPanel.add(bodyPanel);

		VerticalPanel graphPanel = new VerticalPanel();
	    HTML label = new HTML("Graphs");
	    graphPanel.add(label);
	}

	private void setHeaderBottom(){

	}

	private void setHeaderTop(){

	}
}
@@ -286,16 +286,178 @@
 andler;%0A
+import com.google.gwt.event.logical.shared.SelectionEvent;%0Aimport com.google.gwt.event.logical.shared.SelectionHandler;%0Aimport com.google.gwt.user.client.Window;%0A
 import c
@@ -539,16 +539,63 @@
 tPanel;%0A
+import com.google.gwt.user.client.ui.TabPanel;%0A
 import c
@@ -1675,33 +1675,13 @@
  == 
-0 && event.getItem() %3E 0)
+-1) %7B
 %0A%09%09%09
@@ -1706,93 +1706,9 @@
 %09%09%09%09
-//if (SessionContext.user.userID != 0 && event.getItem() != 1)%0A%09%09%09%09//%09event.cancel();
+%7D
 %0A%09%09%09
@@ -1715,16 +1715,18 @@
 %7D%0A%09%09%7D);%0A
+%09%09
 %0A%09%09page.

Disable evaluation page to unregistered users (fixed)