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;
|
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.Label;
|
||||||
import com.github.gwtbootstrap.client.ui.Popover;
|
import com.github.gwtbootstrap.client.ui.Popover;
|
||||||
import com.github.gwtbootstrap.client.ui.constants.Placement;
|
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.Composite;
|
||||||
import com.google.gwt.user.client.ui.FlowPanel;
|
import com.google.gwt.user.client.ui.FlowPanel;
|
||||||
import com.google.gwt.user.client.ui.HorizontalPanel;
|
import com.google.gwt.user.client.ui.HorizontalPanel;
|
||||||
import com.google.gwt.user.client.ui.Image;
|
|
||||||
import com.google.gwt.user.client.ui.Widget;
|
import com.google.gwt.user.client.ui.Widget;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -33,10 +30,16 @@ public class WorkspaceFeatures extends Composite {
|
||||||
|
|
||||||
@UiField
|
@UiField
|
||||||
HorizontalPanel hp_feautures;
|
HorizontalPanel hp_feautures;
|
||||||
|
|
||||||
|
@UiField
|
||||||
|
Label dnd;
|
||||||
|
|
||||||
|
@UiField
|
||||||
|
Label plk;
|
||||||
|
|
||||||
private Image imgUpload = new Image(WsPortletResources.ICONS.upload16());
|
private Popover overDnD = new Popover();
|
||||||
|
|
||||||
private Popover overImgUpload = new Popover();
|
private Popover overPlk = new Popover();
|
||||||
|
|
||||||
@UiField
|
@UiField
|
||||||
FlowPanel fp1;
|
FlowPanel fp1;
|
||||||
|
@ -65,11 +68,12 @@ public class WorkspaceFeatures extends Composite {
|
||||||
public WorkspaceFeatures() {
|
public WorkspaceFeatures() {
|
||||||
|
|
||||||
initWidget(uiBinder.createAndBindUi(this));
|
initWidget(uiBinder.createAndBindUi(this));
|
||||||
initPopupDndFeature();
|
|
||||||
hp_feautures.setCellWidth(fp1, "33%");
|
hp_feautures.setCellWidth(fp1, "33%");
|
||||||
hp_feautures.setCellWidth(fp2, "33%");
|
hp_feautures.setCellWidth(fp2, "33%");
|
||||||
hp_feautures.setCellWidth(fp3, "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
|
// ws_features.add
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,13 +81,24 @@ public class WorkspaceFeatures extends Composite {
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
private void initPopupDndFeature() {
|
private void initPopupDndFeature() {
|
||||||
overImgUpload.setAnimation(true);
|
overDnD.setAnimation(true);
|
||||||
overImgUpload.setWidget(imgUpload);
|
overDnD.setWidget(dnd);
|
||||||
overImgUpload.setHeading("Workspace DnD");
|
overDnD.setHeading("Workspace DnD");
|
||||||
overImgUpload.setText("Drop your files here to upload to Workspace");
|
overDnD.setText("Drag & Drop your files from Desktop to upload to Workspace");
|
||||||
overImgUpload.setPlacement(Placement.TOP);
|
overDnD.setPlacement(Placement.TOP);
|
||||||
overImgUpload.setTrigger(Trigger.HOVER);
|
overDnD.setTrigger(Trigger.HOVER);
|
||||||
overImgUpload.reconfigure();
|
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();
|
// overImgUpload.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -112,7 +127,7 @@ public class WorkspaceFeatures extends Composite {
|
||||||
* @param bool
|
* @param bool
|
||||||
*/
|
*/
|
||||||
public void setDndFeatureVisible(boolean bool) {
|
public void setDndFeatureVisible(boolean bool) {
|
||||||
imgUpload.setVisible(bool);
|
dnd.setVisible(bool);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,8 @@
|
||||||
</g:FlowPanel>
|
</g:FlowPanel>
|
||||||
<g:FlowPanel ui:field="fp3">
|
<g:FlowPanel ui:field="fp3">
|
||||||
<g:FlowPanel ui:field="ws_features">
|
<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:FlowPanel>
|
</g:FlowPanel>
|
||||||
</g:HorizontalPanel>
|
</g:HorizontalPanel>
|
||||||
|
|
|
@ -138,7 +138,7 @@ public class GxtBorderLayoutPanel extends ContentPanel {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void handleEvent(BoxComponentEvent be) {
|
public void handleEvent(BoxComponentEvent be) {
|
||||||
toolBarItemDetails.refreshSize();
|
toolBarItemDetails.setItemsNumberToCenter();
|
||||||
updateSizeCard();
|
updateSizeCard();
|
||||||
updateSizeGrid();
|
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.ButtonScale;
|
||||||
import com.extjs.gxt.ui.client.Style.HorizontalAlignment;
|
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.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.event.SelectionListener;
|
||||||
import com.extjs.gxt.ui.client.widget.HorizontalPanel;
|
import com.extjs.gxt.ui.client.widget.HorizontalPanel;
|
||||||
import com.extjs.gxt.ui.client.widget.Label;
|
import com.extjs.gxt.ui.client.widget.Label;
|
||||||
|
@ -69,6 +66,15 @@ public class GxtBottomToolBarItem extends ToolBar{
|
||||||
initToolbar();
|
initToolbar();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see com.extjs.gxt.ui.client.widget.Component#onLoad()
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected void onLoad() {
|
||||||
|
super.onLoad();
|
||||||
|
setItemsNumberToCenter();
|
||||||
|
}
|
||||||
|
|
||||||
private void initToolbar(){
|
private void initToolbar(){
|
||||||
|
|
||||||
btnGetTrash = new Button("Trash");
|
btnGetTrash = new Button("Trash");
|
||||||
|
@ -158,15 +164,14 @@ public class GxtBottomToolBarItem extends ToolBar{
|
||||||
hpItemsNumber.setHorizontalAlign(HorizontalAlignment.RIGHT);
|
hpItemsNumber.setHorizontalAlign(HorizontalAlignment.RIGHT);
|
||||||
hpItemsNumber.add(labelItemsNumber);
|
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(new FillToolItem());
|
||||||
add(hpItemsNumber);
|
add(hpItemsNumber);
|
||||||
FillToolItem filler = new FillToolItem();
|
FillToolItem filler = new FillToolItem();
|
||||||
|
@ -276,7 +281,7 @@ public class GxtBottomToolBarItem extends ToolBar{
|
||||||
hpItemsNumber.layout();
|
hpItemsNumber.layout();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void refreshSize(){
|
public void setItemsNumberToCenter(){
|
||||||
|
|
||||||
if(this.isRendered()){
|
if(this.isRendered()){
|
||||||
String width = this.getElement().getStyle().getWidth();
|
String width = this.getElement().getStyle().getWidth();
|
||||||
|
@ -285,7 +290,7 @@ public class GxtBottomToolBarItem extends ToolBar{
|
||||||
long intWidth = Long.parseLong(width);
|
long intWidth = Long.parseLong(width);
|
||||||
intWidth = (intWidth/2)-30; //calculate the center
|
intWidth = (intWidth/2)-30; //calculate the center
|
||||||
intWidth = intWidth-(60*3); //previous buttons
|
intWidth = intWidth-(60*3); //previous buttons
|
||||||
GWT.log("width is "+width);
|
GWT.log("refreshSize width is "+width);
|
||||||
// hpItemsNumber.setWidth(intWidth+"px");
|
// hpItemsNumber.setWidth(intWidth+"px");
|
||||||
hpItemsNumber.setStyleAttribute("margin-left", intWidth+"px");
|
hpItemsNumber.setStyleAttribute("margin-left", intWidth+"px");
|
||||||
hpItemsNumber.layout();
|
hpItemsNumber.layout();
|
||||||
|
|
|
@ -389,4 +389,8 @@
|
||||||
|
|
||||||
.thirty_percent {
|
.thirty_percent {
|
||||||
width: 33%;
|
width: 33%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.margin-right-5{
|
||||||
|
margin-right: 5px;
|
||||||
}
|
}
|
Loading…
Reference in New Issue