// Path: src/main/java/gov/wa/wsdot/apps/analytics/shared/Mention.java
// public class Mention extends JavaScriptObject {
// 	protected Mention() {}
// 	
// 	public final native String getText() /*-{ return this.text }-*/;
// 	public final native String getProfileImageUrl() /*-{ return this.profile_image_url }-*/;
// 	public final native String getToUserIdStr() /*-{ return this.to_user_id_str }-*/;
// 	public final native String getFromUser() /*-{ return this.from_user }-*/;
// 	public final native int getFromUserId() /*-{ return this.from_user_id }-*/;
// 	public final native int getToUserId() /*-{ return this.to_user_id }-*/;
// 	public final native String getGeo() /*-{ return this.geo }-*/;
// 	public final native double getId() /*-{ return this.id }-*/;
// 	public final native String getIsoLanguageCode() /*-{ return this.iso_language_code }-*/;
// 	public final native String getFromUserIdStr() /*-{ return this.from_user_id_str }-*/;
// 	public final native String getSource() /*-{ return this.source }-*/;
// 	public final native String getIdStr() /*-{ return this.id_str }-*/;
// 	public final native String getCreatedAt() /*-{ return this.created_at }-*/;
// 	public final native String getSentiment() /*-{ return this.sentiment }-*/;
// 	public final native Entities getEntities() /*-{ return this.entities }-*/;
// 	public final native JsArray<Mention> getMentions() /*-{ return this }-*/;
// 	public final native User getUser() /*-{ return this.user }-*/;
// 	public final native int getRetweet() /*-{ return this.retweet_count }-*/;
// 	public final native int getFavorited() /*-{ return this.favorite_count }-*/;
// }
// 
// Path: src/main/java/gov/wa/wsdot/apps/analytics/util/Consts.java
// public final class Consts {
// 
//     public static final String HOST_URL = "http://127.0.0.1:3001";
// 
//     public static final String DEFAULT_ACCOUNT = "wsdot";
// 
//     /**
//      * The caller references the constants using <tt>Consts.EMPTY_STRING</tt>,
//      * and so on. Thus, the caller should be prevented from constructing objects of
//      * this class, by declaring this private constructor.
//      */
//     private Consts() {
//         //this prevents even the native class from
//         //calling this ctor as well :
//         throw new AssertionError();
//     }
// 
// }


import gwt.material.design.addins.client.pathanimator.MaterialPathAnimator;
import gwt.material.design.client.constants.IconType;
import gwt.material.design.client.ui.*;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.jsonp.client.JsonpRequestBuilder;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Widget;
import gov.wa.wsdot.apps.analytics.shared.Mention;
import gov.wa.wsdot.apps.analytics.util.Consts;
        updateSentiment("positive");
    }

    @UiHandler("negative")
    public void onNegClick(ClickEvent e){
        MaterialPathAnimator.reverseAnimate(sentiment.getElement(), sentimentDialog.getElement());
        sentimentDialog.setVisible(false);
        updateSentiment("negative");
    }

    @UiHandler("neutral")
    public void onNeuClick(ClickEvent e){
        MaterialPathAnimator.reverseAnimate(sentiment.getElement(), sentimentDialog.getElement());
        sentimentDialog.setVisible(false);
        updateSentiment("neutral");
    }

    @UiHandler("btnClose")
    public void onClose(ClickEvent e){
        MaterialPathAnimator.reverseAnimate(sentiment.getElement(), sentimentDialog.getElement());
        sentimentDialog.setVisible(false);
    }

    private void updateSentiment(final String sentimentType){

        String url = JSON_URL + this.id + "/" + sentimentType;

        JsonpRequestBuilder jsonp = new JsonpRequestBuilder();
        // Set timeout for 30 seconds (30000 milliseconds)
        jsonp.setTimeout(30000);
// Path: src/main/java/gov/wa/wsdot/apps/analytics/shared/Mention.java
// public class Mention extends JavaScriptObject {
// 	protected Mention() {}
// 	
// 	public final native String getText() /*-{ return this.text }-*/;
// 	public final native String getProfileImageUrl() /*-{ return this.profile_image_url }-*/;
// 	public final native String getToUserIdStr() /*-{ return this.to_user_id_str }-*/;
// 	public final native String getFromUser() /*-{ return this.from_user }-*/;
// 	public final native int getFromUserId() /*-{ return this.from_user_id }-*/;
// 	public final native int getToUserId() /*-{ return this.to_user_id }-*/;
// 	public final native String getGeo() /*-{ return this.geo }-*/;
// 	public final native double getId() /*-{ return this.id }-*/;
// 	public final native String getIsoLanguageCode() /*-{ return this.iso_language_code }-*/;
// 	public final native String getFromUserIdStr() /*-{ return this.from_user_id_str }-*/;
// 	public final native String getSource() /*-{ return this.source }-*/;
// 	public final native String getIdStr() /*-{ return this.id_str }-*/;
// 	public final native String getCreatedAt() /*-{ return this.created_at }-*/;
// 	public final native String getSentiment() /*-{ return this.sentiment }-*/;
// 	public final native Entities getEntities() /*-{ return this.entities }-*/;
// 	public final native JsArray<Mention> getMentions() /*-{ return this }-*/;
// 	public final native User getUser() /*-{ return this.user }-*/;
// 	public final native int getRetweet() /*-{ return this.retweet_count }-*/;
// 	public final native int getFavorited() /*-{ return this.favorite_count }-*/;
// }
// 
// Path: src/main/java/gov/wa/wsdot/apps/analytics/util/Consts.java
// public final class Consts {
// 
//     public static final String HOST_URL = "http://127.0.0.1:3001";
// 
//     public static final String DEFAULT_ACCOUNT = "wsdot";
// 
//     /**
//      * The caller references the constants using <tt>Consts.EMPTY_STRING</tt>,
//      * and so on. Thus, the caller should be prevented from constructing objects of
//      * this class, by declaring this private constructor.
//      */
//     private Consts() {
//         //this prevents even the native class from
//         //calling this ctor as well :
//         throw new AssertionError();
//     }
// 
// }


// Path: src/main/java/gov/wa/wsdot/apps/analytics/client/activities/twitter/view/tweet/TweetView.java
import gwt.material.design.addins.client.pathanimator.MaterialPathAnimator;
import gwt.material.design.client.constants.IconType;
import gwt.material.design.client.ui.*;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.jsonp.client.JsonpRequestBuilder;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Widget;
import gov.wa.wsdot.apps.analytics.shared.Mention;
import gov.wa.wsdot.apps.analytics.util.Consts;

        updateSentiment("positive");
    }

    @UiHandler("negative")
    public void onNegClick(ClickEvent e){
        MaterialPathAnimator.reverseAnimate(sentiment.getElement(), sentimentDialog.getElement());
        sentimentDialog.setVisible(false);
        updateSentiment("negative");
    }

    @UiHandler("neutral")
    public void onNeuClick(ClickEvent e){
        MaterialPathAnimator.reverseAnimate(sentiment.getElement(), sentimentDialog.getElement());
        sentimentDialog.setVisible(false);
        updateSentiment("neutral");
    }

    @UiHandler("btnClose")
    public void onClose(ClickEvent e){
        MaterialPathAnimator.reverseAnimate(sentiment.getElement(), sentimentDialog.getElement());
        sentimentDialog.setVisible(false);
    }

    private void updateSentiment(final String sentimentType){

        String url = JSON_URL + this.id + "/" + sentimentType;

        JsonpRequestBuilder jsonp = new JsonpRequestBuilder();
        // Set timeout for 30 seconds (30000 milliseconds)
        jsonp.setTimeout(30000);
        jsonp.requestObject(url, new AsyncCallback<Mention>() {