workspace/src/main/java/org/gcube/portlets/user/workspace/client/view/WorkspaceFeatures.java

119 lines
2.7 KiB
Java
Raw Normal View History

/**
*
*/
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;
import com.github.gwtbootstrap.client.ui.constants.Trigger;
import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
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;
/**
* The Class PageTemplate.
*
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it Feb 19, 2015
*/
public class WorkspaceFeatures extends Composite {
@UiField
Label ws_quote_alert;
@UiField
FlowPanel ws_features;
@UiField
HorizontalPanel hp_feautures;
private Image imgUpload = new Image(WsPortletResources.ICONS.upload16());
private Popover overImgUpload = new Popover();
@UiField
FlowPanel fp1;
@UiField
FlowPanel fp2;
@UiField
FlowPanel fp3;
private static WorkspaceFeaturesUiBinder uiBinder = GWT.create(WorkspaceFeaturesUiBinder.class);
/**
* The Interface PageTemplateUiBinder.
*
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it Feb 19,
* 2015
*/
interface WorkspaceFeaturesUiBinder extends
UiBinder<Widget, WorkspaceFeatures> {
}
/**
* Instantiates a new page template.
*/
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);
// ws_features.add
}
/**
*
*/
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();
// overImgUpload.show();
}
/**
* @param html
*/
public void updateQuotes(String html) {
ws_quote_alert.setText(html);
}
// public void showImgUploadDnD(boolean show) {
// if (show)
// overImgUpload.show();
// else
// overImgUpload.hide();
// }
/**
* @param bool
*/
public void setQuoteVisible(boolean bool) {
ws_quote_alert.setVisible(bool);
}
/**
* @param bool
*/
public void setDndFeatureVisible(boolean bool) {
imgUpload.setVisible(bool);
}
}