| 1 | |
package org.kuali.student.lum.lu.ui.course.client.widgets; |
| 2 | |
|
| 3 | |
import java.util.List; |
| 4 | |
|
| 5 | |
import org.kuali.student.common.ui.client.application.Application; |
| 6 | |
import org.kuali.student.common.ui.client.widgets.KSLabel; |
| 7 | |
import org.kuali.student.common.ui.client.widgets.layout.LinkContentBlock; |
| 8 | |
import org.kuali.student.lum.common.client.helpers.HasRecentlyViewedData; |
| 9 | |
import org.kuali.student.lum.common.client.helpers.RecentDocInfo; |
| 10 | |
import org.kuali.student.lum.common.client.helpers.RecentlyViewedHelper; |
| 11 | |
|
| 12 | |
public class RecentlyViewedBlock extends LinkContentBlock implements HasRecentlyViewedData{ |
| 13 | |
|
| 14 | |
public RecentlyViewedBlock(String blockTitle, String blockDescriptionHtml) { |
| 15 | 0 | super(blockTitle, blockDescriptionHtml); |
| 16 | 0 | RecentlyViewedHelper.addDependant(this); |
| 17 | 0 | KSLabel label = new KSLabel(Application.getApplicationContext().getMessage("noRecent")); |
| 18 | 0 | label.addStyleName("contentBlock-desc"); |
| 19 | 0 | this.add(label); |
| 20 | 0 | } |
| 21 | |
|
| 22 | |
public void update(){ |
| 23 | 0 | List<RecentDocInfo> infos = RecentlyViewedHelper.getRecentlyViewed(); |
| 24 | 0 | listLayout.clear(); |
| 25 | 0 | for(int i = 0; i < infos.size(); i++){ |
| 26 | 0 | this.addNavLinkWidget(infos.get(i).getName(), infos.get(i).getLocation()); |
| 27 | |
} |
| 28 | 0 | } |
| 29 | |
|
| 30 | |
} |