2014-10-07 16:41:08 +02:00
|
|
|
package org.gcube.portlets.user.newsfeed.client.ui;
|
|
|
|
|
|
|
|
import com.google.gwt.core.client.GWT;
|
|
|
|
import com.google.gwt.dom.client.Style.Cursor;
|
|
|
|
import com.google.gwt.event.dom.client.ClickEvent;
|
|
|
|
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.Location;
|
|
|
|
import com.google.gwt.user.client.ui.Composite;
|
|
|
|
import com.google.gwt.user.client.ui.HTML;
|
|
|
|
import com.google.gwt.user.client.ui.Widget;
|
|
|
|
|
|
|
|
public class ResultsFor extends Composite {
|
|
|
|
|
|
|
|
private static ResultsForUiBinder uiBinder = GWT
|
|
|
|
.create(ResultsForUiBinder.class);
|
|
|
|
|
|
|
|
interface ResultsForUiBinder extends UiBinder<Widget, ResultsFor> {
|
|
|
|
}
|
|
|
|
|
|
|
|
@UiField HTML allUpdatesLink;
|
|
|
|
@UiField HTML resultForDiv;
|
2014-10-08 23:15:42 +02:00
|
|
|
public ResultsFor(String prefix, String hashtag) {
|
2014-10-07 16:41:08 +02:00
|
|
|
initWidget(uiBinder.createAndBindUi(this));
|
2016-04-06 19:11:02 +02:00
|
|
|
allUpdatesLink.setHTML("<a class=\"link\">All Updates</a>");
|
2014-10-07 16:41:08 +02:00
|
|
|
allUpdatesLink.getElement().getStyle().setCursor(Cursor.POINTER);
|
2016-10-07 14:54:00 +02:00
|
|
|
resultForDiv.setHTML(prefix + hashtag);
|
2014-10-07 16:41:08 +02:00
|
|
|
resultForDiv.setStyleName("filter-selected");
|
|
|
|
}
|
|
|
|
|
|
|
|
@UiHandler("allUpdatesLink")
|
|
|
|
void onAllUpdatesClick(ClickEvent e) {
|
|
|
|
String href = Location.getHref();
|
|
|
|
if (href.contains("?"))
|
|
|
|
href = href.substring(0, href.indexOf("?"));
|
|
|
|
Location.assign(href);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|