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:
parent
48339d7baa
commit
b6c136fa7b
|
@ -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;
|
||||
|
||||
/**
|
||||
|
@ -34,9 +31,15 @@ public class WorkspaceFeatures extends Composite {
|
|||
@UiField
|
||||
HorizontalPanel hp_feautures;
|
||||
|
||||
private Image imgUpload = new Image(WsPortletResources.ICONS.upload16());
|
||||
@UiField
|
||||
Label dnd;
|
||||
|
||||
private Popover overImgUpload = new Popover();
|
||||
@UiField
|
||||
Label plk;
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -138,7 +138,7 @@ public class GxtBorderLayoutPanel extends ContentPanel {
|
|||
|
||||
@Override
|
||||
public void handleEvent(BoxComponentEvent be) {
|
||||
toolBarItemDetails.refreshSize();
|
||||
toolBarItemDetails.setItemsNumberToCenter();
|
||||
updateSizeCard();
|
||||
updateSizeGrid();
|
||||
}
|
||||
|
|
|
@ -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,14 +164,13 @@ public class GxtBottomToolBarItem extends ToolBar{
|
|||
hpItemsNumber.setHorizontalAlign(HorizontalAlignment.RIGHT);
|
||||
hpItemsNumber.add(labelItemsNumber);
|
||||
|
||||
hpItemsNumber.addListener(Events.Render, new Listener<BaseEvent>() {
|
||||
|
||||
@Override
|
||||
public void handleEvent(BaseEvent be) {
|
||||
refreshSize();
|
||||
|
||||
}
|
||||
});
|
||||
// hpItemsNumber.addListener(Events.Render, new Listener<BaseEvent>() {
|
||||
//
|
||||
// @Override
|
||||
// public void handleEvent(BaseEvent be) {
|
||||
// setItemsNumberToCenter();
|
||||
// }
|
||||
// });
|
||||
|
||||
// add(new FillToolItem());
|
||||
add(hpItemsNumber);
|
||||
|
@ -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();
|
||||
|
|
|
@ -390,3 +390,7 @@
|
|||
.thirty_percent {
|
||||
width: 33%;
|
||||
}
|
||||
|
||||
.margin-right-5{
|
||||
margin-right: 5px;
|
||||
}
|
Loading…
Reference in New Issue