tooltip is different for storage when quota is available
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/user-statistics@144262 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
d69f0d078a
commit
6a6dce6942
|
@ -76,6 +76,8 @@ public class StatisticsPanel extends Composite {
|
|||
/**
|
||||
* Some tooltips
|
||||
*/
|
||||
|
||||
private final static String QUOTA_TOOLTIP = "Percentage of your used space in the infrastructure storage";
|
||||
private final static String TOOLTIP_ACTIVITY_ROOT_PROFILE = "Posts, likes, replies done during the last year";
|
||||
private final static String TOOLTIP_ACTIVITY_VRE = "Posts, likes, replies done in the last year in this VRE";
|
||||
private final static String TOOLTIP_GOT_ROOT_PROFILE = "Likes and post replies got during the last year";
|
||||
|
@ -345,6 +347,7 @@ public class StatisticsPanel extends Composite {
|
|||
public void onSuccess(QuotaInfo quota) {
|
||||
|
||||
if(quota == null){
|
||||
|
||||
// ask for partial value
|
||||
statisticsService.getTotalSpaceInUse(userid, new AsyncCallback<String>() {
|
||||
|
||||
|
@ -377,6 +380,7 @@ public class StatisticsPanel extends Composite {
|
|||
quotaStorageValue.setType(ButtonType.LINK);
|
||||
quotaStorageValue.setText(decimalFormat + "%");
|
||||
quotaStorageValue.setTitle("Currently using " + NumberFormat.getFormat("#.##").format(current) + "MB of " + max + "MB assigned in the Infrastructure Storage");
|
||||
storage.setToolTip(QUOTA_TOOLTIP);
|
||||
storage.appendToPanel(quotaStorageValue);
|
||||
}
|
||||
|
||||
|
|
|
@ -33,10 +33,10 @@ public class StatisticWidget extends Composite{
|
|||
|
||||
@UiField
|
||||
FlowPanel containerValues;
|
||||
|
||||
|
||||
@UiField
|
||||
Popover popover;
|
||||
|
||||
|
||||
private String headerTitle;
|
||||
|
||||
public StatisticWidget(boolean isRoot) {
|
||||
|
@ -61,21 +61,25 @@ public class StatisticWidget extends Composite{
|
|||
}
|
||||
|
||||
public void setToolTip(String tooltip){
|
||||
|
||||
|
||||
// change popover text content
|
||||
popover.setText(tooltip);
|
||||
|
||||
HTML headerHtml = new HTML(
|
||||
"<span style=\"font-size:14px; font-weight:bold\">"+headerTitle+"</span>"
|
||||
);
|
||||
|
||||
|
||||
popover.setPlacement(Placement.TOP);
|
||||
|
||||
|
||||
// change popover text header
|
||||
popover.setHeading(headerHtml.getHTML());
|
||||
|
||||
// change popover text content
|
||||
popover.setText(tooltip);
|
||||
|
||||
|
||||
// set html
|
||||
popover.setHtml(true);
|
||||
|
||||
|
||||
popover.reconfigure();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue