Added no topics message when there are no topics available
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/top-topics@128551 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
f08a74a8a7
commit
9b7db56867
|
@ -31,6 +31,7 @@ public class TopicsPanel extends Composite {
|
|||
public static final String loading = GWT.getModuleBaseURL() + "../images/topics-loader.gif";
|
||||
public static final String DISPLAY_NAME = "Top Topics";
|
||||
public static final int THRESHOLD_SHOW_HASHTAGS = 10; // show the first X ones
|
||||
private static final String NO_TOP_TOPICS_MESSAGE = "No Topics Available";
|
||||
|
||||
private Image loadingImage;
|
||||
|
||||
|
@ -55,7 +56,7 @@ public class TopicsPanel extends Composite {
|
|||
}
|
||||
else {
|
||||
int counter = 0;
|
||||
if (hashtags != null) {
|
||||
if (hashtags != null && !hashtags.isEmpty()) {
|
||||
for (String hashtag : hashtags) {
|
||||
counter ++;
|
||||
HTML toAdd = new HTML(hashtag);
|
||||
|
@ -65,7 +66,6 @@ public class TopicsPanel extends Composite {
|
|||
if(counter > THRESHOLD_SHOW_HASHTAGS) // 11, 12...
|
||||
toAdd.setVisible(false);
|
||||
}
|
||||
}
|
||||
|
||||
// add a show all button if needed
|
||||
if(counter > THRESHOLD_SHOW_HASHTAGS){
|
||||
|
@ -90,6 +90,12 @@ public class TopicsPanel extends Composite {
|
|||
});
|
||||
mainPanel.add(showAllHashtags);
|
||||
}
|
||||
|
||||
}else{
|
||||
|
||||
mainPanel.add(new HTML(NO_TOP_TOPICS_MESSAGE));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue