ActivityWidget now contains only buttons, there is no longer need to have an icon and a label for each statistic
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/user-statistics@131825 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
80861705d0
commit
0f4b2deae1
|
@ -35,7 +35,6 @@ import com.google.gwt.user.client.ui.Composite;
|
||||||
import com.google.gwt.user.client.ui.FlowPanel;
|
import com.google.gwt.user.client.ui.FlowPanel;
|
||||||
import com.google.gwt.user.client.ui.HTML;
|
import com.google.gwt.user.client.ui.HTML;
|
||||||
import com.google.gwt.user.client.ui.Image;
|
import com.google.gwt.user.client.ui.Image;
|
||||||
import com.google.gwt.user.client.ui.Label;
|
|
||||||
/**
|
/**
|
||||||
* Panel to show received user's statistics
|
* Panel to show received user's statistics
|
||||||
*
|
*
|
||||||
|
@ -359,8 +358,10 @@ public class StatisticsPanel extends Composite {
|
||||||
appendAlertIcon(storage);
|
appendAlertIcon(storage);
|
||||||
}else{
|
}else{
|
||||||
storage.clearPanelValues();
|
storage.clearPanelValues();
|
||||||
Label storageValue = new Label(spaceInUse);
|
Button storageValue = new Button();
|
||||||
storageValue.setStyleName("statistic-value");
|
storageValue.setType(ButtonType.LINK);
|
||||||
|
storageValue.setText(spaceInUse);
|
||||||
|
storageValue.addStyleName("buttons-statistics-disabled-events");
|
||||||
storage.appendToPanel(storageValue);
|
storage.appendToPanel(storageValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -386,9 +387,10 @@ public class StatisticsPanel extends Composite {
|
||||||
|
|
||||||
// clear panel
|
// clear panel
|
||||||
profileStrength.clearPanelValues();
|
profileStrength.clearPanelValues();
|
||||||
final Label profileStrengthLabel = new Label(profileStrengthInt + "%");
|
Button profileStrengthLabel = new Button();
|
||||||
profileStrengthLabel.setStyleName("statistic-value");
|
profileStrengthLabel.setType(ButtonType.LINK);
|
||||||
|
profileStrengthLabel.setText(profileStrengthInt + "%");
|
||||||
|
profileStrengthLabel.addStyleName("buttons-statistics-disabled-events");
|
||||||
profileStrength.appendToPanel(profileStrengthLabel);
|
profileStrength.appendToPanel(profileStrengthLabel);
|
||||||
|
|
||||||
// in case too low information within the user profile
|
// in case too low information within the user profile
|
||||||
|
@ -461,14 +463,12 @@ public class StatisticsPanel extends Composite {
|
||||||
if(isRoot || isProfilePage)
|
if(isRoot || isProfilePage)
|
||||||
activityDone.setPosts(
|
activityDone.setPosts(
|
||||||
formattedNumbers(postsBean.getFeedsNumber()),
|
formattedNumbers(postsBean.getFeedsNumber()),
|
||||||
TOOLTIP_POSTS_DONE,
|
|
||||||
TOOLTIP_POSTS_DONE + " (" + postsBean.getFeedsNumber() + ")",
|
TOOLTIP_POSTS_DONE + " (" + postsBean.getFeedsNumber() + ")",
|
||||||
ShowUserStatisticAction.POSTS_MADE_BY_USER,
|
ShowUserStatisticAction.POSTS_MADE_BY_USER,
|
||||||
information.getCurrentPageLanding());
|
information.getCurrentPageLanding());
|
||||||
else
|
else
|
||||||
activityDone.setPosts(
|
activityDone.setPosts(
|
||||||
formattedNumbers(postsBean.getFeedsNumber()),
|
formattedNumbers(postsBean.getFeedsNumber()),
|
||||||
TOOLTIP_POSTS_DONE,
|
|
||||||
TOOLTIP_POSTS_DONE_VRE + " (" + postsBean.getFeedsNumber() + ")",
|
TOOLTIP_POSTS_DONE_VRE + " (" + postsBean.getFeedsNumber() + ")",
|
||||||
ShowUserStatisticAction.POSTS_MADE_BY_USER,
|
ShowUserStatisticAction.POSTS_MADE_BY_USER,
|
||||||
information.getCurrentPageLanding());
|
information.getCurrentPageLanding());
|
||||||
|
@ -479,14 +479,12 @@ public class StatisticsPanel extends Composite {
|
||||||
if(isRoot || isProfilePage)
|
if(isRoot || isProfilePage)
|
||||||
activityDone.setLikes(
|
activityDone.setLikes(
|
||||||
formattedNumbers(postsBean.getLikesMade()),
|
formattedNumbers(postsBean.getLikesMade()),
|
||||||
TOOLTIP_LIKES_DONE,
|
|
||||||
TOOLTIP_LIKES_DONE + " (" + postsBean.getLikesMade() + ")",
|
TOOLTIP_LIKES_DONE + " (" + postsBean.getLikesMade() + ")",
|
||||||
ShowUserStatisticAction.LIKES_MADE_BY_USER,
|
ShowUserStatisticAction.LIKES_MADE_BY_USER,
|
||||||
information.getCurrentPageLanding());
|
information.getCurrentPageLanding());
|
||||||
else
|
else
|
||||||
activityDone.setLikes(
|
activityDone.setLikes(
|
||||||
formattedNumbers(postsBean.getLikesMade()),
|
formattedNumbers(postsBean.getLikesMade()),
|
||||||
TOOLTIP_LIKES_DONE_VRE,
|
|
||||||
TOOLTIP_LIKES_DONE_VRE + " (" + postsBean.getLikesMade() + ")",
|
TOOLTIP_LIKES_DONE_VRE + " (" + postsBean.getLikesMade() + ")",
|
||||||
ShowUserStatisticAction.LIKES_MADE_BY_USER,
|
ShowUserStatisticAction.LIKES_MADE_BY_USER,
|
||||||
information.getCurrentPageLanding());
|
information.getCurrentPageLanding());
|
||||||
|
@ -494,14 +492,12 @@ public class StatisticsPanel extends Composite {
|
||||||
if(isRoot || isProfilePage)
|
if(isRoot || isProfilePage)
|
||||||
activityDone.setComments(
|
activityDone.setComments(
|
||||||
formattedNumbers(postsBean.getCommentsMade()),
|
formattedNumbers(postsBean.getCommentsMade()),
|
||||||
TOOLTIP_REPLIES_DONE,
|
|
||||||
TOOLTIP_REPLIES_DONE + " (" + postsBean.getCommentsMade() + ")",
|
TOOLTIP_REPLIES_DONE + " (" + postsBean.getCommentsMade() + ")",
|
||||||
ShowUserStatisticAction.COMMENTS_MADE_BY_USER,
|
ShowUserStatisticAction.COMMENTS_MADE_BY_USER,
|
||||||
information.getCurrentPageLanding());
|
information.getCurrentPageLanding());
|
||||||
else
|
else
|
||||||
activityDone.setComments(
|
activityDone.setComments(
|
||||||
formattedNumbers(postsBean.getCommentsMade()),
|
formattedNumbers(postsBean.getCommentsMade()),
|
||||||
TOOLTIP_REPLIES_DONE_VRE,
|
|
||||||
TOOLTIP_REPLIES_DONE_VRE +" (" + postsBean.getCommentsMade() + ")",
|
TOOLTIP_REPLIES_DONE_VRE +" (" + postsBean.getCommentsMade() + ")",
|
||||||
ShowUserStatisticAction.COMMENTS_MADE_BY_USER,
|
ShowUserStatisticAction.COMMENTS_MADE_BY_USER,
|
||||||
information.getCurrentPageLanding());
|
information.getCurrentPageLanding());
|
||||||
|
@ -518,14 +514,12 @@ public class StatisticsPanel extends Composite {
|
||||||
if(isRoot || isProfilePage)
|
if(isRoot || isProfilePage)
|
||||||
activityGot.setLikes(
|
activityGot.setLikes(
|
||||||
formattedNumbers(postsBean.getLikesReceived()),
|
formattedNumbers(postsBean.getLikesReceived()),
|
||||||
TOOLTIP_LIKES_GOT,
|
|
||||||
TOOLTIP_LIKES_GOT+ " (" + postsBean.getLikesReceived() + ")",
|
TOOLTIP_LIKES_GOT+ " (" + postsBean.getLikesReceived() + ")",
|
||||||
ShowUserStatisticAction.LIKES_GOT_BY_USER,
|
ShowUserStatisticAction.LIKES_GOT_BY_USER,
|
||||||
information.getCurrentPageLanding());
|
information.getCurrentPageLanding());
|
||||||
else
|
else
|
||||||
activityGot.setLikes(
|
activityGot.setLikes(
|
||||||
formattedNumbers(postsBean.getLikesReceived()),
|
formattedNumbers(postsBean.getLikesReceived()),
|
||||||
TOOLTIP_LIKES_GOT_VRE,
|
|
||||||
TOOLTIP_LIKES_GOT_VRE + " (" + postsBean.getLikesReceived() + ")",
|
TOOLTIP_LIKES_GOT_VRE + " (" + postsBean.getLikesReceived() + ")",
|
||||||
ShowUserStatisticAction.LIKES_GOT_BY_USER,
|
ShowUserStatisticAction.LIKES_GOT_BY_USER,
|
||||||
information.getCurrentPageLanding());
|
information.getCurrentPageLanding());
|
||||||
|
@ -535,14 +529,12 @@ public class StatisticsPanel extends Composite {
|
||||||
if(isRoot || isProfilePage)
|
if(isRoot || isProfilePage)
|
||||||
activityGot.setComments(
|
activityGot.setComments(
|
||||||
formattedNumbers(postsBean.getCommentsReceived()),
|
formattedNumbers(postsBean.getCommentsReceived()),
|
||||||
TOOLTIP_REPLIES_GOT,
|
|
||||||
TOOLTIP_REPLIES_GOT + " (" + postsBean.getCommentsReceived() + ")",
|
TOOLTIP_REPLIES_GOT + " (" + postsBean.getCommentsReceived() + ")",
|
||||||
ShowUserStatisticAction.COMMENTS_GOT_BY_USER,
|
ShowUserStatisticAction.COMMENTS_GOT_BY_USER,
|
||||||
information.getCurrentPageLanding());
|
information.getCurrentPageLanding());
|
||||||
else
|
else
|
||||||
activityGot.setComments(
|
activityGot.setComments(
|
||||||
formattedNumbers(postsBean.getCommentsReceived()),
|
formattedNumbers(postsBean.getCommentsReceived()),
|
||||||
TOOLTIP_REPLIES_GOT_VRE,
|
|
||||||
TOOLTIP_REPLIES_GOT_VRE + " (" + postsBean.getCommentsReceived() + ")",
|
TOOLTIP_REPLIES_GOT_VRE + " (" + postsBean.getCommentsReceived() + ")",
|
||||||
ShowUserStatisticAction.COMMENTS_GOT_BY_USER,
|
ShowUserStatisticAction.COMMENTS_GOT_BY_USER,
|
||||||
information.getCurrentPageLanding());
|
information.getCurrentPageLanding());
|
||||||
|
@ -643,14 +635,12 @@ public class StatisticsPanel extends Composite {
|
||||||
if(isRoot)
|
if(isRoot)
|
||||||
activityDone.setPosts(
|
activityDone.setPosts(
|
||||||
formattedNumbers(numberOfWrittenFeeds),
|
formattedNumbers(numberOfWrittenFeeds),
|
||||||
TOOLTIP_POSTS_DONE,
|
|
||||||
TOOLTIP_POSTS_DONE + " (" + numberOfWrittenFeeds + ")",
|
TOOLTIP_POSTS_DONE + " (" + numberOfWrittenFeeds + ")",
|
||||||
ShowUserStatisticAction.POSTS_MADE_BY_USER,
|
ShowUserStatisticAction.POSTS_MADE_BY_USER,
|
||||||
informationBeanRetrieved.getCurrentPageLanding());
|
informationBeanRetrieved.getCurrentPageLanding());
|
||||||
else
|
else
|
||||||
activityDone.setPosts(
|
activityDone.setPosts(
|
||||||
formattedNumbers(numberOfWrittenFeeds),
|
formattedNumbers(numberOfWrittenFeeds),
|
||||||
TOOLTIP_POSTS_DONE,
|
|
||||||
TOOLTIP_POSTS_DONE_VRE + " (" + numberOfWrittenFeeds + ")",
|
TOOLTIP_POSTS_DONE_VRE + " (" + numberOfWrittenFeeds + ")",
|
||||||
ShowUserStatisticAction.POSTS_MADE_BY_USER,
|
ShowUserStatisticAction.POSTS_MADE_BY_USER,
|
||||||
informationBeanRetrieved.getCurrentPageLanding());
|
informationBeanRetrieved.getCurrentPageLanding());
|
||||||
|
@ -683,14 +673,12 @@ public class StatisticsPanel extends Composite {
|
||||||
if(isRoot)
|
if(isRoot)
|
||||||
activityDone.setPosts(
|
activityDone.setPosts(
|
||||||
formattedNumbers(numberOfWrittenFeeds),
|
formattedNumbers(numberOfWrittenFeeds),
|
||||||
TOOLTIP_POSTS_DONE,
|
|
||||||
TOOLTIP_POSTS_DONE + " (" + numberOfWrittenFeeds + ")",
|
TOOLTIP_POSTS_DONE + " (" + numberOfWrittenFeeds + ")",
|
||||||
ShowUserStatisticAction.POSTS_MADE_BY_USER,
|
ShowUserStatisticAction.POSTS_MADE_BY_USER,
|
||||||
informationBeanRetrieved.getCurrentPageLanding());
|
informationBeanRetrieved.getCurrentPageLanding());
|
||||||
else
|
else
|
||||||
activityDone.setPosts(
|
activityDone.setPosts(
|
||||||
formattedNumbers(numberOfWrittenFeeds),
|
formattedNumbers(numberOfWrittenFeeds),
|
||||||
TOOLTIP_POSTS_DONE,
|
|
||||||
TOOLTIP_POSTS_DONE_VRE + " (" + numberOfWrittenFeeds + ")",
|
TOOLTIP_POSTS_DONE_VRE + " (" + numberOfWrittenFeeds + ")",
|
||||||
ShowUserStatisticAction.POSTS_MADE_BY_USER,
|
ShowUserStatisticAction.POSTS_MADE_BY_USER,
|
||||||
informationBeanRetrieved.getCurrentPageLanding());
|
informationBeanRetrieved.getCurrentPageLanding());
|
||||||
|
@ -721,14 +709,13 @@ public class StatisticsPanel extends Composite {
|
||||||
if(isRoot)
|
if(isRoot)
|
||||||
activityGot.setLikes(
|
activityGot.setLikes(
|
||||||
formattedNumbers(numberOfLikesGot),
|
formattedNumbers(numberOfLikesGot),
|
||||||
TOOLTIP_LIKES_GOT,
|
|
||||||
TOOLTIP_LIKES_GOT + " (" + numberOfLikesGot + ")",
|
TOOLTIP_LIKES_GOT + " (" + numberOfLikesGot + ")",
|
||||||
ShowUserStatisticAction.LIKES_GOT_BY_USER,
|
ShowUserStatisticAction.LIKES_GOT_BY_USER,
|
||||||
informationBeanRetrieved.getCurrentPageLanding());
|
informationBeanRetrieved.getCurrentPageLanding());
|
||||||
else
|
else
|
||||||
activityGot.setLikes(
|
activityGot.setLikes(
|
||||||
formattedNumbers(numberOfLikesGot),
|
formattedNumbers(numberOfLikesGot),
|
||||||
TOOLTIP_LIKES_GOT_VRE,
|
|
||||||
TOOLTIP_LIKES_GOT_VRE + " (" + numberOfLikesGot + ")",
|
TOOLTIP_LIKES_GOT_VRE + " (" + numberOfLikesGot + ")",
|
||||||
ShowUserStatisticAction.LIKES_GOT_BY_USER,
|
ShowUserStatisticAction.LIKES_GOT_BY_USER,
|
||||||
informationBeanRetrieved.getCurrentPageLanding());
|
informationBeanRetrieved.getCurrentPageLanding());
|
||||||
|
@ -762,14 +749,12 @@ public class StatisticsPanel extends Composite {
|
||||||
if(isRoot)
|
if(isRoot)
|
||||||
activityGot.setLikes(
|
activityGot.setLikes(
|
||||||
formattedNumbers(numberOfLikesGot),
|
formattedNumbers(numberOfLikesGot),
|
||||||
TOOLTIP_LIKES_GOT,
|
|
||||||
TOOLTIP_LIKES_GOT + " (" + numberOfLikesGot + ")",
|
TOOLTIP_LIKES_GOT + " (" + numberOfLikesGot + ")",
|
||||||
ShowUserStatisticAction.LIKES_GOT_BY_USER,
|
ShowUserStatisticAction.LIKES_GOT_BY_USER,
|
||||||
informationBeanRetrieved.getCurrentPageLanding());
|
informationBeanRetrieved.getCurrentPageLanding());
|
||||||
else
|
else
|
||||||
activityGot.setLikes(
|
activityGot.setLikes(
|
||||||
formattedNumbers(numberOfLikesGot),
|
formattedNumbers(numberOfLikesGot),
|
||||||
TOOLTIP_LIKES_GOT_VRE,
|
|
||||||
TOOLTIP_LIKES_GOT_VRE + " (" + numberOfLikesGot + ")",
|
TOOLTIP_LIKES_GOT_VRE + " (" + numberOfLikesGot + ")",
|
||||||
ShowUserStatisticAction.LIKES_GOT_BY_USER,
|
ShowUserStatisticAction.LIKES_GOT_BY_USER,
|
||||||
informationBeanRetrieved.getCurrentPageLanding());
|
informationBeanRetrieved.getCurrentPageLanding());
|
||||||
|
@ -802,14 +787,12 @@ public class StatisticsPanel extends Composite {
|
||||||
if(isRoot)
|
if(isRoot)
|
||||||
activityGot.setComments(
|
activityGot.setComments(
|
||||||
formattedNumbers(numberOfCommentsGot),
|
formattedNumbers(numberOfCommentsGot),
|
||||||
TOOLTIP_REPLIES_GOT,
|
|
||||||
TOOLTIP_REPLIES_GOT + " (" + numberOfCommentsGot + ")",
|
TOOLTIP_REPLIES_GOT + " (" + numberOfCommentsGot + ")",
|
||||||
ShowUserStatisticAction.COMMENTS_GOT_BY_USER,
|
ShowUserStatisticAction.COMMENTS_GOT_BY_USER,
|
||||||
informationBeanRetrieved.getCurrentPageLanding());
|
informationBeanRetrieved.getCurrentPageLanding());
|
||||||
else
|
else
|
||||||
activityGot.setComments(
|
activityGot.setComments(
|
||||||
formattedNumbers(numberOfCommentsGot),
|
formattedNumbers(numberOfCommentsGot),
|
||||||
TOOLTIP_REPLIES_GOT_VRE,
|
|
||||||
TOOLTIP_REPLIES_GOT_VRE + " (" + numberOfCommentsGot + ")",
|
TOOLTIP_REPLIES_GOT_VRE + " (" + numberOfCommentsGot + ")",
|
||||||
ShowUserStatisticAction.COMMENTS_GOT_BY_USER,
|
ShowUserStatisticAction.COMMENTS_GOT_BY_USER,
|
||||||
informationBeanRetrieved.getCurrentPageLanding());
|
informationBeanRetrieved.getCurrentPageLanding());
|
||||||
|
@ -842,14 +825,12 @@ public class StatisticsPanel extends Composite {
|
||||||
if(isRoot)
|
if(isRoot)
|
||||||
activityGot.setComments(
|
activityGot.setComments(
|
||||||
formattedNumbers(numberOfCommentsGot),
|
formattedNumbers(numberOfCommentsGot),
|
||||||
TOOLTIP_REPLIES_GOT,
|
|
||||||
TOOLTIP_REPLIES_GOT + " (" + numberOfCommentsGot + ")",
|
TOOLTIP_REPLIES_GOT + " (" + numberOfCommentsGot + ")",
|
||||||
ShowUserStatisticAction.COMMENTS_GOT_BY_USER,
|
ShowUserStatisticAction.COMMENTS_GOT_BY_USER,
|
||||||
informationBeanRetrieved.getCurrentPageLanding());
|
informationBeanRetrieved.getCurrentPageLanding());
|
||||||
else
|
else
|
||||||
activityGot.setComments(
|
activityGot.setComments(
|
||||||
formattedNumbers(numberOfCommentsGot),
|
formattedNumbers(numberOfCommentsGot),
|
||||||
TOOLTIP_REPLIES_GOT_VRE,
|
|
||||||
TOOLTIP_REPLIES_GOT_VRE + " (" + numberOfCommentsGot + ")",
|
TOOLTIP_REPLIES_GOT_VRE + " (" + numberOfCommentsGot + ")",
|
||||||
ShowUserStatisticAction.COMMENTS_GOT_BY_USER,
|
ShowUserStatisticAction.COMMENTS_GOT_BY_USER,
|
||||||
informationBeanRetrieved.getCurrentPageLanding());
|
informationBeanRetrieved.getCurrentPageLanding());
|
||||||
|
|
|
@ -5,14 +5,12 @@ import org.gcube.portlet.user.userstatisticsportlet.client.events.ShowFeedsRelat
|
||||||
|
|
||||||
import com.github.gwtbootstrap.client.ui.Button;
|
import com.github.gwtbootstrap.client.ui.Button;
|
||||||
import com.google.gwt.core.client.GWT;
|
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.event.dom.client.ClickEvent;
|
||||||
import com.google.gwt.event.dom.client.ClickHandler;
|
import com.google.gwt.event.dom.client.ClickHandler;
|
||||||
import com.google.gwt.event.shared.HandlerManager;
|
import com.google.gwt.event.shared.HandlerManager;
|
||||||
import com.google.gwt.uibinder.client.UiBinder;
|
import com.google.gwt.uibinder.client.UiBinder;
|
||||||
import com.google.gwt.uibinder.client.UiField;
|
import com.google.gwt.uibinder.client.UiField;
|
||||||
import com.google.gwt.user.client.ui.Composite;
|
import com.google.gwt.user.client.ui.Composite;
|
||||||
import com.google.gwt.user.client.ui.Label;
|
|
||||||
import com.google.gwt.user.client.ui.Widget;
|
import com.google.gwt.user.client.ui.Widget;
|
||||||
|
|
||||||
public class ActivityWidget extends Composite {
|
public class ActivityWidget extends Composite {
|
||||||
|
@ -33,15 +31,6 @@ public class ActivityWidget extends Composite {
|
||||||
@UiField
|
@UiField
|
||||||
Button postsButton;
|
Button postsButton;
|
||||||
|
|
||||||
@UiField
|
|
||||||
Label likesValue;
|
|
||||||
|
|
||||||
@UiField
|
|
||||||
Label commentsValue;
|
|
||||||
|
|
||||||
@UiField
|
|
||||||
Label postsValue;
|
|
||||||
|
|
||||||
private HandlerManager busEvents;
|
private HandlerManager busEvents;
|
||||||
|
|
||||||
public ActivityWidget() {
|
public ActivityWidget() {
|
||||||
|
@ -61,17 +50,14 @@ public class ActivityWidget extends Composite {
|
||||||
* @param actionToTakeOnClick
|
* @param actionToTakeOnClick
|
||||||
* @param landingPage
|
* @param landingPage
|
||||||
*/
|
*/
|
||||||
public void setComments(String value, String tipIcon, String tipValue, final ShowUserStatisticAction actionToTakeOnClick, final String landingPage){
|
public void setComments(String value, String tipValue, final ShowUserStatisticAction actionToTakeOnClick, final String landingPage){
|
||||||
|
|
||||||
commentsButton.setTitle(tipIcon);
|
commentsButton.setText(value);
|
||||||
commentsValue.setText(value);
|
commentsButton.setTitle(tipValue);
|
||||||
commentsValue.setTitle(tipValue);
|
|
||||||
|
|
||||||
if(busEvents != null && actionToTakeOnClick != null){
|
if(busEvents != null && actionToTakeOnClick != null){
|
||||||
|
|
||||||
commentsValue.getElement().getStyle().setCursor(Cursor.POINTER);
|
commentsButton.addClickHandler(new ClickHandler() {
|
||||||
commentsValue.addStyleName("statistic-value-underline");
|
|
||||||
commentsValue.addClickHandler(new ClickHandler() {
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(ClickEvent event) {
|
public void onClick(ClickEvent event) {
|
||||||
|
@ -84,7 +70,6 @@ public class ActivityWidget extends Composite {
|
||||||
}
|
}
|
||||||
|
|
||||||
// set to visible
|
// set to visible
|
||||||
commentsValue.setVisible(true);
|
|
||||||
commentsButton.setVisible(true);
|
commentsButton.setVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,17 +81,14 @@ public class ActivityWidget extends Composite {
|
||||||
* @param actionToTakeOnClick
|
* @param actionToTakeOnClick
|
||||||
* @param landingPage
|
* @param landingPage
|
||||||
*/
|
*/
|
||||||
public void setLikes(String value, String tipIcon, String tipValue, final ShowUserStatisticAction actionToTakeOnClick, final String landingPage){
|
public void setLikes(String value, String tipValue, final ShowUserStatisticAction actionToTakeOnClick, final String landingPage){
|
||||||
|
|
||||||
likesButton.setTitle(tipIcon);
|
likesButton.setText(value);
|
||||||
likesValue.setText(value);
|
likesButton.setTitle(tipValue);
|
||||||
likesValue.setTitle(tipValue);
|
|
||||||
|
|
||||||
if(busEvents != null && actionToTakeOnClick != null){
|
if(busEvents != null && actionToTakeOnClick != null){
|
||||||
|
|
||||||
likesValue.getElement().getStyle().setCursor(Cursor.POINTER);
|
likesButton.addClickHandler(new ClickHandler() {
|
||||||
likesValue.addStyleName("statistic-value-underline");
|
|
||||||
likesValue.addClickHandler(new ClickHandler() {
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(ClickEvent event) {
|
public void onClick(ClickEvent event) {
|
||||||
|
@ -119,7 +101,6 @@ public class ActivityWidget extends Composite {
|
||||||
}
|
}
|
||||||
|
|
||||||
// set to visible
|
// set to visible
|
||||||
likesValue.setVisible(true);
|
|
||||||
likesButton.setVisible(true);
|
likesButton.setVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -131,17 +112,14 @@ public class ActivityWidget extends Composite {
|
||||||
* @param actionToTakeOnClick
|
* @param actionToTakeOnClick
|
||||||
* @param landingPage
|
* @param landingPage
|
||||||
*/
|
*/
|
||||||
public void setPosts(String value, String tipIcon, String tipValue, final ShowUserStatisticAction actionToTakeOnClick, final String landingPage){
|
public void setPosts(String value, String tipValue, final ShowUserStatisticAction actionToTakeOnClick, final String landingPage){
|
||||||
|
|
||||||
postsButton.setTitle(tipIcon);
|
postsButton.setText(value);
|
||||||
postsValue.setText(value);
|
postsButton.setTitle(tipValue);
|
||||||
postsValue.setTitle(tipValue);
|
|
||||||
|
|
||||||
if(busEvents != null && actionToTakeOnClick != null){
|
if(busEvents != null && actionToTakeOnClick != null){
|
||||||
|
|
||||||
postsValue.getElement().getStyle().setCursor(Cursor.POINTER);
|
postsButton.addClickHandler(new ClickHandler() {
|
||||||
postsValue.addStyleName("statistic-value-underline");
|
|
||||||
postsValue.addClickHandler(new ClickHandler() {
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(ClickEvent event) {
|
public void onClick(ClickEvent event) {
|
||||||
|
@ -154,7 +132,6 @@ public class ActivityWidget extends Composite {
|
||||||
}
|
}
|
||||||
|
|
||||||
// set to visible
|
// set to visible
|
||||||
postsValue.setVisible(true);
|
|
||||||
postsButton.setVisible(true);
|
postsButton.setVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,14 +10,13 @@
|
||||||
}
|
}
|
||||||
</ui:style>
|
</ui:style>
|
||||||
<g:HTMLPanel>
|
<g:HTMLPanel>
|
||||||
<b:Button ui:field="postsButton" icon="SHARE_ALT" type="LINK" visible="false"></b:Button>
|
<g:HorizontalPanel>
|
||||||
<g:Label styleName="{style.statistic-value}" ui:field="postsValue"
|
<b:Button ui:field="postsButton" icon="SHARE_ALT" type="LINK"
|
||||||
visible="false"></g:Label>
|
visible="false"></b:Button>
|
||||||
<b:Button ui:field="likesButton" icon="THUMBS_UP_ALT" type="LINK" visible="false"></b:Button>
|
<b:Button ui:field="likesButton" icon="THUMBS_UP_ALT" type="LINK"
|
||||||
<g:Label styleName="{style.statistic-value}" ui:field="likesValue"
|
visible="false"></b:Button>
|
||||||
visible="false"></g:Label>
|
<b:Button ui:field="commentsButton" icon="COMMENTS" type="LINK"
|
||||||
<b:Button ui:field="commentsButton" icon="COMMENTS" type="LINK" visible="false"></b:Button>
|
visible="false"></b:Button>
|
||||||
<g:Label styleName="{style.statistic-value}" ui:field="commentsValue"
|
</g:HorizontalPanel>
|
||||||
visible="false"></g:Label>
|
|
||||||
</g:HTMLPanel>
|
</g:HTMLPanel>
|
||||||
</ui:UiBinder>
|
</ui:UiBinder>
|
|
@ -3,11 +3,12 @@
|
||||||
xmlns:g="urn:import:com.google.gwt.user.client.ui" xmlns:b="urn:import:com.github.gwtbootstrap.client.ui">
|
xmlns:g="urn:import:com.google.gwt.user.client.ui" xmlns:b="urn:import:com.github.gwtbootstrap.client.ui">
|
||||||
<ui:style>
|
<ui:style>
|
||||||
.statistic-container {
|
.statistic-container {
|
||||||
display: inline-block;
|
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
|
display: inline-block;
|
||||||
height: 60px;
|
height: 60px;
|
||||||
width: auto;
|
width: auto;
|
||||||
margin-right: 2%;
|
margin-right: 2%;
|
||||||
|
margin-top: 3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.statistic-header {
|
.statistic-header {
|
||||||
|
@ -23,13 +24,17 @@
|
||||||
text-align: center;
|
text-align: center;
|
||||||
vertical-align: text-top;
|
vertical-align: text-top;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.container-values-style {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
</ui:style>
|
</ui:style>
|
||||||
<g:HTMLPanel styleName="{style.statistic-container}"
|
<g:HTMLPanel styleName="{style.statistic-container}"
|
||||||
ui:field="container">
|
ui:field="container">
|
||||||
<b:Popover ui:field="popover">
|
<b:Popover ui:field="popover">
|
||||||
<g:Label styleName="{style.statistic-header}" ui:field="header" />
|
<g:Label styleName="{style.statistic-header}" ui:field="header" />
|
||||||
</b:Popover>
|
</b:Popover>
|
||||||
<g:FlowPanel ui:field="containerValues">
|
<g:FlowPanel ui:field="containerValues" styleName="{style.container-values-style}">
|
||||||
<!-- Content goes here -->
|
<!-- Content goes here -->
|
||||||
</g:FlowPanel>
|
</g:FlowPanel>
|
||||||
</g:HTMLPanel>
|
</g:HTMLPanel>
|
||||||
|
|
|
@ -78,6 +78,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.buttons-statistics-style {
|
.buttons-statistics-style {
|
||||||
pointer-events: none;
|
|
||||||
padding: 2px 3px !important;
|
padding: 2px 3px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.buttons-statistics-disabled-events {
|
||||||
|
pointer-events: none !important;
|
||||||
|
}
|
Loading…
Reference in New Issue