}
private AnchorElement newLink(LinkListener linkListener, Year year, Integer monthOrWeek)
{
AnchorElement link = Document.get().createAnchorElement();
String text;
if (unit == MONTH)
{
text = i18n.enums().getString("month_" + monthOrWeek);
}
else
{
text = String.valueOf(monthOrWeek);
}
String rel = String.valueOf(year.getYear()) + "|" + monthOrWeek;
link.setAttribute("rel", rel);
link.setAttribute("href", "#");
link.setInnerText(text);
Element linkElement = (Element) Element.as(link);
DOM.sinkEvents(linkElement, Event.ONCLICK);
DOM.setEventListener(linkElement, linkListener);