1280: Workspace GUI: quote and available feature improvements

Task-Url: https://support.d4science.org/issues/1280

Added workspacefeatures.ui.xml

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace@120170 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2015-11-02 17:53:30 +00:00
parent 48339d7baa
commit b6c136fa7b
5 changed files with 56 additions and 30 deletions

View File

@ -3,8 +3,6 @@
*/
package org.gcube.portlets.user.workspace.client.view;
import org.gcube.portlets.user.workspace.client.resources.WsPortletResources;
import com.github.gwtbootstrap.client.ui.Label;
import com.github.gwtbootstrap.client.ui.Popover;
import com.github.gwtbootstrap.client.ui.constants.Placement;
@ -15,7 +13,6 @@ import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.Widget;
/**
@ -33,10 +30,16 @@ public class WorkspaceFeatures extends Composite {
@UiField
HorizontalPanel hp_feautures;
@UiField
Label dnd;
@UiField
Label plk;
private Image imgUpload = new Image(WsPortletResources.ICONS.upload16());
private Popover overImgUpload = new Popover();
private Popover overDnD = new Popover();
private Popover overPlk = new Popover();
@UiField
FlowPanel fp1;
@ -65,11 +68,12 @@ public class WorkspaceFeatures extends Composite {
public WorkspaceFeatures() {
initWidget(uiBinder.createAndBindUi(this));
initPopupDndFeature();
hp_feautures.setCellWidth(fp1, "33%");
hp_feautures.setCellWidth(fp2, "33%");
hp_feautures.setCellWidth(fp3, "33%");
ws_features.add(imgUpload);
fp3.getElement().getStyle().setTextAlign(com.google.gwt.dom.client.Style.TextAlign.RIGHT);
initPopupDndFeature();
initPopupPlkFeature();
// ws_features.add
}
@ -77,13 +81,24 @@ public class WorkspaceFeatures extends Composite {
*
*/
private void initPopupDndFeature() {
overImgUpload.setAnimation(true);
overImgUpload.setWidget(imgUpload);
overImgUpload.setHeading("Workspace DnD");
overImgUpload.setText("Drop your files here to upload to Workspace");
overImgUpload.setPlacement(Placement.TOP);
overImgUpload.setTrigger(Trigger.HOVER);
overImgUpload.reconfigure();
overDnD.setAnimation(true);
overDnD.setWidget(dnd);
overDnD.setHeading("Workspace DnD");
overDnD.setText("Drag & Drop your files from Desktop to upload to Workspace");
overDnD.setPlacement(Placement.TOP);
overDnD.setTrigger(Trigger.HOVER);
overDnD.reconfigure();
// overImgUpload.show();
}
private void initPopupPlkFeature() {
overPlk.setAnimation(true);
overPlk.setWidget(plk);
overPlk.setHeading("Workspace Public Link");
overPlk.setText("Create links to files in your Workspace to download them. You can send the links to anyone by pasting them into Workspace Message, your emails, instant messages, etc.");
overPlk.setPlacement(Placement.TOP);
overPlk.setTrigger(Trigger.HOVER);
overPlk.reconfigure();
// overImgUpload.show();
}
@ -112,7 +127,7 @@ public class WorkspaceFeatures extends Composite {
* @param bool
*/
public void setDndFeatureVisible(boolean bool) {
imgUpload.setVisible(bool);
dnd.setVisible(bool);
}
}

View File

@ -11,6 +11,8 @@
</g:FlowPanel>
<g:FlowPanel ui:field="fp3">
<g:FlowPanel ui:field="ws_features">
<b:Label ui:field="dnd" text="DnD" styleName="margin-right-5"></b:Label>
<b:Label ui:field="plk" text="PlK" styleName="margin-right-5"></b:Label>
</g:FlowPanel>
</g:FlowPanel>
</g:HorizontalPanel>

View File

@ -138,7 +138,7 @@ public class GxtBorderLayoutPanel extends ContentPanel {
@Override
public void handleEvent(BoxComponentEvent be) {
toolBarItemDetails.refreshSize();
toolBarItemDetails.setItemsNumberToCenter();
updateSizeCard();
updateSizeGrid();
}

View File

@ -15,10 +15,7 @@ import org.gcube.portlets.user.workspace.shared.WorkspaceTrashOperation;
import com.extjs.gxt.ui.client.Style.ButtonScale;
import com.extjs.gxt.ui.client.Style.HorizontalAlignment;
import com.extjs.gxt.ui.client.event.BaseEvent;
import com.extjs.gxt.ui.client.event.ButtonEvent;
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.event.SelectionListener;
import com.extjs.gxt.ui.client.widget.HorizontalPanel;
import com.extjs.gxt.ui.client.widget.Label;
@ -69,6 +66,15 @@ public class GxtBottomToolBarItem extends ToolBar{
initToolbar();
}
/* (non-Javadoc)
* @see com.extjs.gxt.ui.client.widget.Component#onLoad()
*/
@Override
protected void onLoad() {
super.onLoad();
setItemsNumberToCenter();
}
private void initToolbar(){
btnGetTrash = new Button("Trash");
@ -158,15 +164,14 @@ public class GxtBottomToolBarItem extends ToolBar{
hpItemsNumber.setHorizontalAlign(HorizontalAlignment.RIGHT);
hpItemsNumber.add(labelItemsNumber);
hpItemsNumber.addListener(Events.Render, new Listener<BaseEvent>() {
// hpItemsNumber.addListener(Events.Render, new Listener<BaseEvent>() {
//
// @Override
// public void handleEvent(BaseEvent be) {
// setItemsNumberToCenter();
// }
// });
@Override
public void handleEvent(BaseEvent be) {
refreshSize();
}
});
// add(new FillToolItem());
add(hpItemsNumber);
FillToolItem filler = new FillToolItem();
@ -276,7 +281,7 @@ public class GxtBottomToolBarItem extends ToolBar{
hpItemsNumber.layout();
}
public void refreshSize(){
public void setItemsNumberToCenter(){
if(this.isRendered()){
String width = this.getElement().getStyle().getWidth();
@ -285,7 +290,7 @@ public class GxtBottomToolBarItem extends ToolBar{
long intWidth = Long.parseLong(width);
intWidth = (intWidth/2)-30; //calculate the center
intWidth = intWidth-(60*3); //previous buttons
GWT.log("width is "+width);
GWT.log("refreshSize width is "+width);
// hpItemsNumber.setWidth(intWidth+"px");
hpItemsNumber.setStyleAttribute("margin-left", intWidth+"px");
hpItemsNumber.layout();

View File

@ -389,4 +389,8 @@
.thirty_percent {
width: 33%;
}
.margin-right-5{
margin-right: 5px;
}